Archive for April, 2007

Plesk SQL Statements

When you need to find information about anything in Plesk, here’s some SQL statements that you can use:
Start out with:
# mysql -u admin -p`cat /etc/psa/.psa.shadow`
mysql> use psa;
Find all e-mail passwords:
select concat_ws(’@',mail.mail_name,domains.name),accounts.password from domains,mail,accounts where domains.id=mail.dom_id and accounts.id=mail.account_id order by domains.name ASC,mail.mail_name ASC;
Find e-mail passwords made out of only letters:
select concat_ws(’@',mail.mail_name,domains.name),accounts.password from domains,mail,accounts where domains.id=mail.dom_id and [...]

Adding chrooted FTP users outside of Plesk

To add a chrooted FTP user outside of Plesk properly, you need to:

Create the user with the home directory as the root of what they can access
Give the user a password
Make their primary group psacln
Add them to the psaserv group as well

# useradd username -d /var/www/html/website/slideshow/
# echo “password” | passwd username –stdin
Changing password for user [...]

Install PayFlowPro for PHP on RHEL

To install PayFlowPro, you will need a few things:

The PHP source code for version of PHP installed (go here)
The SDK from Verisign/PayPal (this comes from the portal, login required)
The gcc and automake packages

Take the Verisign SDK and copy the following:

Copy pfpro.h to /usr/include
Copy the .so file to /usr/lib

Untar the PHP source code and cd into [...]

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

Can’t find file: ‘horde_sessionhandler.MYI’

If you get this error, you’ve most likely done a file-based MySQL backup restore, and the InnoDB files are hosed. The horde_sessionhandler table isn’t a MyISAM table at all – it’s actually an InnoDB table. The easiest way to fix the issue is to stop MySQL and trash the .frm:
# /etc/init.d/mysqld stop
# rm [...]