How to make a LAMP server accessible from the internet?

First, ensure that your machine has a static LAN IP address (either in the 192.168.. range or in the 10.0.. range, depending on how your router is set up). You can take a look at the  /etc/network/interfaces file to configure your eth0 (if you are using Ethernet to connect to your router) like this:

auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

This example is for the case of 192.168.. network configuration. Consider changing it to your case (you can find your network specifics by running the ifconfig command).


After that, forward the port in your router's Port Forwarding section. You need to enable access from the outer world to your machine's Apache; by default, it's configured to use port 80 for HTTP and 443 for HTTPS.

If you have configured the static IP of your machine to be, let's say, 192.168.1.10, then the combination of IP and port that would match the Apache on your machine would be 192.168.1.10:80. To configure this, take a look at the section here.

If everything goes OK, then the world can access your Apache at YOUR.PUBLIC.IP/SNS, if SNS is the folder in your /www root that contains your social site.  (You can easily find your public IP, just search for "What is my IP".)