CentOS 5, port 8080 won’t allow traffic

centosiptables

I'm trying to open up port 8080 on my CentOS 5, Apache 2.2.3 server. When I go to ip:8080/mydirectory – it times out. I have ran these commands thus far:

$ iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
$ service iptables save
$ iptables -A OUTPUT -p tcp --dport 8080 -j ACCEPT
$ service iptables save
$ iptables -A FORWARD -p tcp --dport 8080 -j ACCEPT
$ service iptables save
$ service iptables restart
$ service httpd restart

Below is the output of my iptables

$ iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:8080

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:8080

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:8080

I edited apache to reflect this addition:

<VirtualHost *:8080>
  DocumentRoot "/var/www/html"
  ServerName dedicatedipgoeshere
</VirtualHost>

Thank you for any help!

Best Answer

You need to add Listen 8080 to your apache config. Just put it right above the VirtualHost block.

Example:

Listen 8080
<VirtualHost *:8080>
  DocumentRoot "/var/www/html"
  ServerName dedicatedipgoeshere
</VirtualHost>