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 fixed it in PORTS TRIGGER menu of my router. Thanks you anyway

I have a weird problem related with (i think) my cable-router and my configured vhosts in Apache2.

The point is I can't access from outside of my LAN to any of my configured vhosts if I set the http port of Apache to 80 and i add a NAT rule for it. Otherwise, if I set my Apache port to 81 (or any else) with its respective NAT rule on my router it works.

My router is an ARRIS TG952S and I am using Apache/2.2.22 (Debian)

ports.conf

NameVirtualHost *:80
Listen 80

vhost1.mydomain.net.conf

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName vhost1.mydomain.net
    ServerAlias vhost1.mydomain.net www.vhost1.mydomain.net

vhost2.mydomain.net.conf

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName vhost2.mydomain.net
    ServerAlias vhost2.mydomain.net www.vhost2.mydomain.net

DNS records (using FreeDNS) are:

mydomain.net        --> pointing to another server
vhost1.mydomain.net --> pointing to my server
vhost2.mydomain.net --> pointing to my server

iptables -L -n

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
fail2ban-apache-noscript  tcp  --  0.0.0.0/0            0.0.0.0/0            multiport dports 80,443
fail2ban-apache  tcp  --  0.0.0.0/0            0.0.0.0/0            multiport dports 80,443
fail2ban-ssh  tcp  --  0.0.0.0/0            0.0.0.0/0            multiport dports 22

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain fail2ban-apache (1 references)
target     prot opt source               destination         
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain fail2ban-apache-noscript (1 references)
target     prot opt source               destination         
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain fail2ban-ssh (1 references)
target     prot opt source               destination         
RETURN     all  --  0.0.0.0/0            0.0.0.0/0 

Thanks you

share|improve this question
    
What do you get when try to access your website on port 80? –  Khaled Jun 21 '12 at 10:45
    
Just get timeout –  JavierMartinez Jun 21 '12 at 10:46
    
I edited again with the configuration of vhosts files –  JavierMartinez Jun 21 '12 at 12:11
    
When you do wget server.external.ip what happens? –  Mister IT Guru Jun 21 '12 at 13:23
    
Connecting with server.external.ip:80... failed: Connection timeout. Retrying. –  JavierMartinez Jun 21 '12 at 13:28

3 Answers 3

up vote 2 down vote accepted

Your ISP is probably blocking the port. Are you on a consumer grade line? What ISP?

share|improve this answer
    
I think that it is not an ISP block. In my opinion, it could be anything related to ServerName directive or something like that. I mean, an error in my vhosts & apache configuration files. Anyway, my ISP is Telecable (Spain) –  JavierMartinez Jun 21 '12 at 12:21
    
I forget to mention it but a month ago it works great. I think that it get broken when I changed that mydomain.net does not point to my server. I mean, just the subdomains vhost1.mydomain.net and vhost2.mydomain.net pointing to my server, but no mydomain.net –  JavierMartinez Jun 21 '12 at 12:24
    
@JavierMartinez Check the forwarding rule in the router, I think you must forward to a new server now. –  ott-- Jun 21 '12 at 13:12
    
@ott-- the rule is OK –  JavierMartinez Jun 21 '12 at 13:15
    
@ott-- I think that the problem is related to ServerName directive. What do I must have there? ServerName public_ip? –  JavierMartinez Jun 21 '12 at 13:17

Just to rule out firewall issues, please check if you've iptables configured and blocking port 80

$ iptables -L -n

Perhaps, it is even worth looking in /etc/hosts.deny Otherwide, you should contact your ISP about it as they may be blocking the port to block any commercial use of the internet connection.

share|improve this answer
    
I edited the question with the output of iptables -L -n. /etc/hosts.deny is clean –  JavierMartinez Jun 21 '12 at 13:07

Use tcpdump to see if the packets arrive at your server. Disable your firewall then run tcpdump as follows:

tcpdump -i eth0 dst port 80

Open a browser from an external computer and surf to your server. If your server receives packets then something else is wrong. Check if apache is running then check that all your apache config files are ok.

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.