Running apache webserver behind Linksys Router

gwgman

Member
Jul 31, 2001
47
0
0
I am trying to run a apache webserver from behind my linksys rouer. My cable modem is Optimum Online. I cant use port 80 because the router or optimum online uses that port. So i am using port 81. I know that it is possible to run a webserver w/ all of these thing because i had done it. Then i reformatted my computer. Now everything is messed up and i cant get it to work. I have tried to do port forwarding. Port 81 ~ 81, Both, and then my computer local ip. But that didnt work. I tried DMZ host, and put my computer number in it. that didnt work either. I am not sure what else to do. The pages show up in the browser when i use the address 'http://localhost:81'. But when i use my ip address in place of localhost is doesnt work. i know others will need to use my ip to access the webserver as well.
 

SaturnX

Diamond Member
Jul 16, 2000
3,415
0
76
Hrmm.. I'm not sure about the Linksys, but it may not support Loop-Back, meaning you can't enter your own IP and have loop out, and then back to your system again. I have an SMC Barricade router, and even though I can't type in my own IP address, it works whenever I use localhost or if I use my IP address from any system outside of my home network.

Just make sure you have all the ports set to forward to your machines local IP, (ie: 192.168.1.2 or whatever) then you'll have to try and access it from outside your own network, it should work that way.

--Mark
 

DanFungus

Diamond Member
Jul 27, 2001
5,857
0
0
Originally posted by: Tharyn
Hrmm.. I'm not sure about the Linksys, but it may not support Loop-Back, meaning you can't enter your own IP and have loop out, and then back to your system again. I have an SMC Barricade router, and even though I can't type in my own IP address, it works whenever I use localhost or if I use my IP address from any system outside of my home network.

Just make sure you have all the ports set to forward to your machines local IP, (ie: 192.168.1.2 or whatever) then you'll have to try and access it from outside your own network, it should work that way.

--Mark

my linksys supports loopback...I can type in my WAN IP or my LAN IP :port, and it works fine...I gotta go now, but when I come back, I'll try and help if you don't figure it out by then :)

 

gwgman

Member
Jul 31, 2001
47
0
0
My aim name is malakai015 & GeeDubya15

Also just incase im not port forwarding right or dmz host, how do i check to see what my number is on my computer. Like in the port 192.168.1.x how do i check to see what x is for my computer?
 

DanFungus

Diamond Member
Jul 27, 2001
5,857
0
0
in windows 95/98/Me, goto start>run, type in winipconfig, hit enter. it'll say there, you might have to select for network card incase it's looking at a diff. one (mine used to do this). with win2k/XP goto start>run, type in cmd, hit enter, type in ipconfig, hit enter.
 

DanFungus

Diamond Member
Jul 27, 2001
5,857
0
0
I'm running 1.3.26, and I think it was basically the same as .24 incase you're running .24. If you are, I highly suggest to get rid of .24, since Apache people (whoever made it :p) found a lot of vulnerabilities (sp?) in it....But, in my httpd.conf file, I have this:

Listen 192.168.1.2:8080

so, Apache listens to that IP with that port for any requests. Everything else in my httpd.conf had nothing to do with my LAN IP, except for my Virtual Hosts, so that I could have a few websites on different ports.

um, but make you you have the above set as your LAN IP instead of localhost, or else it won't work. :)

edit: oh yeah, kinda forgot where I was going....

anywho, make sure ^ is there, and then in your firewall, forward port 81~81/Both/to 192.168.1.x (your LAN IP). It *should* work, if not, the problem is something else (duh)..

I read somewhere that you have to edit the hosts file to redirect something to your computer, or something, but, that shouldn't affect it, because mine works without having teh hosts file edited.
 

gwgman

Member
Jul 31, 2001
47
0
0
OMG, this still isnt working. Yeah i had version 1.3.24, but now i update to 26. It still didnt work. My computer is 192.168.1.102. And i did forward port 81~81/Both/to 192.168.1.102 (your LAN IP) like you said. Still doesnt work. Also i wanted to know should i have the DMZ Host set for '0' or '102'. \

Also in the http.conf file at the listening part it views like this:
#Listen 3000
#Listen 192.168.1.102:81
- which the # sign in front. Am i supposed to take it out so its just:

Listen 3000
Listen 192.168.1.102:81
- or leave the # sign in there. I tried both ways and it didnt work though. Also DanFungus what router are you using? and who is ur cable internet provider. Im optimum online.
 

DanFungus

Diamond Member
Jul 27, 2001
5,857
0
0
ok, just got back.

for DMZ, put in 102. 0 makes it so that DMZ is off.

For the Listen part, you want to take out the #. What the # does is to make it so that Apache skips over the things with # in front of it. Like, lets say you added a line of code into the httpd.conf file, and you wanted to put something above it to tell yourself what it was, incase you forgot. You would put something like this:

#this is my reference line. Apache will not execute it, and it is only useful to me
when person goes to my website, redirect them to index.htm

obviously the "code" line isn't really code, but, you get the idea :)

So, back to your question, you would just want it to be like this:

Listen 192.168.1.102:81

the Listen 3000, I'm assuming would be to listen on all IP addresses, at port 3000. OH, you WOULD want to put Listen 81 IF your LAN IP changes. To check if it will, goto your firewall, then click on the DHCP tab, and if DHCP Server is enabled, your IP will change. If it's disabled, it will not change. Hopefully, it is disable, but chances are it is enabled. The problem would be is let's say you forward port 81 to 192.168.1.102, then you restart, and your IP changes to 192.168.1.103. Your website will not work anymore (assuming we get it working :)). If DHCP is disabled, you will ALWAYS have 192.168.1.102. If you do disable DHCP, you need to change some of your settings on your Network card (TCP/IP properties--it's the information telling yuor computer how to get an IP address to connect to the internet), so just disabling DHCP won't fix it right away.

I also have a Linksys router, BEFSR41.
 

gwgman

Member
Jul 31, 2001
47
0
0
Thanks for the help Dan, disabling the Windows XP firewall worked. Now im up and running. i guess it was the router, apache or isp.