Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#21268 - [tomcat] access log
Attached to Project:
Arch Linux
Opened by Viczai Gabor (gviczai) - Friday, 15 October 2010, 08:48 GMT
Last edited by Allan McRae (Allan) - Saturday, 28 April 2012, 15:51 GMT
Opened by Viczai Gabor (gviczai) - Friday, 15 October 2010, 08:48 GMT
Last edited by Allan McRae (Allan) - Saturday, 28 April 2012, 15:51 GMT
|
DetailsDescription:
- After turning on the logging in $CATALINA_HOME/conf/server.xml by uncommenting the appropiate "valve" section, nothing happens. No error logs in catalina.log either. This is because the logs directory has the ownership root:root with flags rwxr-xr-x and Catalina runs as the tomcat user, thus the process has no write permission on the directory. Additional info: * package version(s) * config and/or log files etc. - Tomcat 5.5.31 Steps to reproduce: - See description. Workaround/resolution: - Either set the log directory in the "valve" section to a writable one, or change the ownership of the default logs dir to root:tomcat and the permissions to rwxrwxr-w. |
This task depends upon
Which log are we talking of?
- catalina.log?
This one is set in /etc/rc.d/tomcat to /opt/tomcat/logs/catalina.log. Feel free to change it on your box to any other place you like, but here out of the box, tomcat manages to write in it.
- localhost_access_log.$(date).txt ?
This one is set using valve org.apache.catalina.valves.AccessLogValve in server.xml. As you said it needs to be set to a directory on which tomcat has write access. Are you suggesting to chgroup tomcat /opt/tomcat/logs by default so that if user enables access log but keeps the default directory then it would work out of the box?
This one is set using valve org.apache.catalina.valves.AccessLogValve in server.xml. As you said it needs to be set to a directory on which tomcat has write access. Are you suggesting to chgroup tomcat /opt/tomcat/logs by default so that if user enables access log but keeps the default directory then it would work out of the box?"
Exactly. I spent hours googling till I found the problem. The Tomcat documentation says: simply uncomment the valve and it will work. Every article, blog, etc. on the net says the same. I've done that. Nothing. Not even an error log about what is the problem.
If the document says "simply uncomment the valve and it will work", let it be.
Sounds fair! I will do so on the next release. Thanks.
Given that a tomcat user and group is created, I don't see any
issues starting tomcat as its own user. So I modified the rc script,
and assigned tomcat base (/opt/tomcat) to its user and group.
It seems to resolve the permission issues, and runs tomcat
supposedly more secure. I attach the rc script to the comment.
jsvc as is suitable.
That's the point of the "-user" option of jsvc we already use.
"-user which causes it to switch to another user after the daemon initialization is complete. This allows, for example, running Tomcat as a non privileged user while still being able to use privileged ports. jsvc --help will return the full jsvc usage information"
http://tomcat.apache.org/tomcat-5.5-doc/setup.html#Unix_daemon
Repository : extra
Name : tomcat
Version : 5.5.34-1
Assuming fixed...