Geoserver is required for Arches 5+ as the standard map tileserver was removed.
- Install tomcat
sudo apt update
sudo apt install tomcat9 tomcat9-admin
- Enable service and allow traffic
sudo systemctl enable tomcat9`
sudo ufw allow from any to any port 8080 proto tcp
- Test by visiting port 8080
http://localhost:8080
-
Download the latest WAR file and move it onto the server http://geoserver.org/release/stable/ WAR WeWeb Archive (war) for servlet containers.
-
Place the WAR file in /webapps directory in the tomcat service
/var/lib/tomcat9/webapps
-
Restart tomcat
sudo service tomcat9 rsetart
- Add to apache2 conf
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /geoserver "http://localhost:8080/geoserver"
ProxyPassReverse /geoserver "http://localhost:8080/geoserver"
-
Enable proxy
sudo a2enmod proxy
-
Enable http proxy
sudo a2enmod proxy_http
-
Enable rewrite
sudo a2enmod rewrite
-
Restart
sudo service apache2 restart
- Make sure the virtual host 443 also includes
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /geoserver "http://localhost:8080/geoserver"
ProxyPassReverse /geoserver "http://localhost:8080/geoserver"
- Comment out the ProxyPass information regarding GeoServer in the virual host 80
# ProxyRequests Off
# ProxyPreserveHost On
# ProxyPass /geoserver "http://localhost:8080/geoserver"
# ProxyPassReverse /geoserver "http://localhost:8080/geoserver"
- In the geoserver web.xml file (if installed normally this will be found in
/var/lib/tomcat9/webapps/geoserver/WEB-INF/web.xml
) add the following lines to the bottom:
<context-param>
<param-name>PROXY_BASE_URL</param-name>
<param-value>https://DOMAIN NAME/geoserver</param-value>
</context-param>
<context-param>
<param-name>GEOSERVER_CSRF_WHITELIST</param-name>
<param-value>DOMAIN NAME</param-value>
</context-param>