ColdFusion & Plesk & Server Architecture Matt | 19 Oct 2007
ColdFusion 8 and Plesk 8 on RedHat 5 via mod_jrun22
After installing Plesk 8 on a RedHat 4 box I’ve needed to install Plesk 8 on Redhat 5. RedHat 5 uses mod_jrun22. Well it’s Apache 2.2 that uses mod_jrun22, so any version of Linux running Apache 2.2 will use this connector.
Since Plesk doesn’t support CF8 yet, it still writes out its apache directives looking for mod_jrun20. This needs to be modified to get per domain support for CF8 and Apache 2.2
Warning this will void your warranty!
I grepped the plesk install directory looking for mentions of jrun. I found a binary file that matched: /usr/local/psa/admin/sbin/websrvmng
Looking at this file, on line 228 there’s a mention of mod_jrun20 in plain text. This is the part of the websrvmng that writes out the http directives. After making a backup of this file I took a chance at making an edit. I simply changed mod_jrun20 to mod_jrun22 and saved the file.
Sure enough, plesk is happy. Now when checking the ColdFusion box in a domain setup I see <IfModule mod_jrun22.c> in the httpd.include file for that domain rather than <IfModule mod_jrun20.c>.
Be careful here, I’m sure this change would not survive a plesk update to websrvmng. After each plesk update double check this file to make sure it still points to mod_jrun22.
Plesk & Server Architecture Matt | 18 Oct 2007
Backup all mysql databases as seperate sql files
When backing up mysql databases via mysqldump you can either specify a database name to backup or use the –all-databases switch to dump all databases in one big file. I’d like to backup all my databases but I’d like them in separate files so they’re easier to manage and I can do a quick restore of a single db if needed.
I wrote the following bash script to help out.
#!/bin/sh
# all db separate files
for customerdb in `mysql -uadmin -pweb7A8u -e "show databases" -B -N`
do
mysqldump -uadmin -pweb7A8u $customerdb > /var/www/vhosts/mysql/$customerdb.sql
done
Or on my plesk server, I’ve got a table in plesk’s psa database that lists out all the databases created within plesk. A modification to this script reads the table names in the psa database table and makes backups of all those.
#!/bin/sh
for customerdb in `mysql -uadmin -pweb7A8u -e "select name from data_bases" -B -N psa`
do
mysqldump -uadmin -pweb7A8u --protocol=tcp --port=3307 $customerdb > /storage/mysqlbackup/$customerdb.sql
done
OS X / Unix Matt | 18 Oct 2007
Leopard Time
Been under a rock this week? Just woke up from that month long coma? Don’t go back to sleep just yet, OS X Leopard arrives Oct. 26th.
Mac OS X v10.5 Leopard Family Pack $189 only! Order today for delivery on Oct. 26







