Posts Tagged ‘centos’

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 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.

Duplicate RPM entries

Monday, November 9th, 2009

I was seeing duplicate RPM entries for almost all the installed RPMs on my new x86_64 server running CentOS 5.3

After a bit of reading I found out that it is due to the i386 and x86_64 libraries being installed on my 64-bit machine.

A little more reading later and I found the solution, which is simply to specify a different query format for RPM

vi /etc/rpm/macros

%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}

Plesk 9.2.x & tomcat5

Saturday, September 12th, 2009

The startup scripts for tomcat5 on Plesk 9.2.x for Linux is broken on both 32-bit and 64-bit platforms, at very least for CentOS 5.

The fix is trivial.

Set the JAVA_HOME variable in the /etc/tomcat5/tomcat5.conf file as well as the /etc/sysconfig/tomcat5 file.

Apply the following fix to the /usr/bin/dtomcat5 script.

Around line 67 of the file it should read:

if [ -z “$CATALINA_HOME” ]; then
    TOMCAT_CFG=”/etc/tomcat5/tomcat5.conf”
fi

Change the above code, by adding one line, so it reads as follows:

if [ -z “$CATALINA_HOME” ]; then
    TOMCAT_CFG=”/etc/tomcat5/tomcat5.conf”
    . “${TOMCAT_CFG}”
fi

Testing the change can be achieved by running the following command:

tomcat5 version

It should produce output similar to the information below:

Using CATALINA_BASE: /usr/share/tomcat5
Using CATALINA_HOME: /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:
Server version: Apache Tomcat/5.5.23
Server built: Jul 27 2009 05:24:08
Server number: 5.5.23.0
OS Name: Linux
OS Version: 2.6.18-128.7.1.el5
Architecture: amd64
JVM Version: 1.6.0-b09
JVM Vendor: Sun Microsystems Inc.

Urrgghh …. FrontPage!

Saturday, December 1st, 2007

10 December 2007: I have not been able to get this solution to work at all, even though mod_frontpage is compiled against Apache 2.2.

20 December 2007: I have found enough time to spend hours on debugging the problem and I have successfully been able to get mod_frontpage working on my CentOS 5 server running Plesk 8.2.1 and Apache 2.2. I have updated the article below where needed.

As most of you are aware, Microsoft FrontPage (FP) has long ago reached its end-of-life. Microsoft no longer distributes FrontPage or FrontPage Server Extensions (FPSE). Now, this may be all well enough and most us understand why. The problem unfortunately lies with the user base. Many people still use and rely on the old outdated versions of Microsoft FrontPage.

SWSoft stopped shipping FPSE as of Plesk version 8.1.0. The last version of FPSE that I could locate was in version 8.0.1 of Plesk.

Version 8.0.1 was also never released for CentOS5 or Red Hat Enterprise Linux 5 (RHEL5), which means that there are effectively no RPMs for FPSE, that was compiled against Apache 2.2.x.

This effectively meant that you had to search for an OLD copy of fp50.lin.tar.gz and compile it yourself. Not the most ideal solution.

Enter, crash. crash provided the solution to the problem on SWSoft’s forum. I will be repeating most of crash’s post below.

You will need one of the older SWSoft FPSE RPM’s. I used frontpage-5.0-72psa.centos4.2 and frontpage-5.0-72psa.rhel4. The RPMs are located in the Plesk 8.0.1 .tar.gz file, in the ./opt/fp directory.

You will need to install one of the above RPM’s onto your system.

Once installed, do the following:

cd ~
mkdir frontpage-5.0
cd frontpage-5.0
cp -afr /usr/local/frontage .
cd ..
tar -cvf frontpage-5.0.tgz ./frontpage-5.0/

You should now have a frontpage-5.0.tgz file, that will be used.

crash provided the following patches to have mod_frontpage compile against Apache 2.2.x. (The patches should allow you to compile mod_frontpage against Apache 2.0.x or Apache 2.2.x [There are a few tiny differences])

Download the patches: FrontPage Server Extension Patches for CentOS5 and Apache 2.2.x (The file was updated on 20 December 2007)

You need to have the httpd-devel RPM installed. yum install httpd-devel, will usually be sufficient.

Now do the following:

cd /usr/src/redhat
tar zxvf mod_frontpage-patches.tgz
cd SPECS
rpmbuild -bb frontpage.spec

If all goes well, the RPM build process should complete without any errors and you will have a brand new RPM to install FPSE with on CentOS5/RHEL5.

Credit to crash’s post. I discovered a few bugs in the patches originally provided by crash.

A few tips:

  1. If you installed the SWSoft RPM, you need to remove the mod_frontpage entry from the LoadModules section in the /etc/httpd/conf/httpd.conf file. If you do not Apache will complain that mod_frontpage is already loaded when you restart Apache.
  2. I have commented out the last 3 lines from /etc/httpd/conf.d/mod_frontpage.conf. Plesk already caters for this in the httpd.include file in each vhost.
  3. FrontPage Administration Pages only work in Internet Explorer, or at least for me.
  4. The FrontPage Server Extensions are EXTREMELY sensitive to file permissions.

The daemons that bugged me.

Saturday, December 1st, 2007

With every major enterprise Linux release, Red Hat adds a number of new daemons to the startup of the server. Most of these daemons has a very clear function. I have however pondered what all the daemons are for. Although nice to have many of the daemons simply eats away at your resources and if not needed should really be disabled.

Red Hat was kind enough to release the following information in the Red Hat Magazine article, with the heading: “Understanding your (Red Hat Enterprise Linux) daemons“.

Of course the above information is very handy for CentOS, which is based on Red Hat Enterprise Linux.

Dr.Web and CentOS5

Saturday, December 1st, 2007

Dr.Web and CentOS5 does not like each other by default.

The version of Dr.Web used in Plesk 8.2.x, is linked against older versions of libstdc++ and openssl.

To get Dr.Web to run on CentOS5, you need to install the some compatibility libraries.

The following should get you sorted:

yum install compat-libstdc++-33.i386 openssl097a.i386