Reputation: 14393
I tried to install Vagrant and Ubuntu on mac os 10.9.4 to make a local development server following this great instructions by @fideloper: Vagrant and Apache.
the Vagrantfile contains:
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.synced_folder ".", "/var/www/html"
evreything worked fine during the process: Vagrant and virtualbox are installed, Apache is installed on the guest.
from this answer, i tried:
curl 'http://localhost:80'
returns an html with a file listing curl -v 'http://localhost:8080'
returns the
same page.but the browser says this webpage is not available
at localhost:8080.
why the browser is not displaying localhost:8080?
Upvotes: 6
Views: 4982
Reputation: 12293
The setting:
config.vm.synced_folder ".", "/var/www/html"
will overwrite whatever's in the server's /var/www/html
directory with whatever is in your host machine's "."
directory (the shared directory).
There's no longer Apache's default index.html
file at /var/www/html/index.html
because you mounted your shared directory at that location in the Vagrant synced_folder settings.
From what you're saying, it's working totally normally and you can just start adding your own .html files into your shared folder and go! You just don't have a .html file in your shared directory to serve, so Apache's falling back to showing the index of the files there.
Upvotes: 5