Posts Tagged howto

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.


Using apt-get

Posted by on Tuesday, 7 April, 2009

Using apt-get / Installing aplications on Debian based distro’s.

This is just a quick guide to get you started on installing and upgrading software on you debian or debian based distro of linux. It is not meant to be a comprehensive guide. From here on in where I refer to Debian I mean any debian based or other distro of linux that uses apt-get.

Finding Applications / Packages.

Software for debian is stored in packages. These packages contains the files required for an application and also referances to other packages required to run the software. The fastest way to search the packages currently availible (assuming your package cache is up to date, more later) is to use apt-cache.

The basic syntax is: apt-cache search

ie. finding an irc client


$ apt-cache search "irc client"
cgiirc - web based irc client
ctrlproxy - An IRC proxy with multiserver support
...
...
...
tinyirc - a tiny IRC client
tirc - token's irc client
xchat - IRC client for X similar to AmIRC
xchat-text - IRC client for console similar to AmIRC
zenirc - Major mode for wasting time

I have shortened the output here …

The alternative in to browse a package archive such as packages.debain.org But keep in mind that depending on your installation sources and version some packages may not be available to you.

Installing an Application / Packages.

Lets, for example, choose to install xchat, an excellent IRC client. To do this we simply execute this at a command prompt as ROOT user. apt-get install xchat (To log in as root type ‘su’ at the prompt and enter you root password when prompted, if you are on knoppix or your user has sudo access preffix the command with ‘sudo’)

you should get something like the following:


Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
xchat-common xchat-text
Suggested packages:
libnet-google-perl
The following packages will be upgraded:
xchat xchat-common xchat-text
3 upgraded, 0 newly installed, 0 to remove and 350 not upgraded.

As you can see this will install extra required two packages. You maybe prompted to confirm the download of the packages. You should also receive a summury of sizes. On confirmation apt-get will download the packages and configure them. Some software will require user interaction and will prompt you for input.

To upgrade an existing package you similarly type apt-get upgrade

Upgrading and Updating apt-get

As the list of packages changes regularly you may need to update you cache of available packages. This is done by executing the following as root: apt-get update

To upgrade all packages on you system you can try the following (again as root) apt-get upgrade This will generally download alot of files !!!

Sometime packages will be held back because of conflicting dependancies, etc. To force this try apt-get dist-upgrade after running apt-get update then apt-get upgrade .

Last-Modified: 2007-03-07 19:38:50