Plesk Wiki
All this information was really handy and the original page is dead / only available in google cache.. saving for others/me to use in future here. The site is now back online, with heaps of handy information – check it out hereĀ http://wiki.voidnet.us/
Also if you need help make sure you visit Racker Hacker.com – its a great resource and the person behind the site has far more clues than I.
Plesk
From wiki.voidnet.us
Server Wide Find & Replaces
If you have migrated and have issues or a symlink just wont work you can do some quick and easy server wide text replaces with the following…
find -name ‘vhost.conf’ -print0 | xargs -0 perl -pi -e ‘s/home/var/g’
Plesk Logsweb:
/usr/local/psa/admin/logs
mail/ftp xfer
/usr/local/psa/var/log/
Plesk FTP USER
I have included below the instructions for adding system FTP user account’s. First you will need to add the user, to do so simply issue the following command(s) as root:
useradd -s /bin/false johndoe -d /home/johndoe
The “-s /bin/false” portion ensures this user can only ftp into the system and has no shell access. The “-d /home/johndoe” portion indicates that this users home directory should /home/johndoe. If you also want to restrict “johndoe” to his directory you should use the following command below instead:
useradd -s /bin/false -G psacln johndoe -d /home/johndoe
The “-G psacln” switch automatically add’s the johndoe user to the psacln group, any user account’s that are part of that group automatically get restricted to their home directory.
After adding the user you simply need to setup a password for them using the following command:
passwd johndoe
Qmail
qmail turn off reverse lookups.
-Rt0 flag the to the beginning of the server_args line in the /etc/xinet.d/smtp_psa
Install new Plesk license
download correct license from ftp.rackspace.com
/etc/init.d/psa stop mysql -u admin -p`cat /etc/psa/.psa.shadow` psa mysql> truncate key_history; mysql> truncate key_history_params; mysql> exit
rpm -e --nodeps psa-key-custom
rpm -Uvh plesk7.5_100_spamassassin (or correct license)
/etc/init.d/psa start
Qmail voodoo: (where spamblackhole is the domain or subject)
/var/qmail/bin/qmail-qread | grep -B1 spamblackhole |grep GMT
| awk '{print $6}' | sed s/^#/-d/ > /home/rack/delete
Plesk FrontPage fixup: (from httpdocs dir)disable frontpage in plesk
find . -name .htaccess -type f | xargs rm -rf find . -name '_vti*' -type d | xargs rm -rf find . -name '_private' -type d | xargs rm -rf
enable and reset password in plesk
Change TTLs in Plesk
update the misc table to the value:
update misc set val='86400' where param='SOA_TTL';
update the zone records:
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
Plesk user passwords
select domains.name,domains.id,mail.mail_name,accounts.password from domains,mail,accounts where domains.id=mail.dom_id and accounts.id=mail.account_id and accounts.password='password';
Plesk FTP users
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e "SELECT domains.name, sys_users.login, accounts.password FROM hosting, domains, sys_users, accounts WHERE hosting.dom_id = domains.id AND hosting.sys_user_id = sys_users.id AND sys_users.account_id = accounts.id ORDER BY domains.name;"
Upgrade to PHP5 on Plesk 8.1
rpm -e `rpm -qa | grep -i sitebuilder` rpm -e php-sqlite2 sb-publish rpm -e PPWSE rpm -e --nodeps php-domxml rpm -Uvh *.rpm up2date --configure
Plesk mail mchk
/usr/local/psa/admin/bin/mchk -v /usr/local/psa/admin/bin/mchk -v --with-spam
Kill Qmail queue
#!/bin/sh
# remove everything - STOP QMAIL FIRST!
/sbin/service qmail stop
for i in bounce info intd local mess remote todo;
do find /var/qmail/queue/$i -type f -exec rm {} ;
done
/sbin/service qmail start
Plesk5 websrvmng (sort of)
/usr/local/psa/admin/bin/my_apci_rst -v
Plesk UserDirs in 8+
Just create the file /etc/httpd/conf.d/userdir.conf and add in the following contents:
<VirtualHost the.primar.ip.address:80>
ServerName default
UseCanonicalName Off
DocumentRoot /var/www/vhosts/default/htdocs
UserDir httpdocs
ScriptAlias /cgi-bin/ "/var/www/vhosts/default/cgi-bin/"
<Directory "/var/www/vhosts/">
<IfModule sapi_apache2.c>
php_admin_flag engine on
</IfModule>
Options +Includes +ExecCGI
</Directory>
<Directory "/home/httpd/vhosts/">
<IfModule sapi_apache2.c>
php_admin_flag engine on
</IfModule>
Options +Includes +ExecCGI
</Directory>
</VirtualHost>
More fun with qmail
/var/qmail/bin/qmail-qread | grep "somethin@yourdomain.com" |
awk '{print $6}' | sed 's/^/-d/g' | sed 's/#//g' > /home/rack/rmspam.sh
then just:
qmHandle `cat rmspam.sh`
Plesk SPAM
linkhttp://kb.swsoft.com/article_22_766_en.html
Add spell checking to Horde
You need to ADD the following line to
/usr/share/psa-horde/imp/config/conf.php
$conf['utils']['spellchecker'] = 'aspell';
Lower TTLs in Plesk
insert into misc values ('soa_TTL','300');
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
Get Plesk e-mail addresses and passwords
select CONCAT(mail_name,”@”,name) as email_address,accounts.password from mail left join domains on domains.id=mail.dom_id left join accounts on accounts.id=mail.account_id;
Hello friend, http://wiki.voidnet.us/ is back on-line after a brief hiatus, I would very much appreciate it if you could place a link to it on this page, and thank you for giving props. There are a number of other interesting things I’ve uncovered on the wiki as well, so feel free to look it over. I will be updating it with a number of my recent projects in the near future, so check back frequently if it interests you…
grep whatever /home/httpd/vhosts/*/statistics/logs/whateverlogs | awk ‘{ print $1, $5, $7 }’ | sort | uniq -c | sort -rn
search for strings in multiple log files / plesk
XBMC is by far the best media centre, it is so customisable and powerful.