LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-19-2009, 01:35 AM   #1
peter53
LQ Newbie
 
Registered: Nov 2009
Distribution: Ubuntu 10.04
Posts: 22

Rep: Reputation: 15
port 80 blocked


I have found I can no longer access my home server website externally and internally. I can ftp the directory and html pages, access the site using putty every thing is fine. When I type in 'sudo nmap -p 80 192.168.1.3' to check the port I am told

PORT STATE SERVICE
80/tcp closed http

so I assume that a firewall somewhere on my server is blocking port 80 but I don't seem to be able to find where this is occurring.
I have checked related posts in this forum but none seem to help.

Last edited by peter53; 12-19-2009 at 01:38 AM.
 
Old 12-19-2009, 01:46 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Welcome to LQ.

What changed?
Are you running any firewalls - check them - check hardware routers etc for built in firewalls - do you use any automatic updates?
 
Old 12-19-2009, 01:58 AM   #3
peter53
LQ Newbie
 
Registered: Nov 2009
Distribution: Ubuntu 10.04
Posts: 22

Original Poster
Rep: Reputation: 15
WHat changed, good question, I am not sure I am using Ubuntu server software I have been updating regularly myself. its using a shorewall firewall and I put in
'ACCEPT net $FW tcp 80' in to the rules file.

I've checked the iptables and have put in
ACCEPT tcp -- anywhere anywhere tcp dpt:www
but still no luck when I check the port.
 
Old 12-19-2009, 02:21 AM   #4
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
If you turn off both firewalls, can you connect? Is you web server running? Is it listening on the external IP? Can you get to it by IP from the server?

Let us know,

Forrest
 
Old 12-19-2009, 03:53 AM   #5
peter53
LQ Newbie
 
Registered: Nov 2009
Distribution: Ubuntu 10.04
Posts: 22

Original Poster
Rep: Reputation: 15
Hi Forrestt,
If you turn off both firewalls, can you connect?
I turned of shorewall and checked port80 - still blocked
I don't know how to turn of the other firewall you refer to.
I did try 'sudo iptables -F' to flush out the iptables all that did is hang the server requiring a reboot.

Is you web server running?
yes it is running I can connect using putty and mozilla ftp. I can look into the www directory. Start the index.html file using knome on the server so all is fine except for the port being closed.


Is it listening on the external IP?

I put 'Listen 80' in the httpd.conf file.

Can you get to it by IP from the server?
not sure what you mean here.

I am just blundering through here so sorry if I don't always understand how things are done.
 
Old 12-19-2009, 04:00 AM   #6
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
Sorry, I didn't mean was the hardware running, I meant was the httpd running. You can connect with putty (sshd is running) and ftp (ftpd is running) without being able to connect to the web server (httpd is NOT running). By "Can you get to it by IP from the server?" I mean, if you go to the server console, open up firefox and type in the IP address of the server, do you get a page?

Forrest
 
Old 12-19-2009, 04:01 AM   #7
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
I think iptables (if running) can be switched off with:

Code:
service iptables stop
You could first check the status of iptables

Code:
service iptables status
This will tell you whether it is running.
 
Old 12-19-2009, 04:34 AM   #8
peter53
LQ Newbie
 
Registered: Nov 2009
Distribution: Ubuntu 10.04
Posts: 22

Original Poster
Rep: Reputation: 15
Hi Harry,
I tried
'sudo service iptables stop'
and I get '$iptables: unrecognized service'

Hi Forrestt,
I typed in http://192.168.1.3
and I get 'refused connection'


If I type in to connect to http://google.com it connects without any trouble.
 
Old 12-19-2009, 04:48 AM   #9
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
It sounds like your web server isn't running. Look at your error logs to see why.

Forrest
 
Old 12-19-2009, 04:52 AM   #10
peter53
LQ Newbie
 
Registered: Nov 2009
Distribution: Ubuntu 10.04
Posts: 22

Original Poster
Rep: Reputation: 15
Can you tell me how I access the error logs forrestt?

Last edited by peter53; 12-19-2009 at 05:56 AM.
 
Old 12-19-2009, 06:06 AM   #11
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
They should be in "/var/log/httpd".

HTH

Forrest
 
Old 12-19-2009, 10:41 AM   #12
jaymarting
LQ Newbie
 
Registered: Apr 2009
Posts: 15
Blog Entries: 7

Rep: Reputation: 0
Firewall is the first place I would check.
 
Old 12-19-2009, 03:44 PM   #13
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
jaymarting, I agree, but since he's turned them off and still gets a connection refused, we're past that point.

Forrest
 
Old 12-19-2009, 05:43 PM   #14
peter53
LQ Newbie
 
Registered: Nov 2009
Distribution: Ubuntu 10.04
Posts: 22

Original Poster
Rep: Reputation: 15
Hi Forrest,
I tried to look in the /var/log/httpd directory but I don't have one.
I did look in var/log/ directory
I then tried to connect to the webserver and checked the logs that updated when I tried to look at the web page but couldn't see anything of relevance with my limited understanding.

refering to your comment to jaymarting forrestt about turning the firewalls off I turned off shorewall but I don't know what others to turn off.
 
Old 12-20-2009, 04:33 AM   #15
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
netstat -an | grep -E ':80|:443'


That should tell us whether ANYTHING is listening or active on port 80 or 443


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SMTP port being blocked. Johnny99 Linux - General 4 02-03-2009 11:37 AM
Blocked FTP port 21, Why? immortaltechnique Linux - Networking 6 07-11-2007 02:57 AM
Why is my port 25 still blocked jfaberna Linux - Security 8 02-21-2006 11:46 PM
SMTP port blocked pierre-luc Linux - Networking 2 05-08-2005 03:53 PM
blocked port 80 squi Linux - Newbie 1 09-19-2003 10:57 AM


All times are GMT -5. The time now is 10:21 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration