Archive for August, 2010

MySQL 5.1.x on Plesk 8.3 and later

Tuesday, August 3rd, 2010

I have upgraded MySQL to version 5.1.48 on a number of CentOS based servers running different versions of Plesk. The versions of Plesk ranged from 8.3.0 all the way to 9.3.0.

IMPORTANT: After the upgrade, run

mysql_upgrade ––user=admin ––password=`cat /etc/psa/.psa.shadow`

to ensure all the required tables for MySQL 5.1.x gets created.

I also recommend running a

mysqlcheck ––optimize ––user=admin ––password=`cat /etc/psa/.psa.shadow` ––all-databases

to optimise all databases for MySQL 5.1.x after the upgrade completes.

It goes without saying, but it is a VERY GOOD IDEA, to backup /var/lib/mysql, before you start with the upgrade process.

Please note that since MySQL 5.0.12, MySQL adheres to the SQL:2003 standard. This may potentially break some SQL statements that appears to be valid SQL statements and that worked perfectly in MySQL 4.x.

Lastly, I picked up one error with one database on one server, so far:

When clients try to access their database via “DB WebAdmin” in the Plesk control panel:

MySQL said: Documentation
Non-static method PMA_Config::isHttps() should not be called statically

The fix is simple and published at the following URLs:

http://kb.parallels.com/en/1869
OR
http://rackerhacker.com/2007/07/01/plesk-and-phpmyadmin-non-static-method-pma_configishttps-should-not-be-called-statically/

Courier-IMAP 4.x and later with Plesk 8.3

Tuesday, August 3rd, 2010

I have not confirmed this problem in any version other than Plesk 8.3.0, simply because I have not had the time. :(

According to the Parallels forums and documentation, you should be able to upgrade the version of Courier-IMAP running on the server to any later version.

I however attempted to upgrade to Courier-IMAP 4.7.0 and 4.8.0 using authlib 0.6.3 with no success.

Then I read the following entry in the Courier-IMAP Changelog:

2004-11-05 Mr. Sam

* pop3dserver.c (main): Authenticated address is in AUTHENTICATED,
not AUTHADDR, now.

It would appear that this one change, breaks the authpsa authentication module so that one can not implement later versions of Courier-IMAP on Plesk 8.3.0, since authpsa expects the authentication information in the AUTHADDR shell variable.

Courier-IMAP 3.0.8 on CentOS with Plesk

Tuesday, August 3rd, 2010

I ran into a problem where I wanted to recompile Courier-IMAP so that it can work with Plesk 8.3 on my CentOS server.

After a lot of searching to locate courier-imap-3.0.8.tar.bz which is now a very outdated version of Courier-IMAP, I bumped into a problem during the recompiling of Courier-IMAP.

The error I received was:
In file included from authstaticlistsearch.c:9:
/usr/include/stdio.h:385: error: syntax error before ‘&&’ token

A bit of Googling lead me to a February 2005 post on the atmail website, which I repeat below for ease of reference:

Patching Courier-IMAP for Fedora/Redhat non-RPM in

This article applies to @Mail Server installations only.

Description: The standard Courier-IMAP 3.0.8 distribution will not build on stock Fedora/Redhat systems. Compilation fails while building the authlib library, usually with an error message like:

In file included from authstaticlistsearch.c:9:
/usr/include/stdio.h:385: error: syntax error before ‘&&’ token

A review of the stdio.h file shows that no ‘&&’ symbols appears on or near line 385.

Solution: The courier-imap/authlib directory contains a file named ‘debug.h’ to support the debugging of authentication attempts against the Courier IMAP server. This file contains a C preprocessor macro named ‘dprintf’ that conflicts with the ‘dprintf’ function defined in glibc’s ‘stdio.h’. This conflict isn’t a problem so long as ‘#include ‘ appears before ‘#include “debug.h”‘ in the authlib source files. Unfortunately, this is not the case for files ‘authstaticlistsearch.c’, ‘authmoduser3.c’, ‘mod.h’, ‘authtest.c’, ‘debug.c’, and ‘authdaemon.c’.

To fix this problem, open these files in a text editor and move the ‘#include “debug.h”‘ line so that it is the last include directive. Make sure that you do not paste it into a ‘#if … #endif’ block. Once you have made these changes, the build process should succeed.