Tomcat for GSAC Contributed to the GSAC project by Marco Portugal SEGAL, Space & Earth Geodetic Analysis Laboratory Universidade da Beira Interior, Departamento de Informática, Covilhã, Portugal. 27 Mar 2014 Here is the quickest way to put GSAC online with Tomcat: 1. Find an available Tomcat package to install $ sudo apt-cache search tomcat //... tomcat7 - Servlet and JSP engine tomcat7-admin - Servlet and JSP engine -- admin web applications tomcat7-common - Servlet and JSP engine -- common files tomcat7-docs - Servlet and JSP engine -- documentation tomcat7-examples - Servlet and JSP engine -- example web applications 2. Install the Tomcat packages : $ sudo apt-get install tomcat7-admin $ sudo apt-get install tomcat7 ..and its done. TOMCAT is installed. 3. How to START and STOP TOMCAT service? (Auto start script is created in /etc/init.d/) $ sudo /etc/init.d/tomcat7 start $ sudo /etc/init.d/tomcat7 stop $ sudo /etc/init.d/tomcat7 restart ----------------------------------------------------- bin folder is created in /usr/share/tomcat7. conf and logs folders are in /var/lib/tomcat7. $ ls -lsa /var/lib/tomcat7/ common conf -> /etc/tomcat7 logs -> ../../log/tomcat7 server shared webapps ../../cache/tomcat7 4. Testing GSAC? The "socket error" will happen when the user does a test of the local GSAC with the commadn "ant runserver". Why? Because TOMCAT is running too. You must stop Tomcat service before do "ant runserver". They use the same socket. $sudo /etc/init.d/tomcat7 stop 5. Deploy the Tomcat .war file for GSAC. A Tomcat .war file for GSAC. gsac*.war file is produced when you do ant, and you must create a directory (i.e. like gsacboulder) in: /var/lib/tomcat7/webapps/ localhost@boulder:/$mkdir gsacboulder The gsac*.war file produced is in gsac-code/dist/. It is copied to /var/lib/tomcat7/webapps/gsacboulder, like /var/lib/tomcat7/webapps/gsacboulder/gsacboulder.war localhost@boulder:/GSAC/gsac-code/dist/$sudo cp gsacboulder.war /var/lib/tomcat7/webapps/gsacboulder/ Then you have to unzip .war file: localhost@boulder: /var/lib/tomcat7/webapps/gsacboulder/$ sudo unzip gsacboulder.war This unzip will create two directories: META-INF and WEB-INF(they contain the essencial information to TomCat read). You can remove the war file after this step. (some Tomcat installations with HotDeploy may do the unzip automatically.) After this all, you must restart TOMCAT service: $sudo /etc/init.d/tomcat7 start (some Tomcat installations with HotDeploy need not be restarted.) Go to the webrowser, i.e, http://yourdomain.com/gsacboulder/ and its done! There is a graphical interface in Tomcat to deploy the war file. I personally don't like it, and we spent a lot of time there. The instructions above are perhaps the easiest way to run a Tomcat Server with GSAC. 6. To add an addtional new federated GSAC with gsacfederated.war, to your web site: The process is quite simple. First, we are going to stop tomcat's service: $sudo /etc/init.d/tomcat7 stop Then we got to the "main" folder of Tomcat and create our new "slash" directory in webapps dir: localhost@boulder: /var/lib/tomcat7/webapps/sudo mkdir gsacfederated (the directory must have the same name as the gsac .war file) After this, we must copy the war file to the directory created localhost@boulder: sudo cp gsacfederated.war /var/lib/tomcat7/webapps/gsacfederated/ And then unzip it: localhost@boulder: /var/lib/tomcat7/webapps/gsacfederated/$sudo unzip gsacfederated.war Let's see inside the directory: localhost@boulder: /var/lib/tomcat7/webapps/gsacfederated/$ls gsacfederated.war META-INF WEB-INF META-INF and WEB-INF is only what Tomcat needs to interpret the files (You can remove .war file: localhost@boulder: /var/lib/tomcat7/webapps/gsacfederated/$sudo rm gsacfederated.war) Let's restart Tomcat service: $sudo /etc/init.d/tomcat7 start And that's it! You can go to your http://yourdomain/gsacfederated/ to see if everything went well.