I have Apache installed and the server directory index was accessible using http://localhost before I recently installed a new Dlink ADSL2+ Modem+Router . Now the apache web server contents are only accessible using the address 127.0.0.1 in the web browser. Using http://localhost displays a "403 Forbidden (nginx)" message. When I unplug my ethernet cable from the PC and restart networking , localhost leads to the apache index.
I have tried assigning a new domain name 'localwebserver' in the /etc/hosts file to 127.0.0.1 but then the browser displays a message "Critical error: no domain selected!"
My /etc/hosts file
127.0.1.1 avinash-ubuntu
127.0.0.1 localhost
127.0.0.1 localwebserver
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
My /etc/network/interfaces file
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
nslookup localhost
:
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: localhost.home.network
Address: 185.53.179.7
What could possibly be changed when I plug in the new router? How can I get localhost to display the apache index? Haven't found any option on the modem config page that seems related (to my knowledge)
Thanks
nslookup localhost