so I have two apache servers on the same system.

Basically what I'm trying to figure out is if since I have 2 different IPs running on my system is it possible to have two different apache servers running on different IPs but using the default port(80) so the user doesn't have to specify the port in the address bar?

What I am trying to do is make it so that if the users visits:

example.com ----> Apache Server 1 running on

mail.example.com ----> Apache Server 2 running on

This would make it so that each domain would point to different apache servers but on the same system.

Thank you, JJ Edgar

  • You could do this, but I can't think of any reason why you'd want to have two separate copies of Apache running. – Michael Hampton May 15 '13 at 21:37
  • @MichaelHampton I want to do this because I have two different instances of apache in two different chroot's. One will contain our main websites being example.com and the other containing our mail server and cloud storage system. – JJ Edgar VI May 15 '13 at 21:41
  • Yes, this will work just fine. Just configure the Apaches to listen as you want them to. – David Schwartz May 15 '13 at 21:42
  • Oh OK, that makes more sense. Though I'd probably have them in separate virtual machines for better separation. – Michael Hampton May 15 '13 at 21:45
  • @MichaelHampton Well I'm stuck with this for now. :/ Any ideas how I could get this to work? – JJ Edgar VI May 15 '13 at 21:51

You can control which IP address Apache listens on using the Listen directive.

Just make sure that each server's configuration specifies only the IP addresses you want to use for that particular server.

For instance:

Server 1:


Server 2:


Any <VirtualHost> directives you use must also specify their IP addresses, rather than using the wildcard *.

See the Apache documentation for further details.

  • This worked! Thanks a lot! The default is set to just '80' so for future reference to anyone just make sure you set it to DO NOT FORGET THE PORT or you will get a start error! Thanks a lot Michael! – JJ Edgar VI May 15 '13 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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