Have you tried MySQLTuner yet? It's free and it makes optimizing your MySQL server easier than ever!

Archive for the “Plesk” Category


Normally, qmail will be able to process the mail queue without any interaction from the system administrator, however, if you want to force it to process everything that is in the queue right now, you can do so:

kill -ALRM `pgrep qmail-send`

If for some peculiar reason you don’t have pgrep on your server, you can go about it a slightly different way:

kill -ALRM `ps ax | grep qmail-send | grep -v grep | awk '{print $1}'`

Your logs should begin filling up with data about e-mails rolling through the queue.

Comments No Comments »

Upgrading Plesk from 7.5.x to 8.x will change your Plesk-related MySQL tables from MyISAM to InnoDB. This allows for better concurrency in the Plesk panel when a lot of users are logged in simultaneously. However, some server administrators will disable InnoDB support in MySQL to save resources. This will cause problems after the upgrade.

Plesk may display an error on a white page that looks something like:

Cannot initialize InnoDB

This could mean that InnoDB support was disabled when MySQL was started. To correct this issue, search through the /etc/my.cnf for this line:

skip-innodb

If you find it in your configuration, remove it, and then restart MySQL. To test that InnoDB is enabled, you can refresh the Plesk page, or you can log into MySQL and run SHOW ENGINES. The output from the SHOW ENGINES statement should show YES on the line with InnoDB.

Should DISABLED appear instead, you may have an issue with your InnoDB configuration in your /etc/my.cnf. Be sure to check for innodb_data_file_path and make sure that it is set to an appropriate value.

A value of NO is not a good sign. This means that your version of MySQL was compiled without InnoDB support. This means that it cannot be enabled at runtime because MySQL wasn’t built with any support for InnoDB. Be sure to recompile MySQL with --with-innodb or obtain a new package for your operating system which includes InnoDB support.

If you suspect that your MySQL InnoDB configuration is incorrect, you may want to review this documentation on MySQL’s site:

For MySQL 5: 13.2.3. InnoDB Configuration
For MySQL 4/3.23: 13.2.4. InnoDB Configuration

Comments No Comments »

It’s always been a bit of a challenge to disable TRACE and TRACK methods with Plesk. The only available options were to create a ton of vhost.conf files or adjust the httpd.include files and prevent modifications with chattr (which is a bad idea on many levels).

Luckily, Parallels has made things easier with a new knowledge base article.

Comments 1 Comment »

If you’re working in Plesk and you receive this error:

mchk: Unable to initialize quota settings for someuser@somedomain.com

Run this command to fix the issue, but be patient:

find /var/qmail/mailnames -type d -name '.*' ! -name '.spamassassin' -ls -exec touch '{}'/maildirfolder \; -exec chown popuser:popuser '{}'/maildirfolder \;

Thanks to Mike Jackson for this one.

Comments No Comments »

On a Plesk server, the maximum size for an individual e-mail sent through qmail is unlimited. You can limit this size by adding a number to the /var/qmail/control/databytes file.

If you wanted to limit this to something like 10MB, you can just run the following command:

echo “10485760″ > /var/qmail/control/databytes

This will limit the size of messages (including attachments) to 10MB as a maximum.

Comments 1 Comment »

I really dislike qmail. But, since I use Plesk, I’m stuck with it. However, I found a way to improve it’s awful mail queue performance by putting the mail queue onto a ramdisk. This is actually pretty darned easy to do.

First, toss a line like this into your /etc/fstab:

none    /mailqueue      tmpfs   defaults,size=100m,nr_inodes=999k,mode=775      0       0

This will make a 100MB ramdisk on /mailqueue. Now, just symlink /var/qmail/mqueue to /mailqueue and move your e-mail over:

# mount /mailqueue
# chmod 750 /mailqueue
# chown qmailq:qmail /mailqueue
# mv /var/qmail/mqueue /var/qmail/mqueue-old
# ln -s /mailqueue /var/qmail/mqueue
# rsync -av /var/qmail/mqueue-old /mailqueue

This has significantly cut the iowait on my server during heavy e-mail periods. In addition, tools like qmHandle now fly through my mail queue and give me reports very quickly.

Comments 4 Comments »

One of my biggest Plesk gripes is dealing with the Plesk Professional Website Editor. One of the most common occurrences with PPWSE is that it hangs when you attempt to log into the server. Normally, this happens when a server is behind a firewall, and it is using private IP’s.

Plesk will actually query the DNS for the domain (rather than simply connecting to the localhost), try to reach the public IP, and the traffic will be blocked by the firewall. This creates a login session that appears to hang, and then it shows “FTP: not connected” in the interface.

The fix is actually quite easy:

1) Be sure that the ftp.domain.com CNAME/A record exists
2) Add a line to /etc/hosts that forces ftp.domain.com to resolve to the proper private IP address.

The third item should be to stop using PPWSE, but that’s the hardest one to work out. I’d recommend using something like TextMate on a Mac along with Transmit, but you can get some good results out of Dreamweaver as well. Whatever you do, don’t use Contribute.

Comments No Comments »

I saw a ticket the other day where a customer received this error from Horde when trying to expand items on the left pane of the interface:

Fatal error: Cannot use string offset as an array in /www/horde/lib/Horde/Block/Layout/Manager.php on line 389

It turns out that Plesk 8.1.1 bundles Horde 3.1.3 which has an occasional bug within the interface. Upgrading to Plesk 8.2.0 corrects the issue as Horde 3.1.4 is installed with the upgrade.

See Horde’s bug page for more information.

Comments No Comments »

One of my biggest complaints on RHEL 4 is the large resource usage by the version of SpamAssassin that is installed. When it runs, it uses a ton of CPU time and causes a lot of disk I/O as well. When running top, you may see multiple spamd processes. For a high-volume e-mail server (like the one I administer), this is simply unacceptable.

I decided to do something about it, and here are the steps:

First, you will need two RPMs:
Latest SpamAssassin RPM from Dag
The psa-spamassassin RPM from SWSoft/Parallels.

Once you have them both on the server, install the new SpamAssassin package from Dag:

# rpm -Uvh spamassassin-(version).el4.rf.(arch).rpm

At this point, Plesk’s spamassassin scripts will be non-functional, but the next step will fix it:

# rpm -Uvh --force psa-spamassassin-(version).(arch).rpm

NOTE: DO NOT REMOVE the psa-spamassassin RPM. This will begin stripping your system of all SpamAssassin configurations and it cannot be reversed!

Plesk’s SpamAssassin scripts have been restored at this point in the process. Now, we need to do the part that really makes SpamAssassin work efficiently:

# sa-update; sa-compile;

This will update the SpamAssassin rules, and it will compile the rules with re2c (you may also need to get this RPM from Dag). This compilation means less disk access, and less CPU time being used to process e-mails.

To activate the compiled rules within SpamAssassin, uncomment the plugin line in /etc/mail/spamassassin/v320.pre:

# Rule2XSBody - speedup by compilation of ruleset to native code
#
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody

Please bear in mind that this process is done at your own risk. This may cause issues getting support from SWSoft or your hosting company. This has been tested on Red Hat Enterprise Linux 4 64-bit with Plesk 8.1.1, 8.2.0, and 8.2.1 with SpamAssassin 3.2.3 and 3.2.4.

Comments No Comments »

One of the questions I receive the most is: “What version of Plesk works with MySQL 5?” The minimum version of Plesk for MySQL 5 is 8.1.0. If you install MySQL 5 on a version prior to 8.1.0, you may be able to access then panel in the other 8.x versions, but your upgrades will fail miserably.

In case you’re curious about a slightly older system, full MySQL 4 support was available in Plesk 7.5.3. However, MySQL 4 is supported on some distributions as far back as 7.1:

Fedora Core 2
Mandrake 10
SuSE 9.0
FreeBSD 5.2.1

Check out SWSoft/Parallel’s site for more information about MySQL 4 and 5 support.

Comments No Comments »