Can't access www folder via localhost, but 192.168.0.100

Discussions about using Linux guests in VirtualBox.
Post Reply
GrandTheftUbuntu
Posts: 1
Joined: 15. Sep 2013, 23:43

Can't access www folder via localhost, but 192.168.0.100

Post by GrandTheftUbuntu »

Hello everyone!

I have just installed ubuntu webserver in Virtualbox. I can access my www folder if I enter 192.168.0.100/index.php in my browser. However, if I try to do it via localhost, it does not work.

This is my hosts file:
ServerName localhost

127.0.0.1 localhost

127.0.1.1 ubuntuwebserver
zf2-tutorial.localhost localhost


# 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 virtualbox is set as network bridge adapter.

Does anybody know how I can access this folder via localhost?

Thank you!
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Can't access www folder via localhost, but 192.168.0.100

Post by noteirak »

This has nothing to do with Virtualbox I am afraid. It's only a matter of network configuration in the OS. A Network forum would be advised here.
But I would definitly NOT reconfigure localhost, you're going to have _a lot_ of issues...
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Can't access www folder via localhost, but 192.168.0.100

Post by Martin »

Did you check that your webserver software is configured to listen also on the localhost loopback interface?
Post Reply