I need to run Apache and Maven on my server, and because of cross-domain security restrictions they must both be running on port 80. Originally I achieved this using HAProxy, but this got in the way of the other websites I host on my VPS. I do have four IPs, however, and it would be very nice to have Apache running port 80 on one IP and Maven running port 80 on another. Then I could easily route a few subdomains to Maven using a CNAME record. Is this possible to do?
migrated from stackoverflow.com Jul 10 '11 at 21:58
This question came from our site for professional and enthusiast programmers.
Absolutely, you can bind two services to the same port on different IPs.
Just set up Apache and Maven to bind to a specific IP address.
Yes you can. Just bind Apache to one IP, and Maven to another IP
All you would need to do is set up, for example: