I'm quite new to Vagrant (like started 2 hours ago), hence i decided to follow the docs at
https://www.vagrantup.com/docs/getting-started/I ran into trouble when i ran the provisioning script given in the docs -
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
if ! [ -L /var/www ]; then
rm -rf /var/www
ln -fs /vagrant /var/www
fi
The conditional statement is supposed to change the DocumentRoot of Apache to our /vagrant directory.
But isn't the DocumentRoot of Apache /var/www/html?
I decided to follow the docs nevertheless but upon requesting for
the index.html page I created inside my project directory(/vagrant inside vm) i got a 404 response.
But on changing to the provisioning script to -
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
if ! [ -L /var/www/html ]; then
rm -rf /var/www/html
ln -fs /vagrant /var/www/html
fi
I was able to GET index.html.
Please let me know what might have gone wrong or if the docs need an update. I'll be very eager to make a PR.
Thanks