IIS – The network location cannot be reached

I had a strange error in IIS6 today when adding a secondary IP.  The site wouldn’t start and gave the error “The network location cannot be reached”.  The IP was correct, pingable and the IIS host headers were all fine.

I had to install the Windows 2003 support tools to fix this.  They can be found on the install CD under \support\tools\suptools.msi

httpcfg query iplisten

Verifies which IP addresses IIS is listening on.  Mine wasn’t there so I added it by:

httpcfg set iplisten -i [ip address]

A full server reboot was also necessary, a service restart was not adequate, then IIS was happy.

Spamassassin 2010 bug

A bit of an oversight – old versions of Spamassassin have an inbuilt rule to block emails with a future date.  Not a bad idea really, but the rule starts blocking things from 2010!  The rule should be fixed in newer versions, however Plesk for example uses a fairly old version. You can edit the rule in /usr/share/spamassassin/72_active.cf

##{ FH_DATE_PAST_20XX
header   FH_DATE_PAST_20XX      Date =~ /20[1-9][0-9]/ [if-unset: 2006]
describe FH_DATE_PAST_20XX      The date is grossly in the future.
##} FH_DATE_PAST_20XX

Probably a good idea to set it to something like Date =~ /20[2-9][0-9] .  By 2020 I imagine this server won’t be alive!

qmail adds number to recipient header

qmail sometimes adds a number to the recipient header when delivering mail locally, so for example, user@domain.com may become 3-user@domain.com.  This isn’t such a problem when mail is just being used locally, but if your using a POP connector to download mail to an Exchange server for example it will cause issues with it getting to the right mailbox.

This is actually by design and is there to prevent mail loops when using catch all addresses.  The only real workarounds are to stop using catch-all and use a mailbox for each address.  It’s actually only the “Delivered-To” header that gets modified/added, not the “To” header, so it might be possible to get Exchange or you POP collector to look specifically at the right header.

Plesk 9 – Horde webmail configuration disappears

Strangely all of the webmail conf files for horde disappeared in my Plesk 9 setup. This regenerated them:

for domain in `mysql -uadmin -p$(cat /etc/psa/.psa.shadow ) -Dpsa -e'select name from domains d, dom_param dp where d.id=dp.dom_id and dp.param="webmail" and dp.val="horde";'`; do /usr/local/psa/admin/bin/webmailmng --set-default --vhost-name=$domain --name=horde ; done

Update: seems to be a result of hotfix (or hot-break everything): psa-hotfix3-9.2.3 92091210

Plesk 9 – Migration Manager set source directory

For some bizarre reason The Plesk 9 migration manager has taken away the functionality to specify the partition used on the source server.  Not very handy if you have partitions running low on disk space.  I’ve found two solutions that seem to work:

  1. On the target server edit /usr/local/psa/admin/share/migration-handler/migration_handler.py
  2. Modify the following line and update to use a more suitable directory:

    migration_session.setValue('agent_dir',"/migration/%s/" % migration_session.getSessionId()

  3. On the source server, symlink /migration to something more suitable
  4. i.e

    rmdir /migration

    ln -s  /var/psa/migration /migration

List Perl modules installed

Handy command to list all Perl modules installed.

perl -MFile::Find=find -MFile::Spec::Functions -lwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'

Adding date/time to BASH history

Useful if you have several admins on a server, so you can figure out who did what when.

Edit /etc/bashrc  and add:
export HISTTIMEFORMAT=”%h/%d – %H:%M:%S “

crontab format

1 2 3 4 5 /path/to/command arg1 arg2

Where:
* 1: Minute (0-59)
* 2: Hours (0-23)
* 3: Day (0-31)
* 4: Month (0-12 [12 == December])
* 5: Day of the week(0-7 [7 or 0 == sunday])
* /path/to/command – Script or command name to schedule

crontab -e = edit
crontab -l = list

Remember, * (every), lists (0,20,40), ranges (5-15) and step (*/3) values are permitted. */2 = every two, etc.

chown a symlink

Not sure why I always forget this, but to chown or chmod a symbolic link rather than its target use the -h (no-dereference) flag:

chown -h new_user symbolic_link_name

Fedora disable beeps!

Out of the box, Fedora seems to send every system event to the PC speaker, which is annoying!  To disable:

/sbin/rmmod -v pcspkr

To make this a persistent change edit
/etc/modprobe.d/blacklist.conf
adding: blacklist pcspkr

or edit:
/etc/rc.local (loads on boot)
adding: /sbin/rmmod -v pcspkr