LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Newbie Apache port question (https://www.linuxquestions.org/questions/linux-networking-3/newbie-apache-port-question-150055/)

waltz777 02-24-2004 03:26 PM

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

benjithegreat98 02-24-2004 03:37 PM

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.

waltz777 02-24-2004 03:47 PM

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

waltz777 02-24-2004 04:00 PM

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.

benjithegreat98 02-24-2004 04:03 PM

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.

benjithegreat98 02-24-2004 04:07 PM

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.

waltz777 02-24-2004 04:20 PM

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

benjithegreat98 02-24-2004 05:08 PM

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

gburch 02-16-2005 09:12 AM

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


All times are GMT -5. The time now is 06:02 AM.