How can I access my Ubuntu Maverick server remotely?

Robert November 27, 2011

Running Ubuntu Maverick. Apache, MySQL, PHP work great. I can work locally on my webpage, view it, access database. All is cool.

But how do I access this stuff off-site, remotely?

My ISP provides a static public IP. I’m almost sure I should be able to use that address and log in remotely to my ‘localhost’ web pages. But just don’t know how to go about this. Something to do with port forwarding?

  1. Amalafrida
    November 28, 2011 at 2:42 pm

    In order to keep this as simple as possible, I've pulled the router out of the loop.

    Numbers look like this:
    HOST: -->
    browser serves web page;
    google translate: fails, of course (invalid url)

    MODEM: -->
    browser serves modem config/info page;
    google translate: ditto

    browser serves modem config/info page;
    google translate: fail

    browser yields 'time out';
    google translate: fail

    all four addresses ping out nicely

  2. Mike
    November 28, 2011 at 12:20 am

    1. the hosts file only applies to the computer you set it up on.
    2. the hosts file is used to resolve host names which means if add "" you can enter "" in your browser and the request will be routed to "" nothing more or less

    All in all it has nothing to do with you being forwarded to your routers interface. 

    From within the LAN it doesn't matter whether you enter "http://your_routers_ip" or "http://your_public_ip" because both will end up at the router. And like most home routers do your internal http request is not processed by port forwarding which is why you see the routers configuration page instead of your local server.

    As for the "" result I can only assume that you either didn't save the port forwarding of "port 80 to" or your router doesn't allow forwarding of http (e.g. some Thomson models with a certain firmware restrict that).

  3. Anonymous
    November 27, 2011 at 5:16 pm

    your router supports NAT reflection?

    can you hack your hosts file (before make a safe copy of hosts file)
    Add this to your hosts file.

  4. Amalafrida
    November 27, 2011 at 3:55 pm

    Thanks, ha14, for staying with me on this. will not connect to server using http://hostname_of_10.0.0.2

    However, DOES connect to server web page via

    This works with firewall enabled/disabled.

    Great, thanks for that. I can access the server pages from any machine on the LAN.

    But now, how about access from a remote machine? As I say, accessing my public IP takes me to my modem config/info page. An effort to connect to this same address from a remote machine, receives a 'connection time-out' response.


  5. Amalafrida
    November 27, 2011 at 2:48 pm

    Thanks, ha14. My LAN hosts all have working SSH connections. Not a problem. However, perhaps I should break this down to a more simple scenario. Apache, MySql are running fine on my server ( If I navigate to http://localhost, I do indeed receive the proper web page (index.html). Data is successfully queried out of the database, etc.

    But, for starters, how do I access that web page from one of my other LAN devices, e.g.

    What do I place in the address bar of my machine? Not http://localhost, of course, because that simply takes me to's localhost page.

    I certainly appreciate all the responses.


  6. Anonymous
    November 27, 2011 at 2:36 pm

    Connect to Ubuntu 10.04/10.10 Maverick Meerkat via Secure Shell (SSH)

    Basic SSH Setup On Ubuntu 10.10 Maverick Meerkat Using OpenSSH Server

    How Do I Enable Remote Access To MySQL Database Server?

  7. Amalafrida
    November 27, 2011 at 2:18 pm

    Tried this in router configuration. No success. Set up 80,443,22 under port-forwarding menu of my Netgear router. Still, when I attempt to open the public IP, I am taken to the modem configuration page. On that page, among other items, is this menu choice:

    A very limited number of applications require that the public IP address
    assigned to the modem be used by the local LAN device.
    Let LAN device share Internet address?    
    No, use private IP address.
    Yes, use public IP address
    Is this part of the struggle? Should I select "Yes?"

  8. Mike
    November 27, 2011 at 10:27 am

    Yes, you access your server via your public IP. For a simple webserver it would be http://your_public_ip/

    Since you probably have a firewall or router you are right about setting up port forwarding. What ports to forward depends on the access you want to be available from the WAN (internet) side.

    For a simple Apache webpage you will need port 80 (http) and maybe port 443 (https). If your webstuff is running on a special port e.g. 5000 you have to forward this one too.

    For remote access to the console you will have to setup an sshd (SSH server daemon) within Ubuntu and forward the port specified in it's configuration (default being port 22).

    • James Bruce
      November 27, 2011 at 10:41 am

      So basically, add a port forward setting for 80,443,and 22 (TCP) to your router config, pointing at the local IP address of your ubuntu server. 

  9. Learn Spanish Fast
    April 8, 2011 at 10:20 am

    You interact with native speakers

Ads by Google