A Vagrant configuration for State Decoded, to make it easy to get started.
Installing Vagrant is very simple—simply follow the instructions.
You can find an installer for git here
- From the command line run
git clone https://github.com/statedecoded/statedecoded-vagrant
- cd into the statedecoded-vagrant directory
- Download the git submodules using:
git submodule update --init
- Run the command
vagrant up
(This can take roughly 10 minutes or slightly longer if this is the first time)
We are using puppet to provision our virtural machine. If you run into problems at this stage please open a bug on github. Once puppet has finished running several things have happened:
- The virtual machine exists on a private network, reachable at 192.168.42.33
- An apache server is running with its doc root at /var/www/statedecoded/htdocs
- A solr server is running with its home set to /var/www/statedecoded/solr_home
- A mysql server is running with a username and password specified at the top of manifests/default.pp (the root mysql password can be found at
~/root-mysql/.my.cnf
- PHP and all of its dependencies have been installed
- A copy of the statedecoded source code has been placed at /var/www/statedecoded
At this point you are extremely close to having a running instance of the statedecoded. What you need to do is finish the configuration/setup of the statedecoded itself. Refer to the manual for the for the whole picture of what happened. Anyway, you still need to download some laws in XML to import and then run the law import. Before doing this you should test your enviroment by going to http://192.168.42.33/admin/ and running the tests. Make sure everything passses, if you can't figure out how to get a test to pass just ask somebody. Once that is all done you should be able to run the parser also at http://192.168.42.33/admin/ that imports the laws into mysql and solr.
If the puppet install is causing more problems than it is worth try the manual installation. Create a new vagrant box and follow the docs!
-
On your host machine the virtual machine is reachable at 192.168.42.33
-
Meaning the statedecoded admin interface lives at http://192.168.42.33/admin
-
If you want to run puppet from within the vagrant machine run this concise command:
puppet apply --verbose --modulepath
'/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' --manifestdir
/tmp/vagrant-puppet/manifests --detailed-exitcodes
/tmp/vagrant-puppet/manifests/default.pp
-
Solr's admin interface is reachable at: http://192.168.42.33:8983/solr/#
-
You can run solr as a foreground process to see if it is having problems on startup/running with (assuming you did the puppet install):
/usr/bin/java -Dsolr.solr.home=/var/www/statedecoded/solr_home -Djetty.home=/opt/solr/example -Djava.io.tmpdir=/tmp -jar /opt/solr/example/start.jar
-
The php error log's generated by the statedecoded live in
/var/log/apache2/
-
Remember that patience is a virtue :)