Ubuntu – How to make the webpage accessible from Internet

Apache2serverwebserver

Situation: I have Apache2 server with Linux Ubuntu OS 11.10.
Then I install a PhP5, MyAdmin, DNS server, LAMP server, MY SQL server.

This is what I have done:

  • check localhost 127.0.0.1 and it works!
  • edit index.html default webpage located in /var/www
  • change my IP address to static
  • restart /etc/init.d/apache2 restart {OK}
  • bought a domain name
  • turn off Firewall on my router

Now I need Your HELP!

Please tell me how and what needs to be done that other people around the world can type my domain name and connect to my server and default web page index.html located in /var/www?

I do not care about security. I changed permission on /var/www/ to 777 for the moment, because I want to host my simple website or webpage but only on my local server.
THANK YOU this is my first server and I guess YOU got the point. If possible step by step.

Best Answer

You need to do 2 things:

  • configure nameservers (probably in some control panel of the registrar from which you bought the domain) to point the A record to the (static) IP address of your router (i.e. its external address) - I hope by "I changed my IP address to static" you mean that you contacted your ISP and requested a static IP address from them, not that you configured your machine's local IP to be static (though the latter is needed too)

  • Secondly, you go to your router's configuration page (see your router instructions, usually it's something like http://10.0.0.1:8080/) and configure Port Forwarding - i.e. you need to tell your router to take all requests which come to its external interface on port 80 and redirect them into internal network to the IP of your server, then take the response and send it back as if it was generated by the router. So for external world the responses will be coming from the external IP of the router. To which IP your DNS records point to. Easy-peasy.

Also, some ISPs, to protect users, block all incoming connections to the client's IPs or only to some common ports. So the access from outside may not work even if everything is configured correctly. You will need to check with your ISP to figure out how to remove port blocking.

There's no need to change anything in your Ubuntu settings, no need to change permissions on /var/www or anything... as such, it may be beneficial for you if this question was migrated to serverdefault.

Related Question