Plesk

Tips and tricks and fixes for the server control panel software from SWSoft.

Fetching mail with fetchmail

During a domain transfer, while DNS was still propogating I needed to retrieve mail from the old server to the new.

I did so thusly… # yum install fetchmail

$ touch .fetchmailrc $ chmod 600 .fetchmailc

I then added the following lines to .fetchmailrc

poll with proto POP3 user there with password "" is "" here

Then once ensuring you can POP3 out of the server (port 110) through the firewall, you can just run ‘fetchmail’ from the command line to grab the mail.

Topping it off with a cronjob for the duration of DNS propogation would probably be a sensible finish.

References:

http://theos.in/news/howto-configure-fetchmail-linux-or-unix-client-program-to-fetch-emails/

http://www.catb.org/~esr/fetchmail/fetchmail-FAQ.html

More >

Plesk Hard disk quotas

I had to enable quota support to my hard disk mounts on one of my new Plesk boxes today. This lets Plesk manage how much space is given to whomever… very necessary for a virtual hosting box.

I found these instructions on the Plesk forum, but not all in one place, hence…

Add ‘usrquota’ to the options in fstab. Mine looked like this before and after… before /dev/md0 / ext3 defaults 1 1 after /dev/md0 / ext3 defaults,usrquota 1 1

Then run these to get quotas working… # mount -o remount / # quotaoff -av # quotacheck -avum # quotaon -av

..and that should More >

Server build notes

Part 1 Retrieve the full license key from Plesk using the web control panel License Manager. Backup and download the key. # cp /etc/psa/psa.key /var/www/vhosts/<domain>/httpdocs/ Visit http://<domain>/psa.key Part 2 Then run the offline installer script… wget -q -O - http://www.atomicorp.com/installers/aooi |sh or tweak it slightly… # wget http://3es.atomicrocketturtle.com/tests/aooi-installer.sh # chmod +x aooi-installer.sh Edit the script # vi aooi-installer.sh :%s/www.gtlib.gatech.edu/mirror.linux.duke.edu/g :wq Run the install # ./aooi-installer.sh Open a serial console and watch what happens during reboots etc.

Part 3 Login as root with password ‘atomic555′ Change the root password # passwd Copy my firewall scripts to server and customise with new machinename /root/fw.on /root/fw.off /root/getfw.sh /etc/rc.d/rc.firewall_off Make them all executable More >

Plesk, 1and1 and CentOS

I’m currently building a new server for a client and am finding great success using the top notch tools from atomic rocket turtle. (Atomic Corp)

By using Scott’s AOOI script I have managed to install CentOS 4.4 on one of 1and1′s Business Server IIs along with PHP 5 and mysql 5. Taking a backup of the Plesk key before doing so, I was able to install a fresh Plesk 8.2 and have a bang up to date, future proofed box with all the features of the 1and1 build (64 bit, dual core, RAID1 etc.).

  1. Login as root and then… # wget More >

FTP in a Plesk stylee

I found myself wanting to create an extra FTP user for one of my Plesk machines that would only have access to a subdirectory of one of the machine’s domains.

It turns out this isn’t as tricky as I made it!

If you create a new OS user giving them the same user ID number as the primary FTP user and the Plesk group ‘psacln’, they have the same privileges. Giving them a home directory of the subdirectory instead of the primary user’s home directory chroots them inside it.. perfect.

1. Determine the uid number of the primary user (bob)

# cat /etc/passwd | More >

mysql_fix_privilege_tables doesn't work on Plesk machines?

The reason for this upgrade script failing for Plesk machines is due to Plesk changing the mysql ‘root’ account into ‘admin’.

To get the script to run successfully, you can simply open up the file /usr/bin/mysql_fix_privilege_tables and change the ‘user=”root” to user=”admin”.

Then start the script passing the parameter –password=xxx where xxx is your Plesk admin account’s password.

/usr/bin/mysql_fix_privilege_tables --password=xxx Super

Newly installed SSL certificates not being used on PLesk

I’ve come across this a couple of times and thought it worth adding here, so I’m more likely to remember next time.

You need to comment out or delete the default Virtualhost config in this file…

/etc/httpd/conf.d/ssl.conf

Look for the section starting with this…

VirtualHost _default_:443 This is the SWSoft knowlegdebase article that details the solution.

Restoring individual files from Plesk backups

I had to extract a single database record from a Plesk backup today. The backup utility within Plesk 7.5.4 is not intended for accessing like this. It’s designed to restore a whole domain at once rather than getting hold of mistakenly deleted items, but with a few tools and a modicum (JCB) of patience, it can be done.

The backup file is a mime-encoded, part gzipped file which contains an xml file as an index. You first need to unencode it using something like ripmime. Download the latest stable version, unzip and install it following the instructions in the contained ‘INSTALL’ More >