Some of the selected subscriptions were not suspended. MySQL query failed: Unknown column ‘fp’ in ‘field list’

Some of the selected subscriptions were not suspended.
MySQL query failed: Unknown column ‘fp’ in ‘field list’

Create backup of psa database:
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > psa.sql

Login to database:
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow ` psa > psa`date +%F_%H.%M`.sql

Add required fields to table, e.g.:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa

ALTER TABLE ADD fp enum('false','true') NOT NULL default 'false';
ALTER TABLE ADD fp_ssl enum('false','true') NOT NULL default 'false';
ALTER TABLE ADD fp_enable enum('false','true') NOT NULL default 'false';
ALTER TABLE ADD fp_adm varchar(20) NOT NULL;
ALTER TABLE ADD fp_pass varchar(20) NOT NULL;

/var/lib/php/session cleanup failing

We found one of our servers had exceeded the inode limit of 400,000. Upon investigation, there were about 250,000 files in /var/lib/php/session

The script plesk-php-cleanuper contains a string ! -execdir fuser {} \, which opens every file in the /var/lib/php/session directory and checks that it is not used by a working process and can be deleted. However, the maximum number of open files is set to 1024 by default.

Clear /var/lib/php/session using this script without the checker:
~# [ -x /usr/lib64/plesk-9.0/maxlifetime ] && [ -d /var/lib/php/session ] && find /var/lib/php/session -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib64/plesk-9.0/maxlifetime) -delete
Increase the limit for open files to the required value.
To get the maximum number of open files, run:
~# ulimit -a
open files (-n) 1024
Add ulimit -n 30480 to /etc/cron.hourly/plesk-php-cleanuper:
~#vi /etc/cron.hourly/plesk-php-cleanuper
~ulimit -n 30480

Re-run the required Cron Job and check that it completes successfully .


Here is a good script for backing up all mysql database on a Plesk server. Add a cron entry so that it runs everyday. Change the ‘-mtime +7’ value to determine how many days of backups you will keep.

vi /usr/local/sbin/sqldumpscript
chmod 755 /usr/local/sbin/sqldumpscript

#! /bin/bash

TIMESTAMP=$(date +"%F")
find /var/www/vhosts/mysqldumps/ -maxdepth 1 -type d -mtime +7 -exec rm -rf {} \;

mkdir -p "$BACKUP_DIR"

databases=`$MYSQL -uadmin -p\`cat /etc/psa/.psa.shadow\` -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema)"`

for db in $databases; do
$MYSQLDUMP --force --opt --skip-events --skip-lock-tables -uadmin -p`cat /etc/psa/.psa.shadow` --databases $db | gzip > "$BACKUP_DIR/$db.gz"

create crontab entry
39 3 * * * /usr/local/sbin/sqldumpscript

HTML emails disabled in Horde

By default inline HTML is disabled in Horde.


To enable inline HTML, set option “inline” to “true” in the following files:


/* HTML driver settings */
‘html’ => array(
/* NOTE: Inline HTML display is turned OFF by default. */
‘inline’ => true,

sitemap.html (xml) problems with Youst SEO plugin

Dr. Adams at had a problem getting rid of google sitemap errors. After resolving the problem he sent us this update:

If you use Youst as an SEO plug-in for WordPress, do NOT use Youst for creating a sitemap. If you fail to uncheck a box, it creates a sitemap.HTML, and Google becomes obsessed with it. Instead use the Google plug-in for Sitemap.

OK, so you now have Google believing you have sitemap.html…even though such a file does not exist.

So you see a list of errors in Google Webmaster Tools, and you will never get rid of it. Never, ever…for eternity. Trust me.

It occurred to me that every stiemap.xml (sitemap-authors.xml) that is now misidentified as .html.

So you take each of those misperceived *.xml files and test them in Webmaster Tools. They will return NO errors. You then submit them one at a time. Each has many sitemap files nested beneath.

So each one you test/verify has many files beneath it.

Then you submit each (which includes nested files) again. This time they will pass.

I had 66 sitemap errors, all listed as html even though they are not.

Once you verify and then submit again, they go away.

Train Spamassassin for all mail names on the server simultaneously

Store SPAM and HAM messages in two different folders, for example ‘train_spam’ and ‘train_ham’.

Train Spamassassin for one mailbox using the messages from that folders:

cd /var/qmail/mailnames/DOMAIN/spam/Maildir/

sa-learn –spam .train_spam/*
Output will look similar to this:
Learned tokens from 727 message(s) (13758 message(s) examined)

sa-learn –ham .train_ham/*
Output will look similar to this:
Learned tokens from 573 message(s) (11408 message(s) examined)

Copy the spam assassin files into every email account on the server. Keep in mind that if anyone was doing their own spam/ham sorting this will override it (whitelist/blacklist will be left alone).

find /var/qmail/mailnames/ -mindepth 2 -maxdepth 2 -type d -exec /bin/cp -f /var/qmail/mailnames/DOMAIN/spam/.spamassassin/bayes_* {}/.spamassassin/ \;

netstat one liners

Active over port 80

netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1


Sorted by type

netstat -plant | awk '{print $6}' | sort | uniq -c | sort -n

How to block IP address in Linux via ssh:

The following command will drop any packet coming from the IP address

iptables -I INPUT -s -j DROP


iptables -A INPUT -s -j DROP

(-I inserts into config, -A appends)

Use the following syntax to block on eth1 public interface:
iptables -i eth1 -A INPUT -s -j DROP

Use the following command to view:
iptables -L -v

Use the following command to save:
service iptables save

Add virtuozzo to Centos 6

Create partitions as follows:

/ 10GB
/vz remaining space
swap – 2GB + total memory

Login as root, and cd
chmod +x vzinstall-linux-x86_64.bin
yum install vzkernel (needed for mkinitrd install – find a better way?)
cd /etc/yum.reposd/
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
./vzinstall-linux-x86_64.bin (install pva agent at end, reboot, and wait for startup (around 10 minutes)).
yum update

Additional notes: