Vagrant Chef Instruction
Tasklist about how to install and configures a complete UNREDD NFMS portal using a vagrant box and the chef deployment process
Platform:
- Ubuntu
The following Opscode cookbooks:
- apache2
- apt
- ark
- build-essential
- database
- java
- logrotate
- postgresql
The following cookbooks:
- tomcat cookbook by Bryan Berry (https://github.com/bryanwb/chef-tomcat)
- gis cookbook by Mario Rodas (https://github.com/marsam/cookbook-gis)
-
Install vagrant (see http://vagrantup.com/v1/docs/getting-started/index.html)
-
Download this repository with submodules:
git clone --recursive https://github.com/nfms4redd/chef-nfms-portal.git
-
Run Vagrant:
cd chef-nfms-portal/vagrant vagrant up
Currently 3GB RAM is allocated for the virtual machine. It can be customized changing the config.vm.customize argument in Vagrantfile
:
config.vm.customize ["modifyvm", :id, "--memory", 3072])
Host name is set to unredd
through the following line in Vagrantfile
config.vm.host_name = "unredd"
Currently only port 80 in the VM is forwarded to port 4567 on the host OS.
config.vm.forward_port 80, 4567
in Vagrantfile
Two shared folders are created:
Dir | Mount point |
---|---|
cache | /var/vagrant-cache/ |
shared | ~/shared |
The cache
shared directory is also set as the chef.provisioning_path
, so that the chef files are not cancelled when rebooting or after destroying the vm.
Three users are created on the Vagrant virtual machine:
vagrant
tomcat6
postgres
Apache 2 is installed through the Opscode apache2 cookbook.
Service name: apache2
The configuration file is /etc/apache2/apache2.conf
.
Custom proxy configuration (ajp protocol) is done in /etc/apache2/sites-enabled/tomcat_proxy.conf -> `/etc/apache2/sites-available/tomcat_proxy.conf
.
The only other custom configuration is done through /etc/apache2/mods-enabled/proxy.conf
Oracle jdk1.6.0_37 is installed using the Opscode java cookbook.
Version: 6.0.36
Tomcat is installed with the CATALINA_BASE
method to have multiple instances sharing the same Tomcat installation files.
CATALINA_HOME=/var/tomcat/default
. default
is a symbolic link to the current Tomcat binary.
Version: 9.1
Configuration files are in /etc/postgresql/9.1/main
postgres
user password is postgres
Databases | Owner | Owner password |
---|---|---|
stg_geoserver | stg_geoserver | admin |
diss_geoserver | diss_geoserver | admin |
stg_geostore | stg_geostore | admin |
diss_geostore | diss_geostore | admin |
Installed through the package manager by the gis cookbook. Currently version 2.0.1
is installed.
Installed through the package manager by the gis cookbook. Currently version 1.9.2
is installed.
The following web applications are installed:
Webapp | URL on the host OS | User | Password |
---|---|---|---|
Staging GeoServer | http://localhost:4567/stg_geoserver | admin | Unr3dd |
Dissemination GeoServer | http://localhost:4567/diss_geoserver | admin | Unr3dd |
Staging GeoStore | http://localhost:4567/stg_geostore | admin | Unr3dd |
Dissemination GeoStore | http://localhost:4567/diss_geostore | admin | Unr3dd |
GeoBatch | http://localhost:4567/stg_geobatch | admin | admin |
Portal administration | http://localhost:4567/admin | admin | Unr3dd |
Monitoring Portal | http://localhost:4567/portal | admin | Unr3dd |
- Webapp directory:
/var/tomcat/stg_geoserver/webapps/stg_geoserver
- User:
admin
- Password:
Unr3dd
- Tomcat http port:
8201
- Tomcat ajp port:
8101
- database:
stg_geoserver
- data directory:
/var/stg_geoserver/data
- log file:
/var/stg_geoserver/logs/geoserver.log
- Webapp directory:
/var/tomcat/diss_geoserver/webapps/diss_geoserver
- User:
admin
- Password:
Unr3dd
- Tomcat http port:
8205
- Tomcat ajp port:
8105
- database:
diss_geoserver
- data directory:
/var/diss_geoserver/data
- log file:
/var/diss_geoserver/diss_geoserver/geoserver.log
- Webapp directory:
/var/tomcat/stg_geostore/webapps/stg_geostore
- User:
admin
- Password:
Unr3dd
- Tomcat
http port: 8200
- Tomcat ajp port:
8100
- database:
stg_geostore
- log file:
/var/tomcat/stg_geostore/logs/catalina.out
- Webapp directory:
/var/tomcat/diss_geostore/webapps/diss_geostore
- User: ``admin
- Password:
Unr3dd
- Tomcat http port:
8204
- Tomcat ajp port:
8104
- database:
diss_geostore
- log file:
/var/tomcat/diss_geostore/logs/catalina.out
- Webapp directory:
/var/tomcat/stg_geobatch/webapps/stg_geobatch
- User:
admin
- Password:
admin
- Tomcat http port:
8202
- Tomcat ajp port:
8102
- Configuration directory:
/var/stg_geobatch/config
- Input directory:
/var/stg_geobatch
- Temp directory:
/var/stg_geobatch/temp
- Webapp directory:
/var/tomcat/stg_geoserver/webapps/admin
- User:
admin
- Password:
Unr3dd
- Tomcat http port:
8201
- Tomcat ajp port:
8101
- Webapp directory:
/var/tomcat/diss_geoserver/webapps/portal
- Tomcat http port:
8205
- Tomcat ajp port:
8105
- Configuration directory:
/var/portal
DRC demo data is in /var/tmp/drc
The unredd-nfms-portal::install_test_data recipe sets up stg_geoserver, stg_geostore, and stg_geobath data for testing:
- the files
area.tif
andprovinces.tif
are copied in/var/stg_geoserver/extdata/forest_mask_mosaic
;
To setup stg_geostore for the demo data, type
curl -u admin:Unr3dd -XPUT -H "Content-type: text/xml" -d @/var/tmp/unredd_geostore_backup.xml http://localhost/stg_geostore/rest/backup/quick/
on the terminal
- Tomcat webapps are deployed in the webapps directory every time chef runs - check if the webapp version is new and deploy only in that case
- add apache proxy directives from definitions (
geobatch.rb
,geoserver.rb
, andgeostore.rb
) - dynamically set schema in geobatch config (now set to public)
- hard coded stuff in geobatch flow config files
GeoStore users are initialized to:
user | role | pwd |
---|---|---|
node['unredd-nfms-portal']['stg_geostore']['web_admin_user'] | ADMIN | node['unredd-nfms-portal']['stg_geostore']['web_admin_password'] |
user | USER | node['unredd-nfms-portal']['stg_geostore']['web_admin_password'] |
Please note that the user user
has the same password as the admin
user