Tomcat - HVboom/HowTo-DigitalOcean GitHub Wiki
Description
Apache Tomcat is a web server written in 100% Pure Java.
Apache Tomcat version 8.0 implements the Servlet 3.1, JavaServer Pages 2.3, Java Unified Expression Language 3.0 and Java WebSocket 1.0 specifications from the Java Community Process, and includes many additional features that make it a useful platform for developing and deploying web applications and web services. Tomcat 8 is aligned with Java EE 7.
:speech_balloon: copied from package description
Setup Tomcat
-
Install the Tomcat package:
sudo pkg install tomcat8 ... Message from openjdk8-8.60.24: ====================================================================== This OpenJDK implementation requires fdescfs(5) mounted on /dev/fd and procfs(5) mounted on /proc. If you have not done it yet, please do the following: mount -t fdescfs fdesc /dev/fd mount -t procfs proc /proc To make it permanent, you need the following lines in /etc/fstab: fdesc /dev/fd fdescfs rw 0 0 proc /proc procfs rw 0 0 ====================================================================== ... sudo sysrc tomcat8_enable=yes sudo service tomcat8 start
-
Change firewall settings to allow access to port 8080 - /etc/rc.conf:
sudo vi /etc/rc.conf # 8080: default port for Tomcat firewall_myservices="ssh http https sftp 8080" sudo service ipfw restart
-
Visit Tomcat
-
-
Secure access to administration functions - /usr/local/apache-tomcat-8.0/conf/tomcat-users.xml:
... <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <role rolename="admin-gui"/> <role rolename="admin-script"/> <user username="admin" password=<secure password> roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script" /> ...