Find the answer to your Linux question:
Results 1 to 6 of 6
<noobie> Hi, I recently bought and installed a wireless router. On one of its LAN ports, I want to configure a linux-based webserver. Now, the router acts as a DHCP ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    7

    Question Web server behind an ADSL router


    <noobie>

    Hi,
    I recently bought and installed a wireless router. On one of its LAN ports, I want to configure a linux-based webserver. Now, the router acts as a DHCP server and assigns addresses from 192.168.0.2 - 192.168.0.254.
    My confusion is how do i configure the linux box so that an http request from outside (internet) gets to it. The adsl router has a static ip from the provider.

    Is there enough info in my query? The setup basically looks like this:

    { internet } <==> (adsl router) <==> LAN (where one of the boxes is the one whom I want to be the web server). There are a couple of laptops too that I use wirelessly.

    Thank you.

    </noobie>

  2. #2
    Just Joined! {-n()rx-}'s Avatar
    Join Date
    Jan 2007
    Location
    London
    Posts
    10
    I have had the exact same thing (and still do), to host my webserver, very easy to fix.
    It depends on what router you have, to do stuff in specific places, but:
    1)Type in your routers IP address in the address bar of your browser.
    2)A log in box will appear, usually the username and password are both admin, or sometimes username: admin password: password.
    3)Now you have to look for something in your router configuration called "Port forwarding", or "Virtual servers"
    4)Add a new port forward/virtual server with:
    public/private port: 80
    port type: TCP
    Host IP: {Ip of your pc}
    5)Save changes and reboot router, it should now re-direct all incoming traffic of port 80, to your pc, and in doing so enabling people to see your site.
    6)If you need any help at all, post again, or try http://portforward.com/routers.htm for all the support youll need basicaly.

    Good luck, and I would like to hear from you, whether it was successful, not succesful, or you need more help.

  3. #3
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    in addition to this, if you find that it doesn't work immediately, you may also need to open port 80 on the external interface, i know my method is pretty much the same, except forwarding the port doesn't also open the port, so any requests get blocked by the router's built in firewall.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  4. #4
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    In addition to this if you are trying to access your web on the inside of you network and you don't have internal DNS you will have to add this to your host file

    192.168.0.13 <tab><tab> yourwebsite.com

    So

    192.168.0.13 <---or whatever the IP of your website then hit tab twice
    then the name of your site.

    That way you will see it from the inside of your network

    /etc/hosts

    If you don't add this to hosts and you try and access from a private IP it wont know what the name of your web is. The out side world should see it fine but you won't internally. make sense?
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  5. #5
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by adrenaline
    In addition to this if you are trying to access your web on the inside of you network and you don't have internal DNS you will have to add this to your host file
    This also is a thing dependent on the router. When i was on standard ADSL service at Uni, i couldn't access anything and had to do something like this. Now i'm at home, and we're on cable internet, i dont know wether it's the fact we're on cable rather than ADSL or the router, but now, i can even access non-standard ports using my domain name rather than having to use the internal IP/hostname.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  6. #6
    Just Joined!
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    7

    Smile

    Thanks for all the replies, guys. Haven't got much time to play with it lately. Will try it out by this weekend and post my results.

    Cheers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •