Install the following applications:
- VirtualBox
- Windows: VirtualBox-5.1.6
- Fedora: Follow this guide.
- Vagrant
- Windows: Vagrant_1.8.6.msi
- Fedora:
dnf install vagrant
NOTE: The Vagrant installer should add
vagrant
to the system path so that is available in terminals. If it is not found, please try logging out and logging back in to your system (this is particularly necessary sometimes for Windows).
To verify that Vagrant is installed correctly, run the following in a terminal (command prompt):
vagrant --version
NOTE: You must be in the project directory when you run
vagrant
commands in order for Vagrant to recognize the development environment.
You can list the status of the current environment by running the following in a terminal:
vagrant status
If you haven't created the server already, you should see something like the output below:
Current machine states:
apache-server not created (virtualbox)
The environment has not yet been created. Run `vagrant up` to
create the environment. If a machine is not created, only the
default provider will be shown. So if a provider is not listed,
then the machine is not created for that environment.
NOTE: Setting up a Vagrant machine takes a little while so please be patient.
Lets start by creating the apache-server
machine by running the following:
vagrant up
After the machine is up, Vagrant should display a message like below.
==> apache-server: Apache server is up and running at http://localhost:8080.
You can now access the Apache web server by going to http://localhost:8080 where it will serve files from your local Documents/ directory.
NOTE: Vagrant machines are virtual machines and can use a bit of computer resources so you might want to stop or destroy it in between sessions.
If you want to stop, restart or destroy the server you can run one of the following commands:
# Stop the server
vagrant halt
# Restart the server
vagrant reload
# Destroy the server
vagrant destroy
Now, if you want to start or recreate the server again, simply run the following:
vagrant up