Template project with vagrant and nodeJS.
- Clone the directory.
- Install Vagrant, if necessary. See detailed guide for more information.
- Install project Vagrant recommanded plugins, if necessary. See detailed guide for more information.
- (optional) Modify files for your needs. See important files for more information.
- Start vagrant.
The project should use the following URL by default:
http://nodejs.local
or the following IP:
http://192.168.42.42
Bash script used by Vagrant to modify the VM. Variables can be changed for your needs.
Warning: changing project or top domain names will modify project URL.
Template Node JS web application. Make sure the domain name is the same as the one used by the project.
Vagrant box configuration file. Make sure to remove unused plugins. Demain name and IP should be the same as the ones used by the project.
Install the lastest version of Vagrant.
Be sure to install a VM supervisor such as VirtualBox.
If any of those plugins are not used, make sure to modify the Vagrantfile accordically. All commands below should be used in the project root directory.
Automatically modify host files. See its GitHub page for more info.
vagrant plugin install vagrant-hostmanager
All commands below should be used in the project root directory.
To start vagrant:
vagrant up
A virtual machine hosting the web application will be created. Vagrant will ask for admin rights, in order to modify the local host file.
The vagrant box (VM) can be deleted with the following command:
vagrant destroy
The vagrfant box can be stopped with the following command:
vagrant halt
For any other information related to Vagrant, please look at its documentation.
This site can’t be reached
(chrome), Hmm. We’re having trouble finding that site.
(firefox) and equivalent
Make sure your local host file has the right IP and the right domain name, and they're not commented. It seems vagrant-hostmanager sometime does not modify this file correctly.
Make sure nginx is running correctly, and the server blocks are okay. Use sudo ngnix -t
to check configuration files.
Make sure the Node JS server is running correctly.