|   | 1 | Deploy on tomcat6 and mysql | 
                  
                          |   | 2 |  | 
                  
                          |   | 3 | ##################################### | 
                  
                          |   | 4 | # SOP: Installation of tomcat6 + mysql app (any gcc member) | 
                  
                          |   | 5 | ##################################### | 
                  
                          |   | 6 |  | 
                  
                          |   | 7 | # Change lines below to match your app and environment | 
                  
                          |   | 8 | app=animaldb | 
                  
                          |   | 9 | # On CentOS VM: | 
                  
                          |   | 10 | export CATALINA_HOME=/usr/share/tomcat6/ | 
                  
                          |   | 11 | # on SuSE VM: | 
                  
                          |   | 12 | export CATALINA_HOME=/srv/tomcat6/ | 
                  
                          |   | 13 |  | 
                  
                          |   | 14 | # Become molgenis user | 
                  
                          |   | 15 | sudo su - molgenis | 
                  
                          |   | 16 | cd /srv/molgenis | 
                  
                          |   | 17 |  | 
                  
                          |   | 18 | # If /srv/molgenis doesn't exist, ask 'root' user to run installation SOP | 
                  
                          |   | 19 |  | 
                  
                          |   | 20 | # Checkout | 
                  
                          |   | 21 | mkdir $app | 
                  
                          |   | 22 | cd $app | 
                  
                          |   | 23 | git clone https://github.com/molgenis/molgenis.git | 
                  
                          |   | 24 | git clone https://github.com/molgenis/molgenis_apps.git | 
                  
                          |   | 25 | cd molgenis_apps | 
                  
                          |   | 26 |  | 
                  
                          |   | 27 | # Optionally: check and make sure both Tomcat and MySQL are running | 
                  
                          |   | 28 | sudo service tomcat6 status | 
                  
                          |   | 29 | sudo service mysqld status | 
                  
                          |   | 30 |  | 
                  
                          |   | 31 | # Create mysql | 
                  
                          |   | 32 | mysql -u molgenis -pmolgenis -e "create database $app";  | 
                  
                          |   | 33 |  | 
                  
                          |   | 34 | # Generate war | 
                  
                          |   | 35 | ant -f build_$app.xml clean-generate-compile-war | 
                  
                          |   | 36 |  | 
                  
                          |   | 37 | # Delete previous war, if updating. | 
                  
                          |   | 38 | rm ${CATALINA_HOME}/webapps/$app.war | 
                  
                          |   | 39 |  | 
                  
                          |   | 40 | # Copy new war (tomcat will automatically reload the app) | 
                  
                          |   | 41 | newgrp tomcat; cp dist/war/$app.war ${CATALINA_HOME}/webapps/$app.war; exit |