I'm looking at the documentation for a Tomcat 6 webapp called DSpace, specifically in regardds to running Running DSpace on Standard Ports (80 for http:// and 443 for https://)
I am trying to use "Method 1" which uses iptables to redirect traffic from ports 80 and 443 to 8080 and 8443 in order to get rid of the :8080
in the url.
These are the command that the documentation gives:
/sbin/iptables -t nat -I PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-ports 8080
/sbin/iptables -t nat -A OUTPUT -p tcp -d _[server_ip_address|server_ip_address]_ --dport 80 -j REDIRECT --to-port 8080
/sbin/iptables -t nat -I PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-ports 8443
I think there is something that needs to be changed about the second line, specifically with the section -d _[server_ip_address|server_ip_address]_
- but I'm not sure what. I've read the man
page for iptables
but am not having any luck.
I tried changing -d _[server_ip_address|server_ip_address]_
to:
-d _[127.0.0.1|127.0.0.1]_
and also:
-d _[54.224.121.116|54.224.121.116]_
and also:
-d _[ec2-54-224-112-116.compute-1.amazonaws.com|ec2-54-224-112-116.compute-1.amazonaws.com]_
The errors I'm getting include Bad argument 'REDIRECT'
and also
host/network '_127.0.0.1' not found
Can anyone help me spot what I'm doing wrong?
update: I think the redirect will work without the second line, but I'm still not sure what its intended purpose is...