Accessing Data on Xen Guest Image

(via linuxwave.blogspot.com)

Accessing xen guest image is very easy if the image is not lvm partitioned. But the main problem arise when the image is of lvm format and normal mount command cannot be used. Here I will show both the way. The first is when ext filesystem is used, and the second is when lvm is used...

unable to include potential exec

Recent upgrade to Apache-2.2.3 secured down on executables not able to be included within a SSI include call and was getting "unable to include potential exec" in the apache error log file.

Apparently .shtml files were being used as includes via SSI. Changing the included files to .html resolved the issue.

Below was the command issued from the document root to quickly rename all the embedded leftmenu.shtml to leftmenu.html:

cp -a leftmenu.shtml leftmenu.html
find -L -name "*.shtml" -type f -printf "\"%p\"\n" | xargs perl -pi -e 's/leftmenu\.shtml/leftmenu\.html/g'

Secure browsing with SSH Tunnel and SOCKS Proxy Forwarding

(via embraceubuntu.com)

$ ssh -D 9999 username@ip-address-of-ssh-server

This will create a SOCKS proxy on port “9999″ of your computer (localhost). This is a secure tunnel to the server. Now all you have to do is set the preference in Firefox to use a SOCKS proxy. The proxy is, “localhost”, with the port 9999.

Howto install Cherokee web server with MySQL, PHP support on Jaunty

(via www.ubuntugeek.com)

Cherokee is a very fast, flexible and easy to configure Web Server. It supports the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, SSI, TLS and SSL encrypted connections, Virtual hosts, Authentication, on the fly encoding, Load Balancing, Apache compatible log files, Data Base Balancing, Reverse HTTP Proxy, Traffic Shaper,Video Streaming and much more.

Back In Time – A Simple backup tool for ubuntu

(via www.ubuntugeek.com)

Back In Time is a simple backup tool for Linux inspired from “flyback project” and “TimeVault”.The backup is done by taking snapshots of a specified set of directories.

Shadow password hash explained

You can programmatically generate shadow password hash via:

$ openssl passwd -1 -salt G5cYam5w test.123
$1$G5cYam5w$z0NDUjMRX4xVBKw9Nb6YL0

-1 means md5
G5cYam5w is a random salt (minimum 8)
test.123 is the password

Here is the breakdown:

The first $1 means that it is an md5 hash.
The second $G5cYam5w is a random salt.
The third $z0NDUjMRX4xVBKw9Nb6YL0 is the md5 hash.

TV-Browser – Online Digital TV Guide in Ubuntu

(via www.ubuntugeek.com)

TV-Browser is a simple Digital TV Guide that supports more than 500 TV channels and 80 Radio stations. TV-Browser collects TV program information from different sources on the internet and presents it neatly as a Digital TV Guide with pictures where there possible (if there are no copyright issues).

Determine cpu bit

You can try this to find out if your CPU/Processor is 32 bit or 64 bit:

cat /proc/cpuinfo | grep flags | grep lm

lm means Long Mode = 64 bit CPU

Also:

getconf LONG_BIT

Should display 32 or 64.

suphp-0.7.1 and DirectAdmin

Recently upgraded server running DirectAdmin to suphp-0.7.1 via the Custombuild. However, got "500 Internal Server Error" on accessing sites running on php5-cgi with log as below:

SecurityException in Application.cpp:511: Unknown Interpreter: php

The solution was to update the suphp.conf file as below:

Edit "/usr/local/suphp/etc/suphp.conf" and change from:

[handlers]
;Handler for php-scripts
x-httpd-php5=php:/usr/local/php5/bin/php-cgi

;Handler for CGI-scripts
x-suphp-cgi=execute:!self

to:

[handlers]
;Handler for php-scripts
x-httpd-php5="php:/usr/local/php5/bin/php-cgi"r />
;Handler for CGI-scripts
x-suphp-cgi="execute:!self"

Note the double quotes for the variables.

Running `./build rewrite_confs` should fix this issue as well.

Plesk rblsmtpd and smtp authentication

On Debian with Plesk-8.2 installed, /etc/inetd.conf show up with:

smtp stream tcp nowait.1000 root /var/qmail/bin/tcp-env tcp-env  /usr/sbin/rblsmtpd  -r bl.spamcop.net -r zen.spamhaus.org /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true

Essentially, when the SMTP connection is made, rblsmtpd is handed the connection and does its DNSBL checking. It’s then responsible for either executing the next program (relaylock) if there’s no match, or handles the connection itself if it does find a match. Thus smtp authentication never takes place if your IP is listed in PBL.

On checking Parallels Forum, I came across this post, which suggested:

If you use an dnsrbl in Plesk that lists the IP of someone trying to connect to your server to send email then they will not be able to use your server for smtp on port 25. The dnsrbl will block their attempts. This is normal and expected behaviour in Plesk.

The instructions you read about using authenticated smtp to get around the problem do not apply to the default installation of Plesk (and other similar setups). The idea of the instructions you read is that by using authenticated smtp you will bypass the dnsrbl, and therefore will not be blocked. This does not happen with the default installation of Plesk so the instructions won't work (they are rather simplistic).

The solution in Plesk 8.4 is a simple one. Enable the "submission" option in Plesk, ask your customers to change to port 587 from port 25 in their email clients and require them to use smtp authentication (remember to open up your firewall for port 587 too). This basically creates a second smtp instance listening on port 587 instead of port 25, does not have any dnsrbl blocking and REQUIRES users to use smtp authentication in order to be able to use it. No spam will come via that port because a) server to server email transfer happens on port 25 and b) it requires authentication.

(A similar solution will work in earlier versions of Plesk but rather than ticking a box in the control panel to get it to happen you have to copy a single file and edit two lines in it, but it works just as well and basically does the same thing)

The other option you can go for is to install spamdyke (search the forum for step by step instructions) which does bypass all dnsrbls when smtp authentication takes place. Note that when you use spamdyke you will not be able to use pop-before-relay authentication, and that you set up dnsrbls within spamdyke's configuration files, not via Plesk. spamdyke does add a whole plethora of additional anti-spam measures, however, and it is well worth installing if you don't need pop-before-relay.

Since version of Plesk is older, I put in the below lines in /etc/inetd.conf and restarted inetd.

# Submission port 587 without dnsblcheck
submission stream tcp nowait.1000 root /var/qmail/bin/tcp-env tcp-env  /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true

Now on using the port 587 instead of port 25, users are able to autheticate and send email via the SMTP/Submission server.

Comment