Difference between revisions of "Tomcat 5"
From Briki
Line 1: | Line 1: | ||
+ | == Webapp Locations == | ||
+ | |||
+ | * '''/var/lib/tomcat5/webapps/''' - user webapps, plus ROOT, examples, docs etc. | ||
+ | * '''/var/lib/tomcat5/server/webapps/''' - builtin admin and manager webapps | ||
+ | |||
== Changing tomcat user == | == Changing tomcat user == | ||
* Set '''TOMCAT_USER''' in /etc/tomcat5/tomcat5.conf | * Set '''TOMCAT_USER''' in /etc/tomcat5/tomcat5.conf | ||
Line 46: | Line 51: | ||
# '''chown tomcat:tomcat /usr/share/tomcat5/work/''' (trailing slash is important) | # '''chown tomcat:tomcat /usr/share/tomcat5/work/''' (trailing slash is important) | ||
# Restart tomcat | # Restart tomcat | ||
+ | |||
+ | |||
+ | == ''No Host matches server name'' error == | ||
+ | |||
+ | * Ensure '''/var/lib/tomcat5/webapps/ROOT''' is present - if not (and you're on Mandriva), you probably forgot to install the tomcat5-webapps and tomcat5-admin-webapps packages. |
Revision as of 08:19, 24 April 2006
Contents
Webapp Locations
- /var/lib/tomcat5/webapps/ - user webapps, plus ROOT, examples, docs etc.
- /var/lib/tomcat5/server/webapps/ - builtin admin and manager webapps
Changing tomcat user
- Set TOMCAT_USER in /etc/tomcat5/tomcat5.conf
- See Fixing tomcat-users.xml.new error below
- chown tomcat:tomcat /usr/share/tomcat5/conf/jk2.properties
- chown tomcat:tomcat /usr/share/tomcat5/work/
Tidying up /etc/init.d/tomcat5 output
- In /etc/init.d/tomcat5
- Remove if statement around . /etc/init.d/rc.d/functions
- Change echo "waiting for processes to exit" to echo -n "."
- Add success after start and stop commands
- In /usr/bin/dtomcat5
- Comment out Using... lines
- In /usr/share/tomcat5/bin/relink
- Reorder find arguments to put -type d after mindepth and maxdepth arguments
Fixing tomcat-users.xml.new error
Error is javax.naming.NamingException: /usr/share/tomcat5/conf/tomcat-users.xml.new (Permission denied)
- chown tomcat:tomcat /etc/tomcat5 (NB. /usr/share/tomcat5/conf is a symlink to /etc/tomcat5)
Changing to use log4j logging
- Ensure log4j.jar and commons-logging.jar (or symlinks to them) are present is /usr/share/tomcat5/common/lib
- Create file /usr/share/tomcat5/common/classes/log4j.properties with contents:
log4j.rootLogger=INFO, FileAppender log4j.appender.FileAppender=org.apache.log4j.RollingFileAppender log4j.appender.FileAppender.File=/var/log/tomcat5/tomcat.log log4j.appender.FileAppender.layout=org.apache.log4j.PatternLayout # Print the date in ISO 8601 format log4j.appender.FileAppender.layout.ConversionPattern=%d [%t] %-5p %c - %m%n log4j.appender.FileAppender.MaxFileSize=1MB log4j.appender.FileAppender.MaxBackupIndex=4 #log4j.logger.org.apache=DEBUG
- Comment out Logger section in /usr/share/tomcat5/conf/server.xml
- Create empty file /var/log/tomcat5/tomcat.log (tomcat complains without this, for some reason)
org.apache.jasper.JasperException: Unable to compile class for JSP
- chown tomcat:tomcat /usr/share/tomcat5/work/ (trailing slash is important)
- Restart tomcat
No Host matches server name error
- Ensure /var/lib/tomcat5/webapps/ROOT is present - if not (and you're on Mandriva), you probably forgot to install the tomcat5-webapps and tomcat5-admin-webapps packages.