LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-24-2004, 04:26 PM   #1
waltz777
LQ Newbie
 
Registered: Feb 2004
Posts: 4

Rep: Reputation: 0
Newbie Apache port question


I have a Red Hat Linux Server 9 (internal IP 192.168.1.107) running behind a Linksys WRT54G Wireless Router. I cannot "see" the default apache page within the LAN unless I change the port number to something other than 80 (e.g. 8080). That means, if someone from the outside wants to access my port forwarded domain, then they'll have to explicitly append port 8080 to the URL which I DO NOT want. Hence:

If I type: 192.168.1.107:8080 ... I can access apache on the linux box from the LAN
(.. Listen 192.168.1.107:8080)

If I type: 192.168.1.107 ... I cannot access apache on the linux box from the LAN
(.. Listen 192.168.1.107:80)

Does anybode know why? The apache swarm is running as "nobody" and the initial apache process is root. The error logs don't reveal any problems as far as i can tell.

Thanks
 
Old 02-24-2004, 04:37 PM   #2
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
Have you looked through your apache config file to make sure it is running on the right port? (/etc/httpd/conf/httpd.conf) If you type netstat -nlp it will tell you what programs are listening on what ports.

Most routers have the ability to forward external ports to other internal ports. So for example if someone request a page through port 80 on your router, it will redirect them to port 8080 on the internal address.
 
Old 02-24-2004, 04:47 PM   #3
waltz777
LQ Newbie
 
Registered: Feb 2004
Posts: 4

Original Poster
Rep: Reputation: 0
In my httpd.conf file, I believe the following takes care of how apache listens:

Listen 192.168.1.107:8080

If I comment change it to

Listen 192.168.1.107:80 It WILL NOT load the page

Thanks
 
Old 02-24-2004, 05:00 PM   #4
waltz777
LQ Newbie
 
Registered: Feb 2004
Posts: 4

Original Poster
Rep: Reputation: 0
netstat -nlp reveals that httpd is indeed listening on port 80 when i make the changes in the httpd.conf file. What is interesting is when I try to access the internal site from the outside using the URL on port 80 it automatically takes me into the routers webpage based config utility. Wonder if this has anything to do with me being unable to get to my linux web server from the inside, but i cannot see how.
 
Old 02-24-2004, 05:03 PM   #5
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
Could that possibly be due to a firewall setting?

Is there a reason that you cannot have it as just Listen 80? This would have it listen on port 80 for all bound ip addresses to that computer.

Do you have it configured for some kind of virtual hosts or anything like that?

Also run the netstat -nlp to make sure nothing else is listening on port 80.

If you restart it with port 80 in the config and it does not load then run ps aux to see if httpd is running. and netstat -nlp to see if it is running on port 80.
 
Old 02-24-2004, 05:07 PM   #6
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
In your post are you saying that if you are outside your network then you can get to your router's configuration webpage? The routers I've worked with had an option to stop that.

And no that should not stop you from seeing your internal webpage on a completely different computer.

Last edited by benjithegreat98; 02-24-2004 at 05:09 PM.
 
Old 02-24-2004, 05:20 PM   #7
waltz777
LQ Newbie
 
Registered: Feb 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Ben:

I've tried just "Listen 80" but that does not work either. In regards to your last post, what i meant was is that if i type in the external URL of the linux server instead of its internal IP from inside the LAN(either way), then I get the routers config page ... however, if I type in the servers IP address of 192.168.1.107 with httpd.conf configured simply to "Listen 80" it shows up as:

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 24021/httpd

using netstat -nlp

but i cannot type 192.168.1.107 and get the default apache page from my windows xp browser @ 192.168.1.100 or anywhere else.

Thanks

Last edited by waltz777; 02-24-2004 at 05:21 PM.
 
Old 02-24-2004, 06:08 PM   #8
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
have you tried checking out your firewall configuration?

I am using FC1, so this may be a little differnet from you, but if you go to the hat (start menu) -> System Settings -> Security Level.

/sbin/iptables -L will tell you something in the command line.

0.0.0.0 means that it is bound to all the ips on the computer.

Also can you open the page from RH? Using 127.0.0.1 and 192.168.1.107

What do you see from XP when you try to look at your webserver while using port 80l

Last edited by benjithegreat98; 02-24-2004 at 06:10 PM.
 
Old 02-16-2005, 10:12 AM   #9
gburch
LQ Newbie
 
Registered: Apr 2004
Location: Sheffield, UK
Distribution: Debian Sarge
Posts: 13

Rep: Reputation: 0
This sounds like the flip side of the current problem I'm having. I have a RedHat 9 box running apache, which works fine on port 80, but I need it to run on a different port. I have tried using port 800 and 8000 by altering the line

Code:
Listen 0.0.0.0:80
to :800 and :8000 in httpd.conf, which has no effect. Now I have it listening on port 80 and 8000 using 2 listen lines. I can see using netstat -nlp that httpd is listening on both ports. Unfortunately, the firewall doesn't have the ability to forward, say, port 8000 from the WAN to port 80 on this box, or this wouldn't be a problem.

Thank you in advance
 
  


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
Newbie Apache question MontyPY Linux - Software 6 03-03-2005 04:59 AM
newbie apache question... jjd228 Linux - Networking 1 01-08-2004 01:57 PM
very newbie Apache question mla Linux - Software 6 10-10-2003 04:35 PM
very newbie Apache question mla Linux - Software 3 10-10-2003 04:20 PM
Apache newbie question.. (very newbie question) tarballed Linux - Newbie 1 02-07-2003 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:56 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
Open Source Consulting | Domain Registration