From 8130314741b7261cabdc8ea6cdef0f219cbda1aa Mon Sep 17 00:00:00 2001 From: Slav Donchev Date: Mon, 28 Oct 2019 13:25:45 +0200 Subject: [PATCH 1/2] example provision script copies default web site --- website/source/intro/getting-started/provisioning.html.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/website/source/intro/getting-started/provisioning.html.md b/website/source/intro/getting-started/provisioning.html.md index c0d1ff4c0..72db1fb2e 100644 --- a/website/source/intro/getting-started/provisioning.html.md +++ b/website/source/intro/getting-started/provisioning.html.md @@ -32,6 +32,7 @@ and save it as `bootstrap.sh` in the same directory as your Vagrantfile: apt-get update apt-get install -y apache2 if ! [ -L /var/www ]; then + [ -d /var/www/html ] && cp -r /var/www/html /vagrant/html rm -rf /var/www ln -fs /vagrant /var/www fi @@ -75,7 +76,9 @@ vagrant@bionic64:~$ wget -qO- 127.0.0.1 This works because in the shell script above we installed Apache and setup the default `DocumentRoot` of Apache to point to our `/vagrant` -directory, which is the default synced folder setup by Vagrant. +directory, which is the default synced folder setup by Vagrant. We also copied +the default Apache web site to the `/vagrant/html` folder so that the web server will +have content to serve. You can play around some more by creating some more files and viewing them from the terminal, but in the next step we will cover networking From 42482849eca8bf6448cad326f274c74766c67d6a Mon Sep 17 00:00:00 2001 From: Slav Donchev Date: Thu, 31 Oct 2019 09:14:32 +0200 Subject: [PATCH 2/2] add example html for the user to create --- .../getting-started/provisioning.html.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/website/source/intro/getting-started/provisioning.html.md b/website/source/intro/getting-started/provisioning.html.md index 72db1fb2e..476175121 100644 --- a/website/source/intro/getting-started/provisioning.html.md +++ b/website/source/intro/getting-started/provisioning.html.md @@ -32,7 +32,6 @@ and save it as `bootstrap.sh` in the same directory as your Vagrantfile: apt-get update apt-get install -y apache2 if ! [ -L /var/www ]; then - [ -d /var/www/html ] && cp -r /var/www/html /vagrant/html rm -rf /var/www ln -fs /vagrant /var/www fi @@ -53,6 +52,20 @@ The "provision" line is new, and tells Vagrant to use the `shell` provisioner to setup the machine, with the `bootstrap.sh` file. The file path is relative to the location of the project root (where the Vagrantfile is). +We also need to add some html content which will be served by the Apache webserver. +To do this create a subdirectory named `html` in the project root directory. +In the `html` directory create a html file named `index.html`. +For example: + +```html + + + +

Getting started with Vagrant!

+ + +``` + ## Provision! After everything is configured, just run `vagrant up` to create your @@ -76,9 +89,7 @@ vagrant@bionic64:~$ wget -qO- 127.0.0.1 This works because in the shell script above we installed Apache and setup the default `DocumentRoot` of Apache to point to our `/vagrant` -directory, which is the default synced folder setup by Vagrant. We also copied -the default Apache web site to the `/vagrant/html` folder so that the web server will -have content to serve. +directory, which is the default synced folder setup by Vagrant. You can play around some more by creating some more files and viewing them from the terminal, but in the next step we will cover networking