Add SPF records to all domains in Plesk

If you find yourself in the situation where you need to bulk add SPF records to every domain in Plesk, you can use this huge one-liner:

mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "select dns_zone_id,displayHost from dns_recs GROUP BY dns_zone_id ORDER BY dns_zone_id ASC;" | awk '{print "INSERT INTO dns_recs (type,host,val,time_stamp,dns_zone_id,displayHost,displayVal) VALUES ('\''TXT'\'','\''"$2"'\'','\''v=spf1 a mx ~all'\'',NOW(),"$1",'\''"$2"'\'','\''v=spf1 a mx ~all'\'');"}' | mysql -u admin -p`cat /etc/psa/.psa.shadow` psa

Then you’ll need to make Plesk write these changes to the zone files:

# mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e 'select name from domains' | awk '{print "/usr/local/psa/admin/sbin/dnsmng update " $1 }' | sh

You can check your work by viewing the new entries you made:

mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "SELECT * FROM dns_recs WHERE type='TXT';"

Credit : http://rackerhacker.com/2007/04/24/add-spf-records-to-all-domains-in-plesk/

How to compile php 4.4.9 for Plesk Server

How to compile php on a plesk machine and actually get it to work so I took the time to document everything. This guide *should* work, I know it worked on 2 seperate machines. Aside from that do it at your own risk I am not so fond of plesk because it does have so many issues with upgrade. If you have any trouble or dep issues please post thme here so I can work the fixes into the guide.

yum install zlib-devel webalizer unixODBC unixODBC-devel tcl tcl-devel sysstat sendmail-devel rwho pspell-devel php-devel php-imap php-ldap php-mysql php-odbc perl-Crypt-SSLeay perl-DBD-Pg perl-DB_File perl-DateManip perl-HTML-Parser perl-HTML-Tagset perl-Parse-Yapp perl-Time-HiRes perl-URI perl-XML-Dumper perl-XML-Encoding perl-XML-Grove perl-XML-Parser perl-XML-Twig perl-libwww-perl perl-libxml-enno perl-libxml-perl perl-suidperl pciutils-devel patchutils openssl-perl openssl-devel net-snmp net-snmp-devel net-snmp-libs net-snmp-perl net-snmp-utilsmysql-devel mrtg mod_perl mod_perl-devel mod_ssl mailman libxslt libxslt-devel libxml libxml-devel libtool libstdc++-devel libpng-devel libpng10 libpng10-devel libjpeg-devel libdbi-dbd-mysql joe htdig htdig-web gd gd-devel compat-libstdc++ compat-libstdc++-devel compat-db compat-gcc compat-gcc-c++ compat-glibc bzip2-devel bind bind-chroot bind-devel ImageMagick ImageMagick-devel ImageMagick-perl MyODBC mysql-bench libmhash libmhash-devel libmcrypt libmcrypt-devel sablotron sablotron-devel js- js-devel

cd /root
wget http://us2.php.net/distributions/php-4.4.9.tar.gz
tar -zvxf php-4.4.9.tar.gz
cd php-4.4.9

./configure –prefix=/usr/local/php4 –bindir=/usr/bin –sbindir=/usr/sbin –sysconfdir=/etc –datadir=/usr/share –includedir=/usr/include –libdir=/usr/lib –libexecdir=/usr/libexec –with-libdir=lib –with-curl=/usr/bin –with-config-file-path=/usr/local/php4/lib –with-pic –disable-rpath –with-exec-dir=/usr/bin –with-png-dir=/usr –enable-gd-native-ttf –without-gdbm –with-gettext –with-iconv –with-jpeg-dir=/usr –with-png –with-zlib –enable-exif –enable-ftp –enable-magic-quotes –enable-sockets –enable-track-vars –enable-trans-sid –enable-yp –enable-wddx –with-pear=/usr/share/pear –enable-calendar –with-libxml-dir=/usr –with-xml –enable-force-cgi-redirect –enable-pcntl –enable-mbstring –enable-mbregex –with-ncurses –with-gd –enable-bcmath –with-xmlrpc –with-mysql –with-mysqli –enable-dom –with-xsl –enable-fastcgi –with-openssl –program-suffix=4 –with-expat-dir=/usr –with-mhash –with-mcrypt

make
make install