You can set up valves to handle log files. You need to create your log
directory and such, then add it into your host context in the server.xml.

First... for logging, you have to uncomment/add in the Valve in the main
host section as such:
<Host>
  <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false" /> 
</host>


In my server.xml I have 5 different webapps as they all run on different IPs
(for security reasons). Here is a sample of a host setup so Tomcat can find
my webapp:

<Host name="www.mysite.com" appBase="/home/sites/www.mysite.com/webapps"
unpackWARs="true" autoDeploy="true" xmlValidation="false"
xmlNamespaceAware="false">
  <Alias>safetysystemshawaii.com</Alias> 
  <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/home/sites/www.mysite.com/logs"
prefix="www.mysite.com_access_log." suffix=".txt" pattern="common"
resolveHosts="false" /> 
</Host>

then I have my Context seperate (/Catalina/ipnumber/) with the following:
<Context path="/appname" docBase="dirofappname" relodable="false"
privileged="false">
  <Resource auth="Container" name="mail/Session" type="javax.mail.Session"
/> 
  <Resource name="jdbc/appname" auth="Container" scope="Shareable"
type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="500"
removeAbondoned="true" username="test" password="test"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/dbname?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"
/> 
  </Context>

All of my apps are set up this way. They all work wonderfully.

You may not have to get as indepth. 

The server.xml is a global file telling Tomcat where what is. Since I have
multiple webapp directories I have to state each one in the server.xml then
create a context in Catalina which helps to manage all of them. I also have
seperate instances of the TomcatManager for each IP/webapp so I do not have
to reboot Tomcat overall if I make a change to only one webapp.

Hope this helps you... 

~LZ~
--
View this message in context: 
http://www.nabble.com/More+%28Unending%29+%22Resource+Not+Found%22-+Directory++Problems-t1681606.html#a4566488
Sent from the Tomcat - User forum at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to