system administration

Quick Plesk command line hints

Enable spamassassin on all accounts on server mysql –uadmin –p`cat /etc/psa/.psa.shadow` psa –Ns –e “SELECT CONCAT_WS(‘@’,mail.mail_name,domains.name)FROM domains,mail,accounts WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id” | xargs –I {} ./spamassassin –u {} –status true –hits 7 –action move Setup a new customer via command line /usr/local/psa/bin/./customer —create username –name ‘name’ –passwd ‘password’ –country US –phone 123456 –email hosting@domain.com Setup Continue reading Quick Plesk command line hints

Minimizing downtime associated with Web/DNS/Mail IP address migrations

Migrating servers to new datacenters or IP addresses is never entirely problem free, usually due to many DNS servers on the internet not obeying TTL’s or caching old records for way too long. These old cached DNS records (usually at different ISP’s, major mailservers like google, hotmail, yahoo, etc.) cause problems where they’ll route mail Continue reading Minimizing downtime associated with Web/DNS/Mail IP address migrations

Moving wordpress from a subdirectory – and generation of 301 redirects from a google sitemap

So I mistakenly have installed wordpress in a subdirectory on my site – this worked well for testing, but I didn’t buy this domain to have my entire site sitting within a subdirectory! WordPress has a good guide on this subject, which has step by step instructions on migrating your installation from one directory to Continue reading Moving wordpress from a subdirectory – and generation of 301 redirects from a google sitemap

Sendmail premissions error stopping mail from sending on CentOS 5.1

Really stupid issue with permissions on CentOS 5.1 and real easy fix, since there were improper permissions on the mqueue and clientmqueue directories. The Error message: Tried to send mail via command line using ‘mail’ command, and it returned this error: can not chdir(/var/spool/clientmqueue/): Permission denied Program mode requires special privileges, e.g., root or TrustedUser. Continue reading Sendmail premissions error stopping mail from sending on CentOS 5.1

FreeBSD Plesk 8 – installing php5 as CGI alongside php4

If you have ever needed php5 to run along side php4, you can always compile php5 as a CGI, and let php4 remain as an apache module. Here we’ve compiled php5 from FreeBSD’s ports, and have installed it as a CGI so that specific vhosts will run on this new php5. The installation was done Continue reading FreeBSD Plesk 8 – installing php5 as CGI alongside php4

Updating Spamassassin on FreeBSD and Plesk

Updating Spamassassin on Plesk and FreeBSD is quite simple without breaking things since the Spamassassin on Plesk is pretty standard. System: FreeBSD 6.x Plesk Version: 8.0.x May work with other versions. The stock plesk Spamassassin is a 3.1.x variant, which gets pretty old pretty quick. You can upgrade this via the ports by passing a Continue reading Updating Spamassassin on FreeBSD and Plesk

Dealing with Apache referrer spam

I’ve had a number of sites get hammered by referrer spam lately, and had to look into methods of stopping, or at least slowing the attacks. Referrer spam is when a group of random (probably trojan or hacked computers) or single computers hit random pages on your site with faked referrer values, typically all pointing Continue reading Dealing with Apache referrer spam