Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 1.1.1.1:80

mail.example.com ----> Apache Server 2 running on 2.2.2.2:80

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

Thank you, JJ Edgar

share|improve this question
    
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
show 1 more comment

1 Answer 1

up vote 2 down vote accepted

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:

Listen 203.0.113.5:80

Server 2:

Listen 203.0.113.6:80

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

See the Apache documentation for further details.

share|improve this answer
    
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 1.2.3.4:80 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
add comment

Your Answer

 
discard

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.