Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-24-2004, 04:26 PM
|
#1
|
LQ Newbie
Registered: Feb 2004
Posts: 4
Rep:
|
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
|
|
|
02-24-2004, 04:37 PM
|
#2
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
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.
|
|
|
02-24-2004, 04:47 PM
|
#3
|
LQ Newbie
Registered: Feb 2004
Posts: 4
Original Poster
Rep:
|
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
|
|
|
02-24-2004, 05:00 PM
|
#4
|
LQ Newbie
Registered: Feb 2004
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
02-24-2004, 05:03 PM
|
#5
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
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.
|
|
|
02-24-2004, 05:07 PM
|
#6
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
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.
|
|
|
02-24-2004, 05:20 PM
|
#7
|
LQ Newbie
Registered: Feb 2004
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
02-24-2004, 06:08 PM
|
#8
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
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.
|
|
|
02-16-2005, 10:12 AM
|
#9
|
LQ Newbie
Registered: Apr 2004
Location: Sheffield, UK
Distribution: Debian Sarge
Posts: 13
Rep:
|
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
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
|
|
|
All times are GMT -5. The time now is 05:56 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|