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.

This question is a followup to this one. I got Apache running on port 80 on one of my four IPs pretty easily. Now I need to run Maven on port 80 on another IP. Running Maven on port 80 is already difficult enough; I have no idea how to define a specific IP. Any ideas on how to do this? Perhaps ipchains or iptables would be the easiest?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Yes, I'd guess that moving traffic from 80 to 8080 (or similar port) would be easiest:

iptables -t nat -I PREROUTING -d <localip> -p tcp -m tcp --dport 80 -j DNAT --to-destination <localip>:8080

share|improve this answer
    
Would --dport be 80, not 8080? –  Theron Luhn Jul 11 '11 at 14:51
    
@Panthr you're correct, fixed it –  Hubert Kario Jul 11 '11 at 14:54
    
Works like a charm! Thanks! –  Theron Luhn Jul 11 '11 at 15:20

I would set up Apache to act as a reverse proxy for Maven

Inside your virtualhost (presuming maven is bound to localhost port 8080):

ProxyPass        / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
share|improve this answer

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.