no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


tomcat [2017/09/29 05:49] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Apache Tomcat ======
  
 +  * [[http://mirrors.gigenet.com/apache/tomcat/tomcat-9/|Tomcat 9 downloads]]
 +
 +** Environment Variables **
 +
 +  * ''CATALINA_HOME'' - location of Tomcat core installation, fex ''/usr/local/tomcat''
 +  * ''JRE_HOME'' - location of the Java Runtime Environemnt (JRE)
 +  * ''JAVA_HOME'' - location of the Java Development Kit (JDK)
 +
 +You can override variables for in ''/bin/setenv.sh'' The ''CATALINA_HOME'' and ''CATALINA_BASE'' variables cannot be changed here since they are used to find the program.
 +
 +Add ''CATALINA_PID'' for example to set the location of the pid file, such as ''/var/run/catalina.pid''
 +
 +** Starting / stopping **
 +
 +Two options:
 +
 +<code>
 +/bin/startup.sh
 +/bin/shutdown.sh
 +</code>
 +
 +<code>
 +/bin/catalina.sh start
 +/bin/catalina.sh stop
 +</code>
 +
 +** Libraries **
 +
 +JAR files and external libraries can go in ''/lib'', such as JDBC drivers.
 +
 +** Sites **
 +
 +Sites are installed in ''/webapps'' directory manually, or they can be installed through management interface running on the server available at ''/manager'' URL.
 +
 +==== Ubuntu 16.04 ===
 +
 +Install OpenJDK 8:
 +
 +<code>
 +apt-get -y install default-jre default-jre-headless
 +</code>
 +
 +Install Tomcat 8:
 +
 +<code>
 +apt-get -y install tomcat8
 +</code>
 +
 +Tomcat by default listens on port 8080. To listen on port 80, two things need to change.
 +
 +First, edit ''/etc/default/tomcat8'' and set ''AUTHBIND'' to ''yes''.
 +
 +Second, update ''/etc/tomcat8/server.xml'' and change ''Connector port'' to 80. Then restart Tomcat.
 +
 +Your Ubuntu install may or may not have authbind already installed, so add that package as well if needed:
 +
 +<code>
 +apt-get -y install authbind
 +</code>
 +
 +== Admin Interface ==
 +
 +The default homepage for the ''ROOT'' webapp comes with instructions on how to install the documentation, examples, and admin interfaces.
 +
 +<code>
 +apt-get -y install tomcat8-docs tomcat8-examples tomcat8-admin
 +</code>
 +
 +For accessing the manager and host-manager webapps, you will need to add users in ''/etc/tomcat/tomcat-users.xml''. Here's an example that has user ''tomcat'' with password ''tomcat'', who can manage both apps:
 +
 +<code>
 +<role rolename="admin-gui"/>
 +<role rolename="manager-gui"/>
 +<user username="tomcat" password="tomcat" roles="admin-gui,manager-gui"/>
 +</code>
 +
 +Once the users are added, restart Tomcat as normal:
 +
 +<code>
 +/etc/init.d/tomcat restart
 +</code>

Navigation
QR Code
QR Code tomcat (generated for current page)