The situation is this: You are running a database update script, and you need to add an additional field to a table in a way such that the script will not fail if the column already exists (from a previous update etc.). Most people would simply use a php script to get the layout of the table and then only execute the ALTER TABLE command if the column does not already exist, but sometimes we are bound by scripting restrictions, so here is the SQL code to do it:
(more…)
Over the weekend, one of my backup scripts started erroring out while sending the backups offsite to an FTP server. The error message was:
200 Port command successful
150 Opening data channel for file transfer.
netout: Broken pipe
550 can't access file.
(more…)
I was recently checking through Splunk when I came across these messages in the logs of one of my servers:
Oct 7 20:59:33 web named[13698]: client 111.222.333.444#50389: updating zone ‘domain.com/IN’: update failed: ‘RRset exists (value dependent)’ prerequisite not satisfied (NXRRSET)
Oct 7 20:59:34 web named[13698]: client 111.222.333.444#50392: update ‘domain.com/IN’ denied
Oct 7 21:59:35 web named[13698]: client 111.222.333.444#50422: updating zone ‘domain.com/IN’: update failed: ‘RRset exists (value dependent)’ prerequisite not satisfied (NXRRSET)
Oct 7 21:59:35 web named[13698]: client 111.222.333.444#50425: update ‘domain.com/IN’ denied
Oct 7 22:59:20 web named[13698]: client 111.222.333.444#50458: updating zone ‘domain.com/IN’: update failed: ‘RRset exists (value dependent)’ prerequisite not satisfied (NXRRSET)
(more…)
Sometimes IIS manager takes 10-20 seconds to load, and when it is finally loaded it has no server connected (and therefore no websites). Apparently this is fairly common on Sharepoint 2007 servers, and the fix is to restart the sharepoint timer service, but I do not run sharepoint.
As a side effect of this problem with IIS, my HELM 4 control panel stops responding, possibly because it is in its own application pool. In the past I have had to reboot the server to get everything working again, but I can’t keep doing that with a production server. Restarting the IIS Admin service in Service Manager hangs and eventually fails trying to stop the World Wide Web Publishing service.
(more…)
I just installed PHP 5 on a windows 2003 server running IIS 6 and found that none of my extentions were loading correctly. Upon further inspection of the phpinfo() command, I found the following:
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File (none)
So PHP had decided not to use the php.ini file that was located in the working directory, but rather attempt to use one from C:\Windows, and because it could not find one there it was using the default setup. Initially I put a symlink from c:\windows\php.ini to the real php.ini file, but that did not appear to work either.
(more…)
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…)
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.
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 
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:
- They are wasting bandwidth that could be better used for legitimate visitors.
- 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…)