Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache and Ports question

Status
Not open for further replies.

ThinkGeekness

Technical User
Jan 20, 2003
55
US
I have a Netgear RP614 router and I have it hooked up to my Apache server (version 1.3 on RH Linux). I have forwarded port 8080 (since I am doubting that my ISP supports port 80) to go to my servers internal IP, 192.168.0.5. I can access the server from inside the network by typing in the internal IP, but when I type in the WAN IP I get a 404 error. I have told Apache to "Listen 8080" but its not working. Is there something that I did wrong?

Thanks, Justin
 
It sounds like you're set up correctly. Look for other router settings that may be messing you up - Stateful Packet Inspection, Block WAN requests, something like that. I don't know the router, so I can't be more specific.
 
Weird, the first on works and the second one doesnt. I checked to make sure the Listen is correct and I think that it is, but just to make sure it is:

Listen 8080
Listen 192.168.0.5:8080

Is that correct?

Thanks, Justin
 
That should work, but unless you have more than 1 network card, you don't really need the second line. Try to comment it out. Also try setting your 'port' in http.conf:

Port 8080
Listen 8080
#Listen 192.168.0.5:8080
 
BTW, you are restarting apache after you make changes to httpd.conf aren't you?
 
Thanks, I had the Port set wrong, it was still at 80. Now when I type in 192.168.0.5:8080 it works. But when I type in my WAN IP it still doesnt work, it must be a router setting somewhere... One more thing, if I type in 192.168.0.5 it doesnt work, I have to type in :8080. Is that normal? Also, when I registure for DNS, do I have to put my IP address as xx.xxx.xxx.xx:8080?
 
Something's still fishy. You shouldn't have to add the port number. Are you using Virtual Hosts?

WAN IP / router ---> does the wan IP address work if you add the :8080? This may just be the same problem that you have from the inside. Otherwise, it's a router setting.

DNS info won't require the port #.
 
No, I am not using Virtual Hosts. Before, when I didnt change anything (basically a fresh install of Apache) I didnt I have to put the port number. If I just go to 192.168.0.5 I get a 404 error. The WAN IP doesnt work even if I add the port numer.
 
Since you aren't using the standard port number 80, you must add the :8080 to the URL. //Daniel
 
Now even when I type in just 192.168.0.5:8080 I get a Invalid Syntax error. Really the only modifications that I have made is where the DocumentRoot is and the Listen and Ports. If I got a fresh httpd.conf file, and I start over, do you think that it might help for some odd reason? Also, where would I get a fresh httpd.conf file for Apache 1.3.26?

Thanks
 
Nevermind, I didnt type stupid me. So I dont think that I need to get a fresh one. I have an idea for a router setting that might work, hopefully it does. I will post back if I do/dont get it working.
 
Okay, what I thought didnt work. For my router, the menu bar shows for Advanced:
Port Forwarding
WAN Setup
LAN IP Setup
Dynamic DNS
Static Routes
Remote Management
UPnP

The only thing that I have changed for the router settings is Port Forwarding, and I told it to forward port 8080 to 192.168.0.5.

Also, why do I now have to put http:// in front of it to work? I didnt think that I did that before, is it because I changed the ports?

Thanks for your help, Justin
 
Yes, because most browsers interpret addresses as
Code:
<protocol>://<hostname or IP>:<port>/<path and/or filename>
So this means that if you just put
Code:
192.168.0.5:8080
it would be interpreted as if 192.168.0.5 is the protocol, and since there aren't to slashes after it, it's invalid. //Daniel
 
If I am planning on having Virtual Hosting, should I still do what this article says?
 
Yes, if you want. That article just shows a way to mask/hide the 8080 using the DNS service mentioned.
 
The article didnt help, it was more focused on DNS and on Linksys routers. From what you can see, am I doing everything right? I think that a Netgear guide to forwarding ports might help, although I thought that I did everything. Did I set up Apache correctly?

Thanks, Justin
 
I got it working! My router does not support loopback, so it was really working even when I was getting a 404 error. I had to go on another connection to view it.

Thanks for your help, Justin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top