Custom Log Formatter
Hello, it is my understanding that if I specify the fully qualified name of a class that implements java.util.logging.Formatter like so in conf/logging.properties: 2localhost.org.apache.juli.FileHandler.formatter = CustomFormat Then juli should use that class to format log messages that go into my localhost log. I've built CustomFormat into a jar, and placed it in Tomcat 6.0/lib. When I do this, nothing is logged into my localhost log, but the file is created. What am I doing wrong? This is Tomcat 6.0 on Windows XP, java 1.6.
RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR
I'm not even concerned with the webapp being automatically reloadable. I can reload from the manager or just bounce tomcat. Mentioning WatchedResource is a red herring. If I war a webapp with many class files in various packages in WEB-INF/classes with reloadable=false and unpackwars=false it will take over a minute to start the server. If I war a webapp with only my servlet class in WEB-INF/classes and place the dependent class files in a jar and put that jar in WEB-INF/lib with reloadable=false and unpackwars=false then it only takes a few seconds for the server to start. Not to mention on a less powerful windows xp machine the first scenario starts in seconds... -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, August 24, 2007 2:39 PM To: Tomcat Users List Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR Dan Beaulieu wrote: > Well I guess this gets into the nuances of classloaders that I am completely > unfamiliar with, but I wonder why it would be any different if those few > thousand classes are now packed in a jar and made available as a library to > the webapp? > nothing to do with classloading, all to do with "resource monitoring", as you set reloadable="true" but by now, you should have changed that to reloadable="false" and control what gets monitored using the WatchedResource element in your context config instead Filip > We run our standalone appserver from a jar, and loading is instantaneous, > and it has even more classes than the webapp does, from my point of view, it > should be no different. > > -Original Message- > From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] > Sent: Friday, August 24, 2007 10:42 AM > To: Tomcat Users List > Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server > startup with unpacked WAR > > Dan Beaulieu wrote: > >> Right, I understand the function of the reloadable attribute. What I don't >> understand is how on a modern computer, registering 2000 locations in >> memory/on disk to check for changes could take over a minute. Imagine just >> what it is doing, it isn't even checking for changes yet, its just >> registering the classes to check for changes. >> >> > you have unpackWARs="false", that means that it has to unzip/extract > 2000 files in memory from your .war file, one by one > > Filip > >> Not to mention, it doesn't really make sense when using an unpackable war. >> >> -Original Message- >> From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] >> Sent: Thursday, August 23, 2007 5:25 PM >> To: Tomcat Users List >> Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server >> startup with unpacked WAR >> >> even then, you should set reloadable="false" >> the flag name is misleading, all apps are reloadable, regardless of what >> that setting is (basically autoDeploy="true" -> webapps are reloadable) >> >> read up on the reloadable flag, you'll see that it actually would add >> all 2000 files to be monitored by tomcat, and could have noticeable impact >> >> Filip >> >> Dan Beaulieu wrote: >> >> >>> Reloadable is true, and unpack is false. >>> >>> If we tell it to unpack it'll take a long time to start up, but then >>> subsequent start ups with out deleting the webapp dir are fast. >>> >>> Agreed, reloadable shouldn't have that much of an impact. >>> >>> -Original Message- >>> From: Len Popp [mailto:[EMAIL PROTECTED] >>> Sent: Thursday, August 23, 2007 2:43 PM >>> To: Tomcat Users List >>> Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server >>> startup with unpacked WAR >>> >>> Is it unpacking the war during startup? Unzipping 2000 files takes a >>> while (even if they're small). >>> >>> >>> >> >> >> - >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> - >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> > > > ---
RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR
Well I guess this gets into the nuances of classloaders that I am completely unfamiliar with, but I wonder why it would be any different if those few thousand classes are now packed in a jar and made available as a library to the webapp? We run our standalone appserver from a jar, and loading is instantaneous, and it has even more classes than the webapp does, from my point of view, it should be no different. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, August 24, 2007 10:42 AM To: Tomcat Users List Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR Dan Beaulieu wrote: > Right, I understand the function of the reloadable attribute. What I don't > understand is how on a modern computer, registering 2000 locations in > memory/on disk to check for changes could take over a minute. Imagine just > what it is doing, it isn't even checking for changes yet, its just > registering the classes to check for changes. > you have unpackWARs="false", that means that it has to unzip/extract 2000 files in memory from your .war file, one by one Filip > Not to mention, it doesn't really make sense when using an unpackable war. > > -Original Message- > From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 23, 2007 5:25 PM > To: Tomcat Users List > Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server > startup with unpacked WAR > > even then, you should set reloadable="false" > the flag name is misleading, all apps are reloadable, regardless of what > that setting is (basically autoDeploy="true" -> webapps are reloadable) > > read up on the reloadable flag, you'll see that it actually would add > all 2000 files to be monitored by tomcat, and could have noticeable impact > > Filip > > Dan Beaulieu wrote: > >> Reloadable is true, and unpack is false. >> >> If we tell it to unpack it'll take a long time to start up, but then >> subsequent start ups with out deleting the webapp dir are fast. >> >> Agreed, reloadable shouldn't have that much of an impact. >> >> -Original Message- >> From: Len Popp [mailto:[EMAIL PROTECTED] >> Sent: Thursday, August 23, 2007 2:43 PM >> To: Tomcat Users List >> Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server >> startup with unpacked WAR >> >> Is it unpacking the war during startup? Unzipping 2000 files takes a >> while (even if they're small). >> >> > > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR
Sorry for following up again, but it appears the reloadable attribute was NOT the problem. Setting it to false and deploying an unpackable war with classes in WEB-INF/classes and not the jar still takes a long time to start. -Original Message- From: Dan Beaulieu [mailto:[EMAIL PROTECTED] Sent: Friday, August 24, 2007 10:26 AM To: 'Tomcat Users List' Subject: RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR Right, I understand the function of the reloadable attribute. What I don't understand is how on a modern computer, registering 2000 locations in memory/on disk to check for changes could take over a minute. Imagine just what it is doing, it isn't even checking for changes yet, its just registering the classes to check for changes. Not to mention, it doesn't really make sense when using an unpackable war. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Thursday, August 23, 2007 5:25 PM To: Tomcat Users List Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR even then, you should set reloadable="false" the flag name is misleading, all apps are reloadable, regardless of what that setting is (basically autoDeploy="true" -> webapps are reloadable) read up on the reloadable flag, you'll see that it actually would add all 2000 files to be monitored by tomcat, and could have noticeable impact Filip Dan Beaulieu wrote: > Reloadable is true, and unpack is false. > > If we tell it to unpack it'll take a long time to start up, but then > subsequent start ups with out deleting the webapp dir are fast. > > Agreed, reloadable shouldn't have that much of an impact. > > -Original Message- > From: Len Popp [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 23, 2007 2:43 PM > To: Tomcat Users List > Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server > startup with unpacked WAR > > Is it unpacking the war during startup? Unzipping 2000 files takes a > while (even if they're small). > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR
Right, I understand the function of the reloadable attribute. What I don't understand is how on a modern computer, registering 2000 locations in memory/on disk to check for changes could take over a minute. Imagine just what it is doing, it isn't even checking for changes yet, its just registering the classes to check for changes. Not to mention, it doesn't really make sense when using an unpackable war. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Thursday, August 23, 2007 5:25 PM To: Tomcat Users List Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR even then, you should set reloadable="false" the flag name is misleading, all apps are reloadable, regardless of what that setting is (basically autoDeploy="true" -> webapps are reloadable) read up on the reloadable flag, you'll see that it actually would add all 2000 files to be monitored by tomcat, and could have noticeable impact Filip Dan Beaulieu wrote: > Reloadable is true, and unpack is false. > > If we tell it to unpack it'll take a long time to start up, but then > subsequent start ups with out deleting the webapp dir are fast. > > Agreed, reloadable shouldn't have that much of an impact. > > -Original Message- > From: Len Popp [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 23, 2007 2:43 PM > To: Tomcat Users List > Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server > startup with unpacked WAR > > Is it unpacking the war during startup? Unzipping 2000 files takes a > while (even if they're small). > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR
Reloadable is true, and unpack is false. If we tell it to unpack it'll take a long time to start up, but then subsequent start ups with out deleting the webapp dir are fast. Agreed, reloadable shouldn't have that much of an impact. -Original Message- From: Len Popp [mailto:[EMAIL PROTECTED] Sent: Thursday, August 23, 2007 2:43 PM To: Tomcat Users List Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR Is it unpacking the war during startup? Unzipping 2000 files takes a while (even if they're small). -- Len On 8/23/07, Dan Beaulieu <[EMAIL PROTECTED]> wrote: > Sorry to reply to my own post, but I have sort of figured it out. There were > about 2000 classes in /WEB-INF/classes, only one servlet though. Instead of > making the war from here, we only have the servlet class in WEB-INF/classes > and jar up the rest of the packages and place that jar into WEB-INF/lib. > > Not ideal, but I guess it will have to do, but I don't see why it would > matter how many classes are in WEB-INF/classes. Start up time is now around > 5s instead of 80s. > > -Original Message- > From: Dan Beaulieu [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 23, 2007 10:32 AM > To: 'Tomcat Users List' > Subject: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server > startup with unpacked WAR > > > Hello, we are having problems with slow server startup with Tomcat6. It is a > basic webapp and the server starts up fairly quickly when WEB-INF exists, > but if we are trying to deploy from a WAR, it takes 10 times as long. I've > downloaded the tomcat source to try to dig in and see what is going on, but > thought I'd try here first. We are getting different behavior on 3 different > systems. On one windows xp machine, it takes about 7-8 seconds to complete > the server startup, on another about 15s, and on the windows 2000 machine it > takes over a minute. I only mention the OS because that is the only > difference software wise. This is all using the same WAR, built and packed > on one machine. > I've tried APR and it is actually slower starting up. Here is a sample out > of the Catalina log: > > Aug 23, 2007 10:13:42 AM org.apache.catalina.core.AprLifecycleListener init > INFO: The Apache Tomcat Native library which allows optimal performance in > production environments was not found on the java.library.path: {Path > removed for brevity} > Aug 23, 2007 10:13:42 AM org.apache.coyote.http11.Http11Protocol init > INFO: Initializing Coyote HTTP/1.1 on http-8080 > Aug 23, 2007 10:13:42 AM org.apache.catalina.startup.Catalina load > INFO: Initialization processed in 953 ms > Aug 23, 2007 10:13:42 AM org.apache.catalina.core.StandardService start > INFO: Starting service Catalina > Aug 23, 2007 10:13:42 AM org.apache.catalina.core.StandardEngine start > INFO: Starting Servlet Engine: Apache Tomcat/6.0.13 > Aug 23, 2007 10:15:00 AM org.apache.coyote.http11.Http11Protocol start > INFO: Starting Coyote HTTP/1.1 on http-8080 > Aug 23, 2007 10:15:00 AM org.apache.jk.common.ChannelSocket init > INFO: JK: ajp13 listening on /0.0.0.0:8009 > Aug 23, 2007 10:15:00 AM org.apache.jk.server.JkMain start > INFO: Jk running ID=0 time=0/63 config=null > Aug 23, 2007 10:15:00 AM org.apache.catalina.startup.Catalina start > INFO: Server startup in 78567 ms > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR
Sorry to reply to my own post, but I have sort of figured it out. There were about 2000 classes in /WEB-INF/classes, only one servlet though. Instead of making the war from here, we only have the servlet class in WEB-INF/classes and jar up the rest of the packages and place that jar into WEB-INF/lib. Not ideal, but I guess it will have to do, but I don't see why it would matter how many classes are in WEB-INF/classes. Start up time is now around 5s instead of 80s. -Original Message- From: Dan Beaulieu [mailto:[EMAIL PROTECTED] Sent: Thursday, August 23, 2007 10:32 AM To: 'Tomcat Users List' Subject: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR Hello, we are having problems with slow server startup with Tomcat6. It is a basic webapp and the server starts up fairly quickly when WEB-INF exists, but if we are trying to deploy from a WAR, it takes 10 times as long. I've downloaded the tomcat source to try to dig in and see what is going on, but thought I'd try here first. We are getting different behavior on 3 different systems. On one windows xp machine, it takes about 7-8 seconds to complete the server startup, on another about 15s, and on the windows 2000 machine it takes over a minute. I only mention the OS because that is the only difference software wise. This is all using the same WAR, built and packed on one machine. I've tried APR and it is actually slower starting up. Here is a sample out of the Catalina log: Aug 23, 2007 10:13:42 AM org.apache.catalina.core.AprLifecycleListener init INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: {Path removed for brevity} Aug 23, 2007 10:13:42 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Aug 23, 2007 10:13:42 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 953 ms Aug 23, 2007 10:13:42 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Aug 23, 2007 10:13:42 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.13 Aug 23, 2007 10:15:00 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Aug 23, 2007 10:15:00 AM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Aug 23, 2007 10:15:00 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/63 config=null Aug 23, 2007 10:15:00 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 78567 ms - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR
Hello, we are having problems with slow server startup with Tomcat6. It is a basic webapp and the server starts up fairly quickly when WEB-INF exists, but if we are trying to deploy from a WAR, it takes 10 times as long. I've downloaded the tomcat source to try to dig in and see what is going on, but thought I'd try here first. We are getting different behavior on 3 different systems. On one windows xp machine, it takes about 7-8 seconds to complete the server startup, on another about 15s, and on the windows 2000 machine it takes over a minute. I only mention the OS because that is the only difference software wise. This is all using the same WAR, built and packed on one machine. I've tried APR and it is actually slower starting up. Here is a sample out of the Catalina log: Aug 23, 2007 10:13:42 AM org.apache.catalina.core.AprLifecycleListener init INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: {Path removed for brevity} Aug 23, 2007 10:13:42 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Aug 23, 2007 10:13:42 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 953 ms Aug 23, 2007 10:13:42 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Aug 23, 2007 10:13:42 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.13 Aug 23, 2007 10:15:00 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Aug 23, 2007 10:15:00 AM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Aug 23, 2007 10:15:00 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/63 config=null Aug 23, 2007 10:15:00 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 78567 ms - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Apache2.2.4/modjk/Tomcat6.0.13] redirect url problem
The reason was I had my rewrite directives in httpd.conf, when they should have been nested under the virtual host in httpd-ssl.conf. Guess I forgot to mention/remember I am using ssl. So I've got it working, thank you for your help, but it's still unclear why we can't point two different paths at the same context/webapp. Suppose I wanted a solution that only involved Tomcat? It wouldn't be possible. Thanks again. Dan -Original Message- From: Rainer Jung [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 24, 2007 5:48 PM To: Tomcat Users List Subject: Re: [Apache2.2.4/modjk/Tomcat6.0.13] redirect url problem Since you want to do an internal URL rewriting, it doesn't make much sense to me, to use a full URL including protocol and host. I would try the line, you commented out, instead. I guess, that you already tried that. You should definitely see log entries in the rewrite log, if the module is doing anything. Maybe there's a problem with the spaces in the path? Mske sure, the Apache user can write to the file, so it wasn't created during a test run by a user with other privileges. Why is your JkOption gone? Regards, Rainer Dan Beaulieu wrote: > Yes, that's what I have been playing around with. This is the very bottom of > my httpd.conf: > > JkWorkersFile "C:/Program Files/Apache2/conf/workers.properties" > JkShmFile "C:/Program Files/Apache2/logs/mod_jk.shm" > JkLogFile "C:/Program Files/Apache2/logs/mod_jk.log" > JkLogLeveldebug > JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " > jkMount /myApp/* worker1 > > > RewriteEngine on > RewriteLog "C:\Program Files\Apache2\logs\rewrite.txt" > RewriteLogLevel 9 > RewriteRule ^/demo/(.*)$ https://localhost/$1 [PT,NE,NC] > #RewriteRule ^/demo/(.*)$ /$1 [PT,NE,NC] > > > I've tried both those rewrite rules, and with the R flag included, no go. > Nothing is getting written to the rewrite.txt log either, it DOES exist > though. Only thing I am getting is "client denied by server configuration: > C:/Program Files/Apache2/htdocs/demo" when I try to visit > "https://localhost/demo/myApp/login.html"; in my error_log. I have no idea > how htdocs is getting used as I've modified my DocumentRoot to point > elsewhere...(Not that that's what I want to use anyway) > > I am also loading mod_jk before mod_rewrite, as I've seen that the load > order has caused problems for some people. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Apache2.2.4/modjk/Tomcat6.0.13] redirect url problem
Yes, that's what I have been playing around with. This is the very bottom of my httpd.conf: JkWorkersFile "C:/Program Files/Apache2/conf/workers.properties" JkShmFile "C:/Program Files/Apache2/logs/mod_jk.shm" JkLogFile "C:/Program Files/Apache2/logs/mod_jk.log" JkLogLeveldebug JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " jkMount /myApp/* worker1 RewriteEngine on RewriteLog "C:\Program Files\Apache2\logs\rewrite.txt" RewriteLogLevel 9 RewriteRule ^/demo/(.*)$ https://localhost/$1 [PT,NE,NC] #RewriteRule ^/demo/(.*)$ /$1 [PT,NE,NC] I've tried both those rewrite rules, and with the R flag included, no go. Nothing is getting written to the rewrite.txt log either, it DOES exist though. Only thing I am getting is "client denied by server configuration: C:/Program Files/Apache2/htdocs/demo" when I try to visit "https://localhost/demo/myApp/login.html"; in my error_log. I have no idea how htdocs is getting used as I've modified my DocumentRoot to point elsewhere...(Not that that's what I want to use anyway) I am also loading mod_jk before mod_rewrite, as I've seen that the load order has caused problems for some people. -Original Message- From: Rainer Jung [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 24, 2007 4:42 PM To: Tomcat Users List Subject: Re: [Apache2.2.4/modjk/Tomcat6.0.13] redirect url problem You can do this with mod_rewrite. Don't forget to use the PT flag, when combining mod_rewrite and mod_jk. If it doesn't easily work for you: Add a RewriteLog with a high RewriteLogLevel (e.g. 9) and increase JkLogLevel to debug. Then you can follow the manipulation of the URL. Regards, Rainer Dan Beaulieu wrote: > Thank you for the reply, I have played around with mod_rewrite, just can't > seem to get it going. I will have to dig deeper. > > The main problem is when we used jserv we did something like this: > > ApJservMount /myApp/servlets /myApp > ApJservMount /demo/myApp/servlets /myApp > > So myApp was a zone, and they paths would be "mounted" to the same zone > > But now, with mod_jk I can't do: > > jkMount /myApp/* worker1 > JkMount /demo/myApp/* worker1 > > Because tomcat on the other end will expect two separate contexts: > > reloadable="true" /> > reloadable="true" /> > > Two separate webapps = a session headache. > Unless I am missing something... - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Apache2.2.4/modjk/Tomcat6.0.13] redirect url problem
Thank you for the reply, I have played around with mod_rewrite, just can't seem to get it going. I will have to dig deeper. The main problem is when we used jserv we did something like this: ApJservMount /myApp/servlets /myApp ApJservMount /demo/myApp/servlets /myApp So myApp was a zone, and they paths would be "mounted" to the same zone But now, with mod_jk I can't do: jkMount /myApp/* worker1 JkMount /demo/myApp/* worker1 Because tomcat on the other end will expect two separate contexts: Two separate webapps = a session headache. Unless I am missing something... -Original Message- From: Rainer Jung [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 24, 2007 11:35 AM To: Tomcat Users List Subject: Re: [Apache2.2.4/modjk/Tomcat6.0.13] redirect url problem Hi Dan, OK, two problems here: 1) URL encoded session ids and forwarding. I assume you are using mod_jk 1.2.23. For this problem you already found a workaround, although the JkOption is not really safe. This topi will be fixed in a nicer way in the forthcoming version 1.2.24. The reason you can not see the difference in the access logs is, that the access logs show the incoming URL, but not the forwarded URL. Apache httpd will decode %3b into ";" and mod_jk will reencode before forwarding, but unfortunately the tomcat connector doesn't understand %3b in front of jsessionid. The JkOption you have chosen will forward the decoded URL. 2) Redirects for POST requests result in GET requests I remember, that this is a well known browser problem. Maybe other users can help on that topic. Easiest solution would be to redirect earlier, i.e. before the form comes into the game. Another option would be to use mod_rewrite to rewrite the URL only locally, but then the browsers would not "learn", that they are using a wrong URL. Regards, Rainer Dan Beaulieu wrote: > > I am trying to migrate our current system of apache/jserv to apache tomcat > using modjk. I am trying to shoe horn our current configuration. > > I have a webapp lets call it myApp. Now some of our static content, beyond > my control, requests urls like > https://localhost/demo/myApp/servlets/aServlet;jsessionid=XXX. > I've added an entry in my httpd.conf: > > Redirect /demo https://localhost > > When I do this, I will get a 404 with the access_log saying: > > "POST > /demo/myApp/servlets/aServlet;jsessionid=24C7A06037BBA7AF7BB44DE5C0206F8C&Re > questType=SomeRequest HTTP/1.1" 301 332 > "GET > /myApp/servlets/aServlet%3bjsessionid=24C7A06037BBA7AF7BB44DE5C0206F8C&Reque > stType=SomeRequest HTTP/1.1" 404 1273 > > So, it looks like partly a url encoding problem. I searched around to find > out whats up, and tried this directive for mod_jk: > > JkOptions +ForwardURICompat > > And now in the access_log I see this > > "POST > /demo/myApp/servlets/aServlet;jsessionid=7B08C6CF734771A220CC98D82DE33466&Re > questType=SomeRequest HTTP/1.1" 301 332 > "GET myApp/servlets/aServlet > %3bjsessionid=7B08C6CF734771A220CC98D82DE33466&RequestType=SomeRequest > HTTP/1.1" 200 29 > > So we see that the request worked(even though the url is still encoded??), > but its not actually redirecting the request. The POST is getting turned > into a GET. Tomcat is responding with the proper response for a GET request > to "/myApp/servlets/aServlet". - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Apache2.2.4/modjk/Tomcat6.0.13] redirect url problem
I am trying to migrate our current system of apache/jserv to apache tomcat using modjk. I am trying to shoe horn our current configuration. I have a webapp lets call it myApp. Now some of our static content, beyond my control, requests urls like https://localhost/demo/myApp/servlets/aServlet;jsessionid=XXX. I've added an entry in my httpd.conf: Redirect /demo https://localhost When I do this, I will get a 404 with the access_log saying: "POST /demo/myApp/servlets/aServlet;jsessionid=24C7A06037BBA7AF7BB44DE5C0206F8C&Re questType=SomeRequest HTTP/1.1" 301 332 "GET /myApp/servlets/aServlet%3bjsessionid=24C7A06037BBA7AF7BB44DE5C0206F8C&Reque stType=SomeRequest HTTP/1.1" 404 1273 So, it looks like partly a url encoding problem. I searched around to find out whats up, and tried this directive for mod_jk: JkOptions +ForwardURICompat And now in the access_log I see this "POST /demo/myApp/servlets/aServlet;jsessionid=7B08C6CF734771A220CC98D82DE33466&Re questType=SomeRequest HTTP/1.1" 301 332 "GET myApp/servlets/aServlet %3bjsessionid=7B08C6CF734771A220CC98D82DE33466&RequestType=SomeRequest HTTP/1.1" 200 29 So we see that the request worked(even though the url is still encoded??), but its not actually redirecting the request. The POST is getting turned into a GET. Tomcat is responding with the proper response for a GET request to "/myApp/servlets/aServlet". - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]