Posts Tagged ‘Linux’

rsync backups

rsync can be used as an effective backup tool: rsync -avz –delete -e “ssh -i rsync/mirrorkey” backup@ /backup/ If there’s a lot of data and speed takes importance over security, a weaker cipher such as blowfish could be used: “ssh -c blowfish -ax -i rsync/mirrorkey” Be careful with the –delete flag, it will delete files […]

RPM Examples

Install RPM: rpm -ivh package.rpm Upgrade RPM: rpm -Uvh package.rpm Import an RPM GPG key: rpm –import /media/cdrom/RPM-GPG-KEY Getting detailed information about the package wget: rpm -qi wget Showing all the files installed by the package wget: rpm -ql wget

Enable Disk Quotas on plesk for Linux

First of all make sure that quota is supported by kernel. It should be compiled into the kernel or loaded as module. You can check if quota is configured properly with this command line: /usr/local/psa/admin/sbin/usermng –isquotable Normally, it should return “0”. If the utility returns the following error message: usermng: Unable to turn on user […]

Managing the Qmail queue

/var/qmail/bin/qmail-qstat or for more detailed info: /var/qmail/bin/qmail-qread qmail configuration: /var/qmail/control list count of email addresses in queue grep -h “^From:” /var/qmail/queue/mess/*/* | sort | uniq -d -c for big big queues: (will take a while) find /var/qmail/queue/mess/21/  -type f -print0 | xargs -0 -P1 -n64 grep -h “^From:” |sort | uniq -d -c search through […]

Plesk Admin Password

Linux: cat /etc/psa/.psa.shadow Windows: Open a command prompt and type: “C:\Program Files\Parallels\Plesk\admin\bin\plesksrvclient.exe” -get

Plesk unlock admin account

mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -Dpsa -e “delete from lockout where login=’admin’”

Plesk 9 Backup Utility Broken

After an upgrade to Plesk 9 you cannot schedule backups and get the following error: Unable to update scheduled backup information: MySQL query failed: Unknown column ‘backup_time’ in ‘field list’ Just run the following and it will reinstall them and correct the database: yum erase psa-backup-manager psa-migration-manager yum install psa-backup-manager psa-migration-manager service psa restart

Plesk 9 Greylisting

Plesk 9 introduced greylisting  – yay! or not. To disable it: /usr/local/psa/bin/grey_listing –update-server -status off

PHP sends mail as anonymous@servername

The from address is not enforced.  This can cause some PHP formmail script emails to be treated as spam.  Fix: 1) add a -f(sender address) parameter: mail($to, $subject, $message, $headers, ‘’); 2) add a Return-Path header: mail($to, $subject, $message, ‘Return-Path:\r\nFrom:’); Qmail is *meant* to check for the from address field in Sender, From, […]

openssl unable to write random state

openssl genrsa -out test.pem 1024 -rand $HOME/httpdocs/cert/.rnd Generating RSA private key, 1024 bit long modulus …………………….++++++ …………………..++++++ unable to write ‘random state’ e is 65537 (0x10001) Causing non-random keys to be generated This is because openssl tries to create a .rnd file in the users home directory by default to create the random file.  The […]