Skip to content

Local Environment Set up

Myeong Lee edited this page Jun 7, 2018 · 1 revision

Basic Requirements

For setting up the local environment for the web development, you need to install the followings:

  • Vagrant 2.x
  • VirtualBox 5.2.x
  • Ansible (only for Macs or Linux machines)

Clone the Repository

git clone [git_URL_of_this_repo]

Config File

The config file is not available from this repo. Copy html/survey/credentials-example.inc.php to html/survey/credentials.inc.php and fill out the credentials accordingly. Then, your web server can connect to MySQL and other services.

Vagrant Set-up

If you're using a Mac or Linux machine, Ansible scripts are automatically running and install all required packages and database. For the initial set up, go to vm/basic/ on the command line, and just run:

vagrant up

If your using a Windows machine, Ansible is not running. There is a Shell script file that installs required packages (vm/windows/install.sh), but it's not enough. Read through vm/windows/playbook.yml and install required packages manually inside the Vagrant machine, and migrate the database manually. In order to enter to the Vagrant machine's command line, type:

vagrant ssh

Then, you are in the Ubuntu command line, and start working. Note that /var/www/html in the Vagrant machine is synced to the html folder in the Git repository in your local machine.

Also, you might need to run Apache and MySQL manually:

sudo service apache2 start
sudo service mysqld start

Test the Local Website

Your local IP is specified in vm/basic/Vagrantfile. Open up the browser and type in the IP address from the file. If the website shows up, your local environment is set up.