Jun 10th, 2009
Run Apache and lighttpd on same port 80
Run Apache and lighttpd on same port 80
In a short description, lighttpd is a *ligthy* webserver which helps to increase the site load speed with a small memory consumption.
Now, I assume that you have already installed both apache and lighttpd in the server.
The main thing should be noted here is we need to have 2 IP’s in the server so that we can run both apache and lighttpd in the same port but on specific and dedicated IP addresses.
Go to apache configuration (CentOS/Fedora/RHEL: /etc/httpd/conf/httpd.conf) and locate the “Listen” directive.
Once you are there, you will probably see “Listen :80″ which tells apache to listen on ALL the interfaces. You will need to change this to make apache listen on just one of your IP addresses ie:
Pick one for apache and do the same for the lighttpd configuration(CentOS/Fedora/RHEL: /etc/lighttpd/lighttpd.conf) but in this case use the other free IP address.
Now, restart apache and then lighttpd. You can try to access IP in browser and make sure both are listening on port 80.