SUCCESS.
Now we need to be able to let others access this website from outside the server.
First I note that when I fire up Firefox outside the Virtualbox virtual machine that is holding the Apache server, I am not able to access the website 10.0.2.15.
I check the IP Address of the host machine (as assigned by DHCP) and it is 192.168.1.72
These are on 2 different subnets. So we need to assign the VM a static IP Address in the same subnet, 192.168.1.150
Right now DHCP is assigning the IP Address. We want to change that to a static IP Address using nano.
$ sudo nano /etc/network/interfaces
Now we can edit this file:
Need to save using CTRL X and yes to overwrite and Enter
Now we need to restart apache2:
$ sudo /etc/init.d/networking restart
Test the webpage by entering in new IP Address.
$ w3m 192.168.1.150
No joy. So I looked at the Virtualbox settings. I changed this:
To this:
Did Restart again:
Still no joy, so I shut down the VM and started it up again:
And success. The moral, don’t get discouraged, keep trying until you find the answer to the problem at hand.
As you can see, the new IP address information has taken effect.
Now we can test again using w3m:
Finally, now to test outside the webserver (effectively, a host outside the webserver). Fire up a web browser outside of Virtualbox and enter in the new static IP address—here 192.168.1.150:
SUCCESS.
|