LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-04-2011, 11:22 AM   #1
rahilmaknojia
Member
 
Registered: Dec 2007
Distribution: RHEL6, CentOS6.3
Posts: 188

Rep: Reputation: 32
Unable to access CentOS web server externally


Hello guys,

I am having issue accessing server over the internet from my company's network. It works great on LAN, but when I try going through Internet, it doesn't work. We have public ip address which is configured on static NAT for the linux server, which has the private IP address. I am not sure what am I doing wrong, but here is the configuration below for iptables and http virtual host:

VirtualHost:

NameVirtualHost 192.168.10.20
NameVirtualHost 76.8.138.254
<VirtualHost 192.168.10.20 76.8.138.254>
DocumentRoot /var/www/cacti
ServerName 76.8.138.254
</VirtualHost>


IPtables:

[root@whatsup cacti]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0
2 ACCEPT tcp -- 0.0.0.0/0 192.168.10.20 tcp dpt:80

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255
3 ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0
5 ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353
6 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631
7 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
8 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
9 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:21
10 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:25
11 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
12 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:137
13 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:138
14 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:139
15 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:445
16 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:443
17 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80
18 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Table: nat
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination
1 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:192.168.10.20

Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination
1 MASQUERADE all -- 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

Any suggestions would be appreciated
 
Old 11-04-2011, 11:02 PM   #2
rahilmaknojia
Member
 
Registered: Dec 2007
Distribution: RHEL6, CentOS6.3
Posts: 188

Original Poster
Rep: Reputation: 32
anyone?

anyone?
 
Old 11-04-2011, 11:13 PM   #3
kmassare
LQ Newbie
 
Registered: Apr 2011
Location: California, US
Distribution: Fedora
Posts: 28

Rep: Reputation: 8
I ran into a similar problem. It turned out to be a routing issue at the web server. I use two gateway routers to the internet for load balancing. The default route was set to use a different gateway than the NAT router. My fix was to set the default gateway to the NAT router. I found the problem by using tshark to monitor the internet side of the NAT router's network traffic on port 80.
 
Old 11-05-2011, 12:58 PM   #4
rahilmaknojia
Member
 
Registered: Dec 2007
Distribution: RHEL6, CentOS6.3
Posts: 188

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by kmassare View Post
I ran into a similar problem. It turned out to be a routing issue at the web server. I use two gateway routers to the internet for load balancing. The default route was set to use a different gateway than the NAT router. My fix was to set the default gateway to the NAT router. I found the problem by using tshark to monitor the internet side of the NAT router's network traffic on port 80.
Well let me get into details. Yesterday, I allowed all the TCP ports from the cisco router, but unfortunately it only lets me have access to server through SSH. I don't see port 80 open from external network. Only ports I see open is 110 and 22. I don't know if this is the server issue or router issue, because internally I can access web server without any hesitation and I can see port 80, 110, and 22 open when I do port scan.
 
Old 11-05-2011, 05:00 PM   #5
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by rahilmaknojia View Post
I don't see port 80 open from external network. Only ports I see open is 110 and 22. I don't know if this is the server issue or router issue, ...
if you don't have port 80 (http) forwarded at your router to your server internal IP (I presume 192.168.10.20) then it won't work. So make settings at your router port 80 forward to your IP.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CentOS 5.5 box unable to access a live web service on the Interwebs gr33d Linux - Networking 4 10-27-2010 04:36 PM
Unable to access file on web server Ryan_Sutton Linux - Newbie 2 11-19-2008 03:21 PM
web server not accessible externally GoBillsBN Linux - Networking 1 04-29-2006 11:55 PM
cant access my web server externally Eclectic Linux - Networking 2 04-17-2006 07:47 AM
Unable to access to a website on apache web server bisbane Linux - Networking 3 07-11-2001 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration