Plesk useful terminal commands

export LANG=”en_US.UTF-8″
export LC_ALL=”en_US.UTF-8″

postmap -s /var/spool/postfix/plesk/virtual

cp -Rp /var/spool/postfix/plesk /var/spool/postfix/plesk.backup
cd /var/spool/postfix/plesk/

for db_file in virtual virtual_domains ; do
ls -1 –color=never /var/qmail/mailnames > /tmp/domains.txt
hostname -f >> /tmp/domains.txt
postmap -s /var/spool/postfix/plesk/$db_file > /tmp/${db_file}_temp
grep -f /tmp/domains.txt /tmp/${db_file}_temp > /tmp/$db_file
postmap /tmp/$db_file
mv /tmp/$db_file.db /var/spool/postfix/plesk/
done

/usr/local/psa/admin/sbin/httpdmng –reconfigure-all
/usr/local/psa/admin/bin/httpdmng –reconfigure-domain cdl.gr
/usr/local/psa/admin/sbin/mchk –with-spam
/usr/local/psa/admin/sbin/mail_auth_view

/usr/local/psa/admin/sbin/mchk

/usr/local/psa/admin/sbin/statistics –calculate-all
/etc/init.d/postfix restart

wget http://autoinstall.plesk.com/plesk-installer
chmod +x plesk-installer
./plesk-installer
tail -f /usr/local/psa/var/log/maillog | grep ‘unknown in virtual mailbox’

Cannot sent message via webmail: “User unknown in virtual alias table”

If Postfix files are corrupted completely, or empty:

  1. Create a backup of the current configuration:
    ~# cp -Rp /var/spool/postfix/plesk /var/spool/postfix/plesk.backup
    
  2. Remove redundant records from the Postfix database:
    ~# cd /var/spool/postfix/plesk/
    
    ~# for db_file in virtual virtual_domains ; do
        ls -1 --color=never /var/qmail/mailnames > /tmp/domains.txt
        hostname -f >> /tmp/domains.txt
        postmap -s /var/spool/postfix/plesk/$db_file > /tmp/${db_file}_temp
        grep -f /tmp/domains.txt /tmp/${db_file}_temp > /tmp/$db_file
        postmap /tmp/$db_file
        mv /tmp/$db_file.db /var/spool/postfix/plesk/
       done
  3. #set locale after mchk
    export LANG=”en_US.UTF-8″
    export LC_ALL=”en_US.UTF-8″
    locale
  4. /usr/local/psa/admin/sbin/mchk –with-spam

more info

http://kb.odin.com/en/119654

Securing Revive openx

No instance of Revive is totally secure but I though it might be useful to share a few of the tips I’ve gathered over the years in regard to securing the ad server. The intention being for others to add their own, with any luck we’ll create a half decent resource for new users.
Tips are offered on a use at your own risk basis. Whilst most are simple, involving basic shell commands and SQL snippets, I stress that if not done properly some could lock you out of your Revive server. That would be a real bummer! Hence only do what you feel comfortable with, if you don’t fully understand what’s involved leave well alone.

Continue reading “Securing Revive openx”