Skip to content

Latest commit

 

History

History
109 lines (65 loc) · 4.41 KB

README.md

File metadata and controls

109 lines (65 loc) · 4.41 KB

SensioLabsInsight

SweetLakePHP

Our website at sweetlakephp.nl!

Want to get involved with this project? See our issues (bug/feature) page.

As a coding style guide, we use the PSR-2 standard.

Getting started

Requirements

Also: gather the following information

Installation

This is the Vagrant manual. We highly recommend using a virtual environment for development, but if you have a local webserver (or, you are subjected to cruel and unusual punishment and have to use Windows), you can find a more detailed description of the installation process:

Local webserver setup method.

Step 1: Create your config file

In the project 'app' folders you will find a folder named 'config'. You must add a file called:

  • parameters.yml

Simply copy the file parameters.yml.dist to parameters.yml. Edit the file and make and following changes:

  • Line 14: mailer_delivery_address, replace 'YOUR_EMAIL_ADDRESS_HERE' with your e-mail address.
  • Line 22: meetup_api_key, replace 'ADD_YOUR_MEETUP_API_KEY_HERE' with your API key.
  • Line 24-27: OPTIONAL add your twitter API key settings

Step 2: Vagrant up

This repository contains a Vagrantfile. This means that is uses Vagrant to automatically create a virtual machine on your system. Unfortunately, Ansible does not work that well with Vagrant on Windows, so don't even try unless you know what you're doing. Installing a local webserver is a lot less painful

Ansible Galaxy: In the root of the project, enter the command:

ansible-galaxy install -r ansible/ansible-galaxy.yml --force

Vagrant: In the root of the project, enter the command:

vagrant up

After the machine is created, Ansible is used to "provision" it. That just means all the necessary software is installed. It also takes care of the proper config files for the webserver.

Be patient, this process takes some time. Also, as part of the vagrant provisioning, a composer install is run. You do not have to run that manually.

The webserver is configured to listen to the hostname sweetlakephp.loc, so the url should be [http://sweetlakephp.loc]. You will need to add this line in your local hosts file (/etc/hosts on Linux and OS X, %SystemRoot%\system32\drivers\etc\hosts on Windows).

192.168.30.48  sweetlakephp.loc

At this time you should be able to browse to [http://sweetlakephp.loc]. Congratulations!

Go ahead and make some changes!

Deploy (only for those who have access to the production server)

> ansible-playbook -i ansible/hosts-production ansible/deploy.yml --limit prod-real --ask-vault-pass 

Troubleshooting

Q: I get an nginx error saying "bad gateway"

A: Are you sure you remembered to perform step 1? Add your meetup API key!

Q: I see a very blank page with some content, but no styles.

A: Something went wrong with the final steps of the composer install command. We have to add the assets to the web folder. That can be done with the following commands, but remember: this must be done inside the vagrant box!

vagrant ssh
> cd /vagrant
> php app/console assets:install web --symlink
> php app/console assetic:dump

Revisit your browser and see if the website is fully loaded.

Q: I get an error during the Vagrant up command, but the Vagrant is now running.

A: You can try to run the provisioning part separately, with:

vagrant provision