tips and tricks for web developers & designers, and system & network admins

not-sexy.com

how to rebuild software RAID1 on linux

March 14, 2007 | work, linux, raid | 9:35 am | Comments [0] |

Ok, so you have done the right thing and set up your linux server (or desktop) with software RAID1 on all partitions, but when a hard drive dies, how do you actually recover the system with minimal downtime? Elementary my dear Watson, read on and learn! (more…)


email from my server is failing sender verify tests

March 8, 2007 | work, linux, security, exim | 2:39 pm | Comments [0] |

The other day a customer contacted us to say that he was trying to send email from several accounts on one of our servers to an account on another server and it was bouncing back with the following error:

foo@remoteserver.com
Delay reason: SMTP error from remote mail server after RCPT TO::
host remoteserver.com [xxx.xxx.xxx.xxx]: 451 Could not complete sender verify callout

Now I know that our server is fully RFC complient, and the remote server should have no problems performing a sender-verify lookup on any of the ending email addresses. After a bit of poking around and fiddling with exim, I discovered that one of the spam blacklists we used had been taken offline (ordb.org) and when the remote server tried to do a sender verify lookup against our server, the sender-verify connection was timing out before our server finished checking if the remote server was in any blocklists due to the lookup to ordb.org timing out.

A handy little tip for anyone having unexplained sender-verify problems from an otherwise fine exim setup.


how to use parked domains as addon domains

For those not familiar with the terminology:

- http://en.wikipedia.org/wiki/Domain_parking

Many web hosts limit the number of additional domains you can have on an account, however they usually allow you to park any domain you want, regardless of the addon domains limit. Simply place this code in your .htaccess file, and you will be able to use any parked domain exactly like an addon domain.

RewriteCond %{HTTP_HOST} ^www\.vhost\.com$
RewriteRule ^/$ /vhost/$1 [L]

Happy Webmastering :)


blocking evil bots from your website

It occurred to me recently that search engines are not the only web-bots crawling the intrawebs these days. A fair chunk of web traffic is spam bots trolling your website, looking for email addresses to send coupons for cheap viagra and scantily clad ladies of negotiable virtue. Obviously we want to stop these bots from gaining access to our sites, for 2 reasons:

  1. They are wasting bandwidth that could be better used for legitimate visitors.
  2. So our email addresses end up on less spam lists.

But that is not the end of our worries. There are many “Offline Downloader” type programs, usually used to steal images and content from legitimate websites. Most of these bots do not respect the robots.txt as they should, so I class them as malformed or illegal automated scripts. They chew through our bandwidth and steal our content for their own nefarious uses.

My solution is to block these evil bots by using mod_rewrite in my local .htaccess file. The bots can usually be identified by a their HTTP_USER_AGENT, although they usually have the ability to change the User Agent to a user-specified one to avoid scripts such as these, so a vigilant admin would have to keep a close eye on his log files for suspect bots and continually update his rules.

(more…)