Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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?

share|improve this question
up vote 1 down vote accepted

Easily use one IP with port 80 for Apache: Make sure your configuration has Listen your.first.ip.addr:80 (ex Listen 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:, more on Apache:

share|improve this answer
Of course both IP addresses won't be able to answer for the same qualified hostname, you'll have to have 2 separate hostnames, each attributed to one IP. ie: and – Alexandre Nizoux Mar 8 '10 at 10:32

You could use Apache for PHP and forwarding request to Tomcat with mod_proxy_ajp. Tomcat should then be listening for AJP on any other port than 80 (8009 should be the default).

share|improve this answer

You need something on port 80 that can forward requests to Tomcat (and maybe even to whatever you use to serve PHP). For example Apache can work as a reverse proxy. And nginx. And varnish was made for the exact purpose.

share|improve this answer

You could also just bind Tomcat to port 80 on one IP, and your PHP web server (apache?) to port 80 on the other IP.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.