Getting Started on Vagrant - Provisioning Docs

37 views
Skip to first unread message

Mayank Badola

unread,
Mar 30, 2016, 2:15:14 PM3/30/16
to Vagrant
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

Alvaro Miranda Aguilera

unread,
Mar 30, 2016, 11:05:37 PM3/30/16
to vagra...@googlegroups.com
hello

on the vagrant file then you can do

mkdir -p /vagrant/html
echo 'hello' > /vagrant/html/index.html

rite?

Alvaro.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/6f83afa5-5f6c-4217-a790-9e140d3881f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mayank Badola

unread,
Mar 31, 2016, 11:31:20 AM3/31/16
to Vagrant
Yeah, that would work, but wouldn't it mean that i'd have to put all my code inside the /vagrant/html directory?

Alvaro Miranda Aguilera

unread,
Apr 1, 2016, 1:13:07 AM4/1/16
to vagra...@googlegroups.com
Hello,

The getting started is just a sample guide, from there if you think www/html is too much, and you will be using only html, sure you can update the mount point.

but usually you use www/html www/cgi-bin www/icons etc

Alvaro


Mayank Badola

unread,
Apr 2, 2016, 12:15:14 AM4/2/16
to Vagrant
Alright...

Thanks Alvaro
Reply all
Reply to author
Forward
0 new messages