Thread: Web Server in Router Network...

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    162

    Unhappy Web Server in Router Network...

    Hi all,

    I am writing my own HTTP web server that is suppose to be runnig on a computer in a network that is connected to the internet through a router. Now the router has been configed to send any HTTP protocal messages to the computer with the web server. But when I try to connect to the web server through the routers internet IP from the same computer running the server it fails to connect. Now I think that you arn't suppose to be able to connect to a local web server through a internet IP, am I right? But then how can I test that my web server works on the internet and what about FTP servers? Any ideas on how to test if the server works on the internet with the same computer running it, without connecting to it through it's local IP?
    Last edited by Aidman; 01-12-2003 at 08:50 AM.
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

  2. #2
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807

    ...

    Of course you can connect to an local web-server using the IP of the machine, this shouldn't be the problem.

  3. #3
    Registered User
    Join Date
    Dec 2002
    Posts
    162

    re: reply

    Yes, I know that it is possible to connect to the web server by the local IP. But I have noticed that in some cases the web server acts diffrently on the web... so I need to test that it works there also.
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

  4. #4
    Make sure your ROUTER is not running DHCP, most general use routers will not let you forward packets if DHCP is on. So turn it off, and make sure your comp and every other comp on the network has it's own IP, the web server needs a STATIC IP in your LAN with or without DHCP.

    Once DHCP is disabled, you can forward packets to the web server:

    Port 80~81
    20~25

    //There are some other standard ports that u can forward also, the important ones are HTTP:80 FTP:21
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  5. #5
    Registered User
    Join Date
    Dec 2002
    Posts
    162
    I have already enabled port forward to my webserver machine but there is no DHCP toggle setting for my router...

    Isn't there any site that could test your webserver, display the content or let you visit your own webserver remotely through there site, like in ms remote desktop or ms agent?
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

  6. #6
    To help you further, I would need the ROUTER manufacturer, and the WebServer type (LINUX, IIS)??
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  7. #7
    Registered User
    Join Date
    Dec 2002
    Posts
    162

    info

    My Router is an NetGrear RP614 and in the manual it says:
    "Local PCs must access the local server using the PCs’ local LAN address (192.168.0.33 in this example). Attempts by local PCs to access the server using the external IP address (172.16.1.23 in this example) will fail."

    And the HTTP web server is my own application that only send out the requested HTML website, nothing more.

    I know my webserver woks for now but I wanto be able to check it and debug it while I work on it. Is there any way of testing my webserver sites from the internet? Becouse I know the server has some problems when it comes to the internet.
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

  8. #8
    It's perfectly fine to connect to a site or computer using it's IP address.

    http://62.4.46.37/index.htm

    However, when you are on a LAN the IP addr will be interpreted as a LOCAL addr and not a WAN or internet addr.

    -go here, and register your WAN or ROUTER/CABLE/MODEM IP address as a webname-
    http://www.dyndns.org
    -it's automatic, as it will check your IP for you-

    The internet works through DNS which will bind a NAME to your WAN IP so you can just type the name into the browser. Like mine is www.onestiffrod.kicks-ass.net which just points to the IP of my Home Cable, which my network is attached to (it's disabled currently).


    After you do that you can EASILY tell whether you can connect to your webserver over the internet. And whether you need to reconfigure the ROUTER to support your webserver.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  9. #9
    Registered User
    Join Date
    Dec 2002
    Posts
    162
    I have done all that but when I write in my internet address on the webserver machine http://aidman.homeip.net it can't be found, and I check to see that IP was correct in the DNS database and it was. But when I tried with a friends computer (not connected to my network) it worked. So is there any way to check that my web server works with my internet address from the webserver machine?
    Last edited by Aidman; 01-16-2003 at 11:12 AM.
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

  10. #10
    Do u mean that when u try to surf to your site, in browser, from the comp running the server it doesn't recognize?
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  11. #11
    When u put a URL into a browser it searches for a DNS Server to find that name and subsequent IP. Make sure you are not running any DNS Server on your LAN which I doubt u are - then make sure the comp the Webserver is running on has a STATIC IP along with at least 2 DNS Server URL's/IP's designated. Usually your ROUTER will show which DNS Url's you are using. Take those and specifically set the comp DNS to those url's.

    Then try to punch in your internet addr. on the webserver.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  12. #12
    Registered User
    Join Date
    Dec 2002
    Posts
    162
    Before I continue with my "reply to your replys" I wanna thank all of you, especially OneStiffRod, for taking time helping little me.

    make sure the comp the Webserver is running on has a STATIC IP along with at least 2 DNS Server URL's/IP's designated. Usually your ROUTER will show which DNS Url's you are using. Take those and specifically set the comp DNS to those url's.
    Sorry OneStiffRod but I don't really understand what you mean... How can I designate a DNS to my webserver machine, do you mean binding my DNS url address to my Internet IP and then setting the Router to port forward all HTTP messages to the webserver machine IP? And why at least 2 DNS Server URL's/IP's?But if the DNS address was the problem then how come I can connect to my webserver from another machine outside my network with the DNS url?

    I have configerd my Router so it updates the DNS IP database with my new Internet IP, every time a connect to the Internet. Also my webserver machine has an static IP.

    Is it possible to connect to my webserver from the same machine running it through the internet IP even if the Router manual says it is not possible for a local machine to connect to a machine from the local network through the internet IP? And isn't there any websites that allow you to monitor, test or even visit your own webserver through their site or server, like remote monitoring or testing?
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

  13. #13
    I don't know which type of OS your using but here's what I mean.

    --You must simply designate the COMPUTER's IP and DNS - here's how it looks in Windows. Simply set the IP, subnet, and 2 DNS url's/Ip's
    Last edited by OneStiffRod; 01-17-2003 at 01:58 PM.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  14. #14
    Registered User
    Join Date
    Dec 2002
    Posts
    162
    What DNS IPs should I input, I use www.dyndns.org same as you.

    And what should I input in the IP Settings and DNS of the advanced section?

    See the attached image if you don't understand my question...
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

  15. #15
    Uh-oh, you see what I told ya from begining DHCP needs to be disabled.

    You need to specify a UNIQUE IP addr for the computer which is running the webserver software.

    IP: 192.168.1.200
    SUBNET: something like 255.255.255.0 (usually auto set)
    GATEWAY: This is the IP of your ROUTER. Check your router manual to see what the Default IP is, the ROUTER IP is also how you connect to and configure the ROUTER.

    //Check your router - usually if it set to auto detect it will tell you which DNS servers your connection uses, copy those values into here-
    DNS1: something like 68.8.46.225
    DNS2:

    I see in your pic that DHCP is enabled - disable it and fill in the fields as described.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can i force connecting to local web server via internet network ?
    By umen242 in forum Networking/Device Communication
    Replies: 5
    Last Post: 04-29-2008, 09:21 AM
  2. Server Architecture
    By coder8137 in forum Networking/Device Communication
    Replies: 2
    Last Post: 01-29-2008, 11:21 PM
  3. Dedicated Network Server Apps
    By LuckY in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 07-07-2004, 09:37 AM
  4. SWEBS Web Server
    By nickname_changed in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 09-22-2003, 02:46 AM
  5. socket question
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 07-19-2002, 01:54 PM