INSTALL TOMCAT
In this tutorial we describe a simple way to install and configure tomcat in order to be able to run OWGIS or install a map server like Geoserver or ncWMS. Java JDK is needed.
First step, download Tomcat from this link, search for the file under the core section that ends with .tar.gz
Decompress the file, use the following command:
tar -xvf apache-tomcat-8...
Move the folder to your preferred location (this will become the system variable $CATALINA_HOME, for this tutorial we are going to be using /usr/local/tomcat), use the following command:
sudo mv ./apache-tomcat-8... /usr/local/tomcat
Start Tomcat from the terminal:
sh /usr/local/tomcat/bin/startup.sh
Test it. Open a browser and go to http://localhost:8080, you should see something like this:
Turn off Tomcat
sh /usr/local/tomcat/bin/shutdown.sh
Now you need to add a tomcat user, use the following command:
sudo vi /usr/local/tomcat/conf/tomcat-users.xml
Add to the file you just opened the tomcat manager user like this:
<user password="MYPSW" username="MYUSER" roles="manager-gui,manager-script,admin" />
Increase maximum size of war files:
sudo vi $TOMCAT/webapps/manager/WEB-INF/web.xml
Search the file for "max-files-size" and replace the tag with:
<max-file-size> 524288000 </ max-file-size> <max-request-size> 524288000 </ max-request-size>
Start Tomcat again
sh /usr/local/tomcat/bin/startup.sh
and try it at the following link with the user you created: http://localhost:8080/manager/html, you should see the Tomcat manager.
Now, in order to be able to use the streamlines functionality Tomcat should have to have CORS enabled. Tomcat includes support for CORS (starting from Tomcat version 7.0.41). To enable CORS support we have to use CORS Filter.
For now lets enable CORS for all webapps, so we need to add the filter into $CATALINA_HOME/conf/web.xml, the directory into which you have installed Tomcat. ( /usr/local/tomcat/ )
The minimal configuration required to use this filter is:
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern> /* </url-pattern>
</filter-mapping>
If changes were made while the Tomcat server was running, you should restart Tomcat.