All notes
Tomca

Installation

Mac OS X

maltronic.io: easily install apache tomcat on Mac OS X.



brew install tomcat

# Homebrew keeps packages (known as kegs) in the Cellar, where you can check config and data files.
ls /usr/local/Cellar/
# Verify the Tomcat installation using homebrew’s handy “services” utility:
brew services list

brew services --help

catalina run
# Goto: http://localhost:8080/

# Modify username and password:
vim /usr/local/Cellar/tomcat/[version]/libexec/conf/tomcat-users.xml
# <user username="admin" password="password" roles="tomcat,manager-gui" />
# Now you can go to:
# http://localhost:8080/manager/html

# Deployed applications are usually then located under the directory:
/usr/local/Cellar/tomcat/[version]/libexec/webapps/

Deploy a web app

It is NOT recommended to place "Context" elements directly in the server.xml file. This is because it makes modifying the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat. apache.org: context parameters.

Context elements may be explicitly defined:

Concepts

juli, logging

tomcat.apache.org: logging.

Apache Tomcat has its own implementation of several key elements of "java.util.logging API" - "JULI".

Configuration

Usually done in the {catalina.base}/conf/logging.properties file. {catalina.base} may be: /usr/share/tomcat6.

catalina.out, localhost.*

stackOverflow: difference between localhost and catalina.

Find all detail in conf/logging.properties and conf/server.xml.

In short catalina is the container log file, localhost_access (only one defined in server.xml) the access log (= all requests like in httpd), localhost the log of the host and finally host-manager and manager the logs of the related web applications.

catalina

Catalina is Tomcat's servlet container. Catalina implements Sun Microsystems' specifications for servlet and JavaServer Pages (JSP).

coyote

Coyote is a Connector component for Tomcat that supports the HTTP 1.1 protocol as a web server.

Another Coyote Connector, Coyote JK, listens similarly but instead forwards its requests to another web server, such as Apache, using the JK protocol. This usually offers better performance.