Merge pull request #11650 from briancain/docs/clarify-provision-tutorial
Fixes #11594: Clarify provisioning guide
This commit is contained in:
commit
4caa1a8cce
@ -23,8 +23,25 @@ so that the guest machine can be repeatably created and ready-to-use.
|
|||||||
## Installing Apache
|
## Installing Apache
|
||||||
|
|
||||||
We will just setup [Apache](http://httpd.apache.org/) for our basic project,
|
We will just setup [Apache](http://httpd.apache.org/) for our basic project,
|
||||||
and we will do so using a shell script. Create the following shell script
|
and we will do so using a shell script. First, we need to add some html content
|
||||||
and save it as `bootstrap.sh` in the same directory as your Vagrantfile:
|
which will be served by the Apache webserver. This will act as our DocumentRoot
|
||||||
|
folder. 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
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h1>Getting started with Vagrant!</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
The script below will symlink our shared folder `/vagrant` so that apache serves
|
||||||
|
the `html` folder when accessing the root page locally. Now, create the
|
||||||
|
following shell script and save it as `bootstrap.sh` in the same directory as
|
||||||
|
your Vagrantfile:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@ -52,20 +69,6 @@ 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 setup the machine, with the `bootstrap.sh` file. The file path is relative
|
||||||
to the location of the project root (where the Vagrantfile is).
|
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
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<h1>Getting started with Vagrant!</h1>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Provision!
|
## Provision!
|
||||||
|
|
||||||
After everything is configured, just run `vagrant up` to create your
|
After everything is configured, just run `vagrant up` to create your
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user