Archive for March, 2008

GreyListd for DirectAdmin

Sunday, March 2nd, 2008

== Get greylistd ==
cd /tmp
wget http://ubuntu2.cica.es/ubuntu/ubuntu/pool/universe/g/greylistd/greylistd_0.8.6.tar.gz
tar -zxvf greylistd_0.8.6.tar.gz
cd greylistd-0.8.6/

== Make the folders ==
mkdir /etc/greylistd/
mkdir /var/run/greylistd/
mkdir /var/lib/greylistd/

Provided you are still in the greylistd-0.8.3.2 folder, copy the files:
cp config/* /etc/greylistd/
cp program/greylist* /usr/sbin/

Edit the config at /etc/greylistd/config

== Change permissions ==
chown -R mail:mail /etc/greylistd/
chown -R mail:mail /var/run/greylistd/
chown -R mail:mail /var/lib/greylistd/
chown -R mail:mail /usr/sbin/greylist*

== Run greylistd in the background ==
su mail
/usr/sbin/greylistd &
exit

or /usr/sbin/greylistd

== Edit the exim.conf ==
Now (as root) open /etc/exim.conf and search for the following section:

# accept mail to errors@example.com, regardless of source
# accept local_parts = errors
# domains = example.com

Add the following below it:
#GREYLIST
defer message = $sender_host_address is greylisted
log_message = greylisted.
hosts = !+relay_hosts
domains = +relay_domains
!senders = : postmaster@*
set acl_m6 = $sender_host_address $sender_address $local_part@$domain
set acl_m6 = ${readsocket{/var/run/greylistd/socket}{$acl_m6}{5s}{}{}}
condition = ${if eq {$acl_m6}{grey}{true}{false}}
# authenticated = *

Restart exim
/usr/local/etc/rc.d/exim restart

Auto updater in DirectAdmin

Sunday, March 2nd, 2008
mkdir /usr/local/updatescript
cd /usr/local/updatescript
wget http://tools.web4host.net/update.script
chmod 755 update.script

spamassassin dependencies

Sunday, March 2nd, 2008

perl -MCPAN -e shell “install LWP::UserAgent”
perl -MCPAN -e shell “install Archive::Tar”
perl -MCPAN -e shell “Mail::SPF”

Reinstall grub for SDA

Sunday, March 2nd, 2008
Grub>device (hd0) /dev/sda
Grub>root (hd0,0)
Grub>setup (hd0)

IIS Listen on non-specified IP ?

Sunday, March 2nd, 2008

We have a Windows Small Business Server at work, which we wanted to install Subversion onto. We therefore wanted to run Apache on the same server. However, IIS is also installed on the same machine for Small Business Server purposes so I couldn’t just remove IIS.

I had added multiple IP addresses to the server so that IIS could have one and Apache could have another (so they could both run on port 80). However, I ran into the problem that IIS was taking control of all IP addresses on port 80 and so Apache wouldn’t start. It seems that IIS 6.0 has a “feature” called Socket Pooling that claims all ports for all loaded IP address (even if not configured in IIS) - nice! So IIS had control of the port 80 on the IP address I had assigned to Apache.

Do not fear - there is a workaround:

  1. Extract the httpcfg.exe utility from the support tools area on the Win2003 CD.
  2. stop all IIS services: net stop http /y
  3. have IIS listen only on the IP address I’d designated for IIS: httpcfg set iplisten -i 192.168.1.253
  4. make sure: httpcfg query iplisten (the ip’s listed are the only ip addresses that IIS will be listening on and no other)
  5. restart IIS Services: net start w3svc
  6. start Apache service

You’ll then find that Apache and IIS will then play nicely together and run on the correct ports on the correct IP addresses. Woo hoo!

How to increase RAID rebuilt speed

Sunday, March 2nd, 2008

echo -n 500000 > /proc/sys/dev/raid/speed_limit_max