LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-24-2003, 06:14 PM   #1
arizona
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Rep: Reputation: 0
Angry Cannot access Port 80


I have a Dell 500SC running Suse Linux 8.2. I am attempting to use this machine as a simple web server. The web server is Abyss X1. When I try to configure the web server to listen on Port 80 it comes back and says that this port is already in use.

I have tested the web server by using port 8080 and trying the web site IP with the port appended to the name (xx.xx.xx.xxx:8080) and this works fine. I can't use it this way though as I must allow other users to access the website using our domain name (also works with the :8080 at the end).

I have spent hours on the SuSe web site and on search engines trying to fix this problem. I know that this is a Linux issue as I just had the same web site operational using three other boxes (an old Mac using MacOS 8.5 and Mac fttp, an eMac using OS X and Apache and a windows XP box using Abyss). Our Internet service supplier does not block port 80.

I am about ready to throw in the towel on Linux and go back to Windows or the Mac OS. I try Linux every six months or so and find it continually frustrating, inaccessable and hard to get clear and direct support on. Can anyone help before I take the software and toss into the can?
 
Old 08-24-2003, 06:35 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
What other services are you running? Are you sure nothing else, maybe even the web server isn't already running?

Have you tried running a scan on your machine to find out what is running already on port 80?
 
Old 08-24-2003, 06:55 PM   #3
arizona
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Original Poster
Rep: Reputation: 0
I can't figure out how to do a port scan in Linux. I know the web server is running as I can enter an appended ip address (a port other than 80) and it works OK.
 
Old 08-24-2003, 07:15 PM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Try running netstat or nmap to find out what services are running, preferrably netstat will do what your wanting.
 
Old 08-24-2003, 07:34 PM   #5
arizona
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Original Poster
Rep: Reputation: 0
I have run netstat -l to see which ports are listening. I see a number of items under TCP but no port numbers. How do I get the port numbers?
 
Old 08-24-2003, 08:20 PM   #6
arizona
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Original Poster
Rep: Reputation: 0
I finally figured out how to get the port numbers using, netstat -l --numeric; Here is what I got under TCP:

lance@linux:~> netstat -l --numeric
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
udp 0 0 0.0.0.0:111 0.0.0.0:*
 
Old 08-25-2003, 01:54 AM   #7
arizona
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Can't access port 80

I have a Dell 500SC running Suse Linux 8.2. I am attempting to use this machine as a simple web server. The web server is Abyss X1. When I try to configure the web server to listen on Port 80 it comes back and says that this port is already in use.

I have tested the web server by using port 8080 and trying the web site IP with the port appended to the name (xx.xx.xx.xxx:8080) and this works fine. I can't use it this way though as I must allow other users to access the website using our domain name (also works with the :8080 at the end).

I have spent hours on the SuSe web site and on search engines trying to fix this problem. I know that this is a Linux issue as I just had the same web site operational using three other boxes (an old Mac using MacOS 8.5 and Mac fttp, an eMac using OS X and Apache and a windows XP box using Abyss). Our Internet service supplier does not block port 80.

I am about ready to throw in the towel on Linux and go back to Windows or the Mac OS. I try Linux every six months or so and find it continually frustrating, inaccessable and hard to get clear and direct support on. Can anyone help before I take the software and toss into the can?
 
Old 08-25-2003, 07:21 AM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,778
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Is it possible that there is something already listenting at port 80? I don't know about Suse installs, but it is possible that Apache is already running. Try netstat -nl and see if something shows up. You can also use netstat -l and it will show you the process name instead of the port numbers.
 
Old 08-25-2003, 09:27 AM   #9
MacKtheHacK
Member
 
Registered: Jul 2003
Location: Boston, MA, USA
Distribution: RedHat, SuSE, Gentoo, Slackware, Mandrake ...
Posts: 111

Rep: Reputation: 15
Actually, use "netstat -lp" to get it to list process names. You definately have something running on port 80 already if you're getting the port in use message.

Have you tried to access your machine's port 80 with your web browser to see if there is a web server already there and serving things out? Another way to find out what is using that port is to connect to it with telnet, using "telnet localhost 80". If it doesn't immediately give you a message, type "GET /foobar HTTP/1.0" and hit Enter twice. If there's a web server there, it should send back a bunch of HTTP headers, some of which will tell you what server it is.

When you find out what is running there and kill it off, let us know what it was, OK? Oh, and you'll have to make sure that SuSE doesn't just restart it again the next time you boot. Use YaST2 and look under the System Settings / Services menu (I forget the exact names of SuSE's menus, but it's something like that. Find the service that you killed off, and disable it for all run levels. You should also be able to use this service facility to get Abyss to start up on every boot, if they've provided a startup script to install in /etc/init.d.
 
Old 08-25-2003, 09:58 AM   #10
arizona
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Original Poster
Rep: Reputation: 0
This is what I get from netstat:

tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN

You can see the Abyss web server at port 8080 (verified with netstat -lp). I tried "telnet localhost 80" and I immediately got back "connection refused".
 
Old 08-25-2003, 02:07 PM   #11
cyph3r7
Member
 
Registered: Apr 2003
Location: Silicon Valley East, Northern Virginia
Distribution: FreeBSD,Debian, RH, ok well most of em...
Posts: 238

Rep: Reputation: 30
looking at your netstat, obviously apache is not listening on port 80. here is my netstat:

cerveza# netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 *.80 *.* LISTEN
tcp4 0 20 xxx.xxx.xx.xx.22 xxx.xxx.xxx.xxx.48309 ESTABLISHED
tcp4 0 0 *.22 *.* LISTEN
tcp46 0 0 *.22 *.* LISTEN
tcp4 0 0 127.0.0.1.25 *.* LISTEN


what does your httpd.conf say? throw me a frekain bone here, need the info....(ok, so I am no Dr.Evil)
 
Old 08-25-2003, 02:11 PM   #12
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Note: I've merged your threads to eliminate the double posting which is against the rules and not necessary. Regards.
 
Old 08-25-2003, 02:27 PM   #13
arizona
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Original Poster
Rep: Reputation: 0
I am sorry about the double posting. That was a mistake as I actually thought I was on another forum when I posted it (I have the same question on several different forms).

httpd.conf does not exist on my machine as I am not running Apache (it's not installed). I am using Abyss X1 as a web server. I took another person's advice and tried "telnet localhost 80". This connection was also refused. I have verified that Abyss works OK on port 8080 (or another I might select other then 80). Something within the OS is refusing to grant access to Port 80.
 
Old 08-25-2003, 02:31 PM   #14
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 50
i might be mistaken here but i think to use a port below 1000 the process needs to run as root.

<edit> sorry, just skim-read the thread, will read thoroughly before i post from now on.

Last edited by kev82; 08-25-2003 at 02:50 PM.
 
Old 08-25-2003, 02:46 PM   #15
MacKtheHacK
Member
 
Registered: Jul 2003
Location: Boston, MA, USA
Distribution: RedHat, SuSE, Gentoo, Slackware, Mandrake ...
Posts: 111

Rep: Reputation: 15
Yes, but we wouldn't see the "address already in use" error if it wasn't run as root, we'd get "permission denied" instead. This is looking like it's a web server configuration problem, a bug in Abyss X1 that reports the wrong error (masking the correct one), or a firewall rule blocks the port (though you probably wouldn't get the in use message for that).

Let's see if we can get some really simple program to use port 80. Here's a PERL script that just tries to listen on port 80, and tells you if it could do it or not. If it can't it tells you why.

#! /usr/bin/perl -w
use IO::Socket;
use IO::File;

$PORT = 80;

$socket = IO::Socket::INET->new(
Proto => "tcp", LocalPort => $PORT,
Listen => SOMAXCONN, Reuse => 1);
if (! defined($socket)) {
print STDERR "Cannot listen on port $PORT: $@\n";
exit(1);
}
print STDERR "Able to Listen on port $PORT\n";

Run this as root (if you're sure I didn't put a trojan in there ;-) ) and let us know what you get. If it can listen on port 80, try starting up Abyss right afterwards and see if it still fails. If the above program can listen to port 80 but Abyss can't, then there's something wrong with Abyss or its configuration.

To check the outside chance that this is a firewall problem, run "iptables -L" and "ipchains -L" to dump any firewall rules, and see if there are any REJECT rules. If there are, make sure they are not rejecting port 80 or there is an ACCEPT rule for port 80 before any general REJECT rule.

Oh, one more idea: if the PERL script cannot listen on port 80, try it on port 81.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to access to the parallell port with C?? xyzt Programming 2 04-02-2004 02:54 PM
can't access some port from outside azure_ss Linux - Networking 5 10-02-2002 10:12 AM
Controlling port access? ugenn Linux - Security 3 05-13-2002 01:39 AM
Controlling port access? ugenn Linux - Networking 1 05-02-2002 09:13 AM
Cannot access LP port to print dsledge Linux - Software 0 12-21-2001 10:26 PM


All times are GMT -5. The time now is 05:27 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration