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?
Asked
Active
Viewed 709 times
2 Answers
1
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

Hubert Kario
- 6,361
- 6
- 36
- 65
-
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
0
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/

jamespo
- 1,698
- 12
- 12