I've set up a LAMP server that is designed to host two websites. This LAMP server is one of two computers that is connected to a router in my home. The other computer (which is also connected to the router) is a machine that is running Windows XP.
Each of the two websites, that I'm trying to host, are using virtual IP addresses that I set up on the server. However, I have since learned that these two websites can only be viewed using the Windows XP computer that's connected to the router. If I try to view the websites outside of my home with a completely different computer, the websites simply don't load. I want to know why, and I want to know how to solve this problem.
The two websites are being hosted with virtual IP addresses. I suspect that the problem may have something to do with the IP addresses that I'm using, but I'm not sure. Let me explain how I chose the two IP addresses that are used for each of the websites.
I first typed "ifconfig" at the Linux prompt on the server computer in order to get the IP address for the server computer. Once I had this IP address, I pinged two IP addresses that are similiar to it. For instance, if the server IP address was 22.214.171.124, I pinged 126.96.36.199 and 188.8.131.52 in order to make sure that they weren't already in use. Once I saw that they were not in use, I decided to use them as static IP addresses for my two websites. So I set up all three IP addresses (including the one for the server) as static IP addresses by declaring them as such in corresponding "ifcfg-ethX" files, where "X" denotes the ethernet connections. So I have three of these files. One is for the server IP address, and the other two are for the virtual IP addresses for the websites. So the files are named as the following: ifcfg-eth0, ifcfg-eth0:1 and ifcfg-eth0:2. Each of the files are set up as static IP addresses that I got by means of the way that I described earlier.
After setting up the websites, I'm able to view them with a browser on my WindowsXP computer. If I type the IP addresses in the browser, the websites come up with no problem. However, this doesn't work on computers that are outside of my home.
I hope that someone is able, and willing, to tell me what I'm doing wrong so that these websites may become accessible to everyone in the outside world. What am I doing wrong?
Thanks for your time.