Linux – How to run both Tomcat and PHP on Linux on port 80

bindlinuxPHPtomcatvirtualhost

I would like to host both Tomcat and PHP on port 80 on Linux and I have 2 IP addresses available.

I am only using PHP so that I can host some mailing list software, I can map it to newsletter.mydomain.com. So my question is, is it possible to run Tomcat on port 80 on 1 IP address and Apache on port 80 on another IP address?

Best Answer

Easily use one IP with port 80 for Apache: Make sure your configuration has Listen your.first.ip.addr:80 (ex Listen 92.12.0.2:80) and not just Listen 80 (since that would listen to ALL the IP addresses of the box on port 80).

For Tomcat, make sure to configure your connector with the parameters port="80" address="your.second.ip.addr".

You'll easily be able to run both apps on the same box using each IP on port 80.

Good luck.

(More on Tomcat: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html, more on Apache: http://httpd.apache.org/docs/2.0/bind.html)

Related Topic