Exim binds with port 80/443 how-to fix

martijnS

Verified User
Joined
Jun 21, 2007
Messages
16
Location
Holland
Hi,

I had a problem with exim that binds with port 80, later i heard this is a php CLI bug. But i have made a fix for it and wanted too share this with you.

Exim will bind on port 80/443 sometimes which means that when DA gives a restart to apache it can not bind on port 80 result apache is down and angry customers.

Message when starting apache:
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs


Note: we have a Linux DA server with mod_ruid and some things may be different with your own servers.

Note2: when you update exim you will have to make the symlink again

Howto: Replace sendmail with SSMTP

Download the ssmtp package in this case tar.gz but a rpm should work for your distro.

Etch: http://packages.debian.org/stable/mail/ssmtp?lang=nl
Sarge: http://packages.debian.org/sarge/mail/ssmtp?lang=nl
Dapper: https://launchpad.net/ubuntu/dapper/+source/ssmtp/2.61-5
Feisty: https://launchpad.net/ubuntu/feisty/+source/ssmtp/2.61-11
Gutsy: https://launchpad.net/ubuntu/gutsy/+source/ssmtp

extract and do the following

./configure
make && make install

Output of ssmtp locations

program: /usr/local/sbin/ssmtp
config: /usr/local/etc/ssmtp/ssmtp.conf

We delete the symlink

rm /usr/sbin/sendmail

ln -s /usr/local/sbin/ssmtp /usr/sbin/sendmail

And edit the config

#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and you mailhub is so named.
mailhub=localhost:25
# Where will the mail seem to come from?
#rewriteDomain=
fromlineoverride=yes

- localhost:25 is because exim listens to port 25
- fromlineoverride is so it doesn't rewrite the domain to apache@hostname but too 1 given in the contactform.

You can trow the source map away.

I hope this fix will come in hand with some people.
 
Back
Top