You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Lemke, Michael IZ/HZA-IE5" <le...@de.ina.com> on 2003/10/01 10:07:36 UTC

RE: Tomcat 3.3.1: AccessLogInterceptor doesn't log PUT requests

Almost.  TOMCAT_HOME/lib/container did the trick.

Thanks again,
Michael


> -----Original Message-----
> From: Larry Isaacs [mailto:Larry.Isaacs@sas.com] 
> Sent: Tuesday, September 30, 2003 9:23 PM
> To: Tomcat Users List
> Subject: RE: Tomcat 3.3.1: AccessLogInterceptor doesn't log 
> PUT requests
> 
> 
> To deploy the class file, I believe you can create a
> "classes" directory under TOMCAT_HOME/lib/server and put
> your class in a package appropriate directory under there.
> With your modifications to the modules.xml and server.xml,
> it should work.
> 
> Larry
> 
> > -----Original Message-----
> > From: Lemke, Michael IZ/HZA-IE5 [mailto:lemkemch@de.ina.com] 
> > Sent: Tuesday, September 30, 2003 11:35 AM
> > To: 'Tomcat Users List'
> > Subject: RE: Tomcat 3.3.1: AccessLogInterceptor doesn't log 
> > PUT requests
> > 
> > 
> > Thanks, Larry.  Not knowing any Java I managed to write (or 
> > rather copy) something for postRequest.  Seems to work fine.  
> > Now my question is, is it possible to compile that module so 
> > I get a single .class file that I can copy somewhere in the 
> > official binary tree?  What works for me is have the .java in 
> > share/org/apache/tomcat/modules/loggers, add org... to 
> > modules.xml and server.xml and have ant make new jar files.  
> > I couldn't find anything in the docs in that regard that I 
> > could understand.
> > 
> > Thanks,
> > Michael
> > 
> > > -----Original Message-----
> > > From: Larry Isaacs
> > > Sent: Monday, September 29, 2003 7:32 PM
> > > To: Tomcat Users List
> > > Subject: RE: Tomcat 3.3.1: AccessLogInterceptor doesn't log 
> > > PUT requests
> > > 
> > > 
> > > You could implement your own interceptor and use one of the 
> > hooks more 
> > > suitable than beforeCommit(), perhaps postReadRequest(), 
> > contextMap(), 
> > > or postRequest().
> > > 
> > > I don't know if there is an existing interceptor that with 
> > the right 
> > > debug level would give you want you want without giving you 
> > too much 
> > > log output.
> > > 
> > > Larry
> > > 
> > > > -----Original Message-----
> > > > From: Lemke, Michael IZ/HZA-IE5
> > > > Sent: Monday, September 29, 2003 6:40 AM
> > > > To: 'Tomcat Users List'
> > > > Subject: RE: Tomcat 3.3.1: AccessLogInterceptor doesn't log 
> > > > PUT requests
> > > > 
> > > > 
> > > > A long time ago I sent the attached message.  There was no
> > > > solution to the problem.  It has just come up again and I am 
> > > > wondering what 
> > > > options there are to get *everything* logged.  Would a 
> > > > combination with Apache solve this?  We need to somehow be 
> > > > able to proove that we have or have not received a 
> > certain request.
> > > > 
> > > > Thanks,
> > > > Michael
> > > > 
> > > > 
> > > > > -----Original Message-----
> > > > > From: Larry Isaacs
> > > > > Sent: Tuesday, July 02, 2002 2:10 PM
> > > > > To: 'Tomcat Users List'
> > > > > Subject: RE: Tomcat 3.3.1: AccessLogInterceptor doesn't log
> > > > > PUT requests
> > > > > 
> > > > > 
> > > > > AcessLogInterceptor writes the log entry using the
> > > > > beforeCommit() hook.  If no response is generated by
> > > > > the request, then it appears that no log entry would 
> be created.
> > > > > 
> > > > > Cheers,
> > > > > Larry
> > > > > 
> > > > > > -----Original Message-----
> > > > > > From: Lemke, Michael IZ/HZA-IC1
> > > > > > Sent: Tuesday, July 02, 2002 4:10 AM
> > > > > > To: 'Tomcat Users List'
> > > > > > Subject: Tomcat 3.3.1: AccessLogInterceptor doesn't log
> > > > PUT requests
> > > > > > 
> > > > > > 
> > > > > > We are running Tomcat 3.3.1 in standalone mode (no 
> > Apache etc) 
> > > > > > and log requestes to AccessLog with 
> > AccessLogInterceptor. Unless 
> > > > > > we misconfigured something it seems like PUT requests 
> > only show 
> > > > > > up in the log if they produced an error (404, 500).  
> > Is this a 
> > > > > > configuration problem or is there something wrong with 
> > > > > > AccessLogInterceptor?
> > > > > > 
> > > > > > Thnaks,
> > > > > > Michael
> > > > > > 
> > > > > > --
> > > > > > To unsubscribe, e-mail:   
> > > > > > <mailto:tomcat-user-> unsubscribe@jakarta.apache.org> For
> > > > > > additional commands, 
> > > > > > e-mail: <ma...@jakarta.apache.org>
> > > > > > 
> > > > > 
> > > > > --
> > > > > To unsubscribe, e-mail:   
> > > > > <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> > > > > For
> > > > > additional commands,
> > > > > e-mail: <ma...@jakarta.apache.org>
> > > > > 
> > > > 
> > > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: 
> tomcat-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: 
> > tomcat-user-help@jakarta.apache.org
> > > > 
> > > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> > > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


solution jakarta-tomcat and virtual hosts

Posted by Johan Louwers <Su...@dds.nl>.
I have asked the question a couple of times in this mailing list and at some
places on usenet. I solved this problem at the end and will give a small
example of the things I did to make this work. I will post this on the
mailinglist and in some usenet groups in the hope some people can use this
information.If there are people that have things to add to this paper please
do so and tell me about it :-)




[problem situation]
1 server and 2 site's. Only port 80 can be used due to firewall rules. Both
site's are in need of JSP support under port 80.

We have www.someserver.com and mnt.someserver.com

www.someserver.com is located at /export/home/webroot/www.someserver.com
mnt.someserver.com is located at /export/home/webroot/mnt.someserver.com

both the JSP files and normal HTML files have to be located at the same
location.




[STEP 1]
I will not go in detail to this step.
 - Build and/or install apache webserver
 - Build and/or install jakarta-tomcat
 - Build and/or install a mod_jk connector

If you have some problems with installing jakarta-tomcat and or mod_jk
please take a look at www.johnturner.com most of the question can be solved
here.




[STEP 2]
Create 2 virtual domains in the Apache webserver.
(if apache is located at /usr/local/apache) BACKUP
/usr/local/apache/conf/httpd.conf and after that open the original with VI
or some editor you have on your system.


Add the following lines:

###########################################
# BEGIN virtualhost www.someserver.com
 <VirtualHost 10.99.1.115>
         ServerAdmin Johan.Louwers@someserver.com
         DocumentRoot /export/home/webroot/www.someserver.com
         ServerName www.someserver.com
         ErrorLog /export/home/weblog/error-log_www.someserver.com
         CustomLog /export/home/weblog/common-log_www.someserver.com common
 </VirtualHost>
# END virtualhost www.someserver.com
###########################################

###########################################
# BEGIN virtualhost mnt.someserver.com
 <VirtualHost 10.99.1.115>
         ServerAdmin Johan.Louwers@someserver.com
         DocumentRoot /export/home/webroot/mnt.someserver.com
         ServerName mnt.someserver.com
         ErrorLog /export/home/weblog/error-log_mnt.someserver.com
         CustomLog /export/home/weblog/common-log_mnt.someserver.com common
 </VirtualHost>
# END virtualhost mnt.someserver.com
###########################################

If you followd the correct way of instaling the mod_jk connector you will
also have a line in your httpd.conf file something like this:

LoadModule jk2_module modules/mod_jk2.so

Make sure to save the file. Restart Apache and test if all works correct.




[STEP 3]
(if jakarta-tomcat is located at /usr/local/jakarta-tomcat-4.1.27/) open
/usr/local/jakarta-tomcat-4.1.27/conf/server.xml in VI or some editor you
have on your system.

Add the following lines:

<!--########################################## -->
<!-- www.someserver.com JSP files -->
      <Host name="www.someserver.com" debug="0"
appBase="/export/home/webroot/www.someserver.com" unpackWARs="true"

autoDeploy="true">
         <Context path="" docBase="" debug="1"/>
         <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="wwwsomes_access_log." suffix=".txt"
pattern="common" resolveHost="flase"/>
      </Host>
<!--########################################## -->




<!--########################################## -->
<!-- mnt.someserver.com JSP files -->
     <Host name="mnt.someserver.com" debug="0"
appBase="/export/home/webroot/mnt.someserver.com" unpackWARs="true"

autoDeploy="true">
        <Context path="" docBase="" debug="1"/>
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="mntsoms_access_log." suffix=".txt" pattern="common"
resolveHost="false"/>
        </Host>
<!--########################################## -->




[STEP 4]
(if apache is located at /usr/local/apache)  open
/usr/local/apache/conf/workers2.properties with VI and add the following
lines:

#########################################

# worker properties www.someserver.com
[uri:www.someserver.com/*.jsp]
worker=ajp13:localhost:8009


# worker properties mnt.someserver.com
[uri:mnt.someserver.com/*.jsp]
worker=ajp13:localhost:8009

#########################################




[STEP 5]
Shutdown apache and tomcat if they are running and start them up again. You
should have now jsp access on

http://www.someserver.com and on http://mnt.someserver.com

Regards,
Johan Louwers


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org