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.

I have a webserver built via virtualbox that I had running fine with Port 80. I am currently trying to change the port # to 8088 so that our IT people can open it to the outside world to allow external connections. I have edited my httpd.conf and changed the listen directive as well as added a virtualhost entry for *:8088. I have also added the port into selinux. However, I am still unable to connect to the site by going http://IP:8088, it times out saying it could not connect. I have checked netstat and it appears that apache is listening to it:

tcp 0 0 :::8088 :::* LISTEN 6431/httpd

Any ideas what else could be wrong?

share|improve this question
    
What's the firewall settings? iptables -L -n –  cjc Aug 15 '12 at 14:41
    
'Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host- prohibited' I am not sure how to get the formatting right here. It keeps squishing all of it together... –  Dewayne Pinion Aug 15 '12 at 15:14
1  
Blah, that's hard to read. Please edit your Question and add in the iptables output. A quick glance, though, suggests that you're blocking everything except for SSH (port 22) and HTTP (port 80), so you will need to allow port 8088. –  cjc Aug 15 '12 at 15:40
    
Yeah sorry. I tried everything I could think of to edit it on here. Apparently they don't allow line breaks. If it would help I could link to a sample txt file or something. I can tell you that currently there is nothing in the OUTPUT section. –  Dewayne Pinion Aug 15 '12 at 16:11
    
Just wanted to write back that I went ahead and added the port number as an INPUT in my iptables file and things now seem to be working. Thank you for pointing me in the right direction. –  Dewayne Pinion Aug 15 '12 at 16:21

1 Answer 1

up vote 1 down vote accepted

From comments, the firewall is:

Chain INPUT (policy ACCEPT) target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host- prohibited

So, the INPUT chain for the firewall is only accepting SSH and HTTP (tcp/22 and tcp/80). You will need to add a firewall rule to accept port tcp/8088.

The best way to do this depends a little on the distribution level you're using, but on CentOS, you can edit /etc/sysconfig/iptables and add in the correct line, presumably by copying the one that allows HTTP.

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.