Author Archive

Migrating Cpanel to Virtualmin

Posted by on Monday, 11 May, 2009

For those who do not know what either are, CPanel and Virtualmin are very similar to Plesk. They are a way of managing all your virtual hosting needs if you have a server. You log into a web interface, add a domain and it automagicly reconfigures your server to accept email DNS and websites for it. You can then add email addresses easily and let users manage their own stuff. They make life very easy for those less knowledgeable about Linux and servers in general. Virtualmin is often migrated to as you can download the GPL version entirely free, and it works great. Alternatively you can pay and get a slightly better more featured version.

A nice tip from Jamie of Virtualmin for migration here.

As for migration, once you have the backups from cPanel you can more easily mass-migrate them into Virtualmin from the command line.
You could use a script like :

for file /cpanel/*.gz; do
virtualmin migrate-domain –type cpanel –source $file –pass foo
done

This will migrate all backups in the /cpanel , and give them the password ‘foo’ in Virtualmin. Sadly there is no way to extract the original password from a cPanel backup 🙁


Postgrey HOWTO for Centos and Debian based Linux – Postfix Greylisting

Posted by on Wednesday, 6 May, 2009

Greylisting is a great invention to minimize a huge pile of spam. Any SMTP server thats incorrectly configured or mail sent from infected desktop machines just tries the first time, gets bounced, and never tries again.

Legitimate email comes through fine, however the downside is it can take a few minutes more than the usual. Considering how much Spam greylisting prevents its worth it for a lot of people.

The quick and dirty of the install is.

For debian based distros (Ubuntu etc included)

apt-get install postgrey

For Redhat/Centos based distros you will need to add the DAG/rpmforge repos into your lists and then

yum install postgrey

Next you need to enable it to listen on a port. In debian edit the file /etc/defaults/postgrey and add-in/edit the line

POSTGREY_OPTS="--inet=127.0.0.1:60000 --delay=60"

For Redhat based releases you need to CREATE /etc/sysconfig/postgrey and add in the following line

OPTIONS="--inet=127.0.0.1:60000 --delay=60"

Now restart the postgrey daemon with

/etc/init.d/postgrey restart

If you do a netstat you can see its now listening on localhost port 60000 (unless you buggered something up of course)

Now you need to edit the /etc/postfix/main.cf
search for the line that has smtpd_recipient_restrictions and add to it

check_policy_service inet:127.0.0.1:60000

And average config will look something like this

smtpd_recipient_restrictions =
reject_unknown_recipient_domain,
permit_mynetworks,
check_policy_service inet:127.0.0.1:60000
permit

Now reload the postfix with /etc/init.d/postfix reload
Now all you need to do is check the logs with tail -f /var/log/maillog and hope you got it all going right.


Centos 5 – Adding extra sources for bleeding edge

Posted by on Wednesday, 6 May, 2009

So you got yourself say a Centos VPS or Server. Some guy comes along and develops you a website made in the latest and greated PHP version and yours isnt running it!.

Easily fixed. First of all to know, is Centos 5 is basicly RHEL 5 only free, you can use the same sources lists and rpms between the two.

So adding the first source would be the DAG/RPMForge lists. The FAQ is up here http://dag.wieers.com/rpm/FAQ.php which is pretty generic and basic.

Red Hat Enterprise Linux 5 / i386:

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Remembering that Centos 5 is the same as el5 (Red Hat Enterprise Linux … RHEL) this works nicely. You may find that you get the following error when using apt to update

E: Dynamic MMap ran out of room
E: Dynamic MMap ran out of room
E: Error occured while processing packagename
E: Problem with MergeList
/var/state/apt/lists/listname
E: msync
E: The package lists or status file could not be parsed or opened.

This can be fixed by putting the following line into the bottom of /etc/apt/apt.conf

APT::Cache-Limit 50000000;

At Rimuhosting where i work we usually default to Centos 5.3 which is pretty much the latest release. I found the DAG/RPMForge lists not quiet as up to date as the Remi lists at http://blog.famillecollet.com/pages/Config-en

The easy way to get these ones going is as follows

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

By default the remi lists are not enabled, you can use them indevidually with yum –enablerepo remi install packagename . Or you can edit the /etc/yum.repos.d/remi.repo and change the enabled=0 to enabled=1

Now you can yum update and yum upgrade nicely!

Let me know any other mirrors you found handy.