I’ve just had a bit of an “oh shit” moment! So thought I’d blog how I got out of it.
Parallels is the company that produces
Plesk. On the whole it’s a pretty good bit of server software which helps to manage a single machine that supports many virtual hosts without using virtualisation. It uses the idea of Customers, Subscriptions, Clients and Domains in order to allow the owner to basically sub-let their server to other resellers. The main criticism is that its update cycle is unpredictable and really slow. They tend to upgrade the integral software as new (chargeable) major version releases with no upgrade path. It’s fine for them but business moves a bit quicker than they do. We need new versions of PHP and MySQL a bit quicker because the latest application software often relies on them.
I wanted to install the latest
Lime Survey but couldn’t so I had to upgrade the whole server from Plesk 9 to Plesk 10 and transfer all the domains with their set up over to the new appliance. Not a particularly nice job!
A month ago I was updating the
mysql client libraries with yum and it updated the Plesk’s
PHP as a dependency. The update took PHP from version 5.0.2 to 5.3. I had been wanting to update PHP for a while because the version that came with Plesk was too old for most of the applications I wanted to upgrade to. I was holding back because I couldn’t find enough information on what effect a newer version of PHP would have on the Plesk system software and interfaces; needless the say the Plesk website and forums were useless as usual. I don’t have a development machine to play with so I wanted to be sure before attempting anything. Anyway the surprise upgrade seemed to have worked, but when I tried to install the Plesk 10.3 maintenance upgrade things went a bit pear shaped.
Plesk updates are usually pretty reliable. I say pretty reliable; there are always problems but nothing I can’t
fix, or
fix, or
fix, or
fix, or
fix, or
fix, or
fix.
This time was a little different though. The maintenance release failed half way through with the message:
===> Installing /usr/sbin/suexec replacement
Trying to backup original /usr/sbin/suexec… done
`/usr/local/psa/suexec/psa-suexec’ -> `/usr/sbin/suexec’
Trying to set up APS controller database… Attempting to check APS db connection via ODBC, using /usr/bin/isql (empty output is good)
[ISQL]ERROR: Could not SQLConnect
Failed, rc = 1.
Failed to establish test connection. Cleaning up.
ERROR while trying to establish test connection to APS database via ODBC
Check the error reason(see log file: /tmp/plesk_10.3.0_installation.log), fix and try again
***** problem report *****
ERROR while trying to establish test connection to APS database via ODBC
Check the error reason(see log file: /tmp/plesk_10.3.0_installation.log), fix and try again
Execute command rm -f /tmp/pp-bootstrapper-mode.flag
Execute command rm -f /var/lock/parallels-panel-maintenance-mode.flag
Execute command touch /var/lock/parallels-panel-upgrade-failure.flag
Execute command /usr/sbin/getenforce
Disabled
Error: An error occurred during performing of installation POST actions (see log for details).
Warning! Not all packages were installed.
Please check if your system services are operable.
Please resolve this issue and try installing the packages again.
If you cannot resolve the issue on your own, contact product technical support for assistance.
All my virtual domains were gone! Check the psa database and the configuration was still in-tacked - phew!!! Going to each web address just displayed the default Apache starting page. Checked the logs and they were full of 404 errors. Did an
strace to watch which configuration files where being read and none of them were. Rebuilding Plesk’s virtual domain’s specific conf files would have been a nightmare. Plesk used to just
Include the conf file from each virtual domain’s conf folder but now it’s all about the generation of the file i.e. all the files have names like
13099743180.74277400_httpd.include
, so it’s a lot more complicated!
I needed a way of rebuilding all of Plesk’s Apache configuration to include the
httpd.conf
files specific to each domain. Did a bit of trawling and came up with this which did the trick.
/usr/local/psa/admin/sbin/httpdmng −−reconfigure−all
Thank you Server God!
Logged into the the Plesk administration via the web interface and it shows the version is still 10.2 (instead of 10.3). I feel like I’ve had a narrow escape so I’m not going to do any more upgrades until the next major release - where I’ll have to update the server :( but at least it will be clean.
Thanks to PleskGUY for the knowledge base article on Parallels web site. The article says that in order for the patch to work you must be able to access the database via the localhost IP address:
mysql -h 127.0.0.1 -P 3306 -uadmin -p`cat /etc/psa/.psa.shadow`
I checked my
my.cnf
and I had set
bind-address=<my-external-ipaddress>
in order to do a server update. I can understand why it wasn’t picking up
127.0.0.1
but strangely when I substituted the
-h
address for
localhost
it worked. Pinging
localhost
showed it resolved to
127.0.0.1
. I think this is one of those pain in the ass permission peculiarities from MySQL’s grant/revote access control system.
I removed the
bind-address
from
/etc/my.cnf
and restarted mysqld with:
/etc/init.d/mysqld restart
Rerun the patch update and it… (doing out-of-hours)
Problem 2: I found that the FTP password to one of the sites had been cancelled. I logged back into the Plesk interface and changed it back to what it was and it seemed to take it without complaining.
Problem 3: (5 August 2011) It looks like the AWStats is screwed again. I was checking my stats and found there is a big gap in the monthly reports and they are out of order again: 2010-01, 2010-02, 2010-03, 2010-04, 2010-05, 2010-06, 2010-07, 2010-08, 2011-08, 2011-07, 2011-05, 2011-06. Honestly Plesk are bloody useless.
In previous versions you used to be able to tweak the number of months you kept on a per domain bases, but now it looks like there is one value per server. I logged into the control panel clicked through to
Settings -< Settings of Server Statistics. Then changed the
Retain web and traffic statistics for to 12 (months). I could only find that this was held in the
misc table of the
psa database in the record with the key
stat_ttl. I couldn’t find where this links to awstats. I’ve probably have dig out my old awstat-stats-fixer program.
**UPDATE**
Problem 4: (16 August 2011): I wanted to edit a user’s email options through the domain’s control panel. Plesk directed me to the page https://example.com/smb/user/overview/id/<num> which threw the following error:
Internal error: Specified column “imNumber” is not in the row
Message Specified column “imNumber” is not in the row
File Abstract.php
Line 182
Type Zend_Db_Table_Row_Exception
The
Abstract.php
refers to
/usr/local/psa/admin/plib/Zend/Db/Table/Row/Abstract.php
which I got from the Plesk error log located at
/var/log/sw-cp-server/error_log
.
To correct this problem log in to the
psa
database and run the following SQL:
ALTER TABLE smb_users ADD imNumber VARCHAR(255);
ALTER TABLE smb_users ADD imType INT(11);
ALTER TABLE smb_users ADD isLegacyUser INT(11);
ALTER TABLE smb_users ADD additionalInfo TEXT;
There’s no need to restart anything it should just start working.
http://kb.parallels.com/111611
Follow that KB article, worked for me.