mod_jk for Apache 2 and tomcat 4 on Linux finally compiled!
Dear all, I managed to compile a version of mod_jk.so for Apache 2 and tomcat 4 on linux with some minor changes to the build scripts. Version info: - RHat Linux 6.2 - gcc 2.91.66 - Sun Java JDK 1.4 - Apache 2.0.34 - Tomcat 4.0.4-b2 - tomcat-connectors-4.0.4-b2 (native mod_jk.so) Load balancing also works between W2K and Linux! Here's what you need to do: 1. Download src, build install Apache 2.0.35 2. set APACHE_HOME to the installation(runtime) directory Eg. Let's assume you install into /usr/local/apache2 export APACHE_HOME=/usr/local/apache2 3. Download tomcat connector src and extract to any directory from http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0. 4-b2/src/jakarta-tomcat-connectors-4.0.4-b2-src.tar.gz (make sure you copy the entire url) Eg. Let's assume you extract the zip into /tmp/jakarta-tomcat-connectors-4.0.4-b2-src 3. Ensure JAVA_HOME is properly configured 4. cd /tmp/jakarta-tomcat-connectors...src/jk/native/apache-2.0 5. Edit build-unix.sh and change the contents according to the diff.txt attached. For those who fear looking at diff reports, you may use the updated build-unix.sh attached as well. 6. ./build-unix.sh You may note some 'undefined reference to ...' errors - that's ok. The script will ultimately use gcc and compile mod_jk.so and copy to the APACHE_HOME/modules directory 7. Add the following to APACHE_HOME/conf/httpd.conf: Include conf/mod_jk.conf 8. Attached is my sample mod_jk.conf (with load balancing configured) 9. Other files attached: workers.properties (ajp13 load balancing to a W2K PC and Linux PC) As for steps to config load balancing on tomcat, follow instructions on tomcat's site. ONE OF the config changed in TOMCAT/conf/server.xml: Engine jvmRoute=tomcat1 name=Standalone defaultHost=localhost Other instructions are very clear at the site. 10. Startup tomcat then apache 11. Pray that it works :) Good luck! -keng wong -keng wong --- build-unix.sh.old Sat Mar 23 22:09:26 2002 +++ build-unix.sh Wed Apr 24 11:23:04 2002 @@ -37,13 +37,16 @@ # Figure out INCLUDE directories # use find to pick the right include directories for current machine -JAVA_INCLUDE=`find ${JAVA_HOME}/include -type d | sed 's/^/-I /g'` || echo find failed, edit build-unix.sh source to fix +# this method fixed the newline problem +for line in `find ${JAVA_HOME}/include -type d`;do +JAVA_INCLUDE=${JAVA_INCLUDE} -I ${line} +done # if find fails, use (uncomment) the following instead, substituting your # platform for linux # JAVA_INCLUDE=-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux -INCLUDE=-I ../common -I$APACHE_HOME/include/apr-util $JAVA_INCLUDE +INCLUDE=$JAVA_INCLUDE -I $APACHE_HOME/include -I $APACHE_HOME/srclib/apr/include -I +$APACHE_HOME/srclib/apr-util/include # SRC=mod_jk.c ../common/*.c SRC=*.c @@ -52,12 +55,15 @@ # Run APXS to compile module echo Compiling mod_jk -cp ../common/*.c . -$APXS -c -o mod_jk.so $INCLUDE $LIB $SRC +cp ../common/*.c ../common/*.h . +$APXS -c -o mod_jk.so $INCLUDE $SRC + +# Compile mod_jk.so +gcc -shared -o mod_jk.so *.o # Copy mod_jk.so into the apache libexec directory echo Installing mod_jk.so into $APACHE_HOME/libexec -cp mod_jk.so $APACHE_HOME/libexec +cp -p mod_jk.so $APACHE_HOME/modules # Done! echo Done. Install by running ./install-unix.sh build-unix.sh Description: Binary data mod_jk.conf Description: Binary data workers.properties Description: Binary data -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Please read Re: Urgent Re: Newbie: Servlet under Windows does not run
Have you tried http://localhost/Census/servlet/Census.CensusQuery or http://localhost:8080/Census/servlet/Census.CensusQuery ? You are deploying a new war file(Census webapp) and requires the webapp name before any servlet urls. Exception is the ROOT webapp. Good luck. -keng wong -Original Message- From: Jim Cobban [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 12:00 PM To: Tomcat Users List Subject: Please read Re: Urgent Re: Newbie: Servlet under Windows does not run Please read this thread and tell me what the h**l I am doing wrong. I am just trying to write my first servlet. I have to give a demo Tuesday evening and I cannot get TomCat to run my servlet. Tomcat insists that it cannot find the class, even though as far as I can see the servlet has deployed properly. I have posted every bit of documentation I have on the problem and so far all I have received is sympathy. I have modelled my code directly on the examples, which Tomcat has no trouble running. I honestly cannot see that I am doing anything differently except to name the package and class different names. I am losing my mind! I do not have time to root through the code of Tomcat to find out exactly what it does during deployment of a servlet or where it goes looking for classes, and frankly I don't think that I should have to worry about that. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Request filters and content type
Does anyone know how can I retrieve the content type of a response (or to be exact ServletResponse) ? I'm trying to process doFilter() based on the ServletResponse and not the ServletRequest. Eg. if the response's contentType is gif, do something with it. I can't use the filter-mapping tag as the response is generated on the fly and the request url is too generic. Thanks for the help. -keng wong -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Request filters and content type
Thanks for the solution Craig - works like a charm! -keng wong -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 11:23 AM To: Tomcat Users List Subject: Re: Request filters and content type On Tue, 12 Feb 2002, Keng Wong wrote: Date: Tue, 12 Feb 2002 10:12:11 -0800 From: Keng Wong [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List (E-mail) [EMAIL PROTECTED] Subject: Request filters and content type Does anyone know how can I retrieve the content type of a response (or to be exact ServletResponse) ? I'm trying to process doFilter() based on the ServletResponse and not the ServletRequest. Eg. if the response's contentType is gif, do something with it. I can't use the filter-mapping tag as the response is generated on the fly and the request url is too generic. On the way *in* to the filter, you'll need to create a response wrapper that overrides the setContentType() method, and includes a getContentType() method your filter can recognize -- something along the following lines: public class MyResponseWrapper extends HttpServletResponseWrapper { public MyResponseWrapper(HttpServletResponse response) { super(response); } private String saveContentType = null; public String getContentType() { return (this.saveContentType); } public void setContentType(String contentType) { super.setContentType(contentType); this.saveContentType = contentType; } } public class MyFilter implements Filter { public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException { MyResponseWrapper wresponse = new MyResponseWrapper((HttpServletResponse) response); ... other stuff as needed ... chain.doFilter(request, wresponse); // Pass wrapped response String responseContentType = wresponse.getContentType(); ... other stuff as needed ... } } In Design Patterns terms, we are decorating the response provided by the container to add some additional functionality (i.e. saving the content type so that it can be retrieved later), without impacting the API seen by the servlet that is ultimately invoked. This is a very useful general technique for writing filters. Thanks for the help. -keng wong Craig -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Apache - Tomcat - Servlet Mapping
You could try adding the following in the TOMCAT_HOME/conf/server.xml: Context path=/ docBase=webapps/examples ../Context This will map your examples webapp to the '/'. This will allow you to access http://servername/servlet/HelloWorld. -keng wong -Original Message- From: Gary Dale [mailto:[EMAIL PROTECTED]] Sent: Friday, July 06, 2001 12:27 PM To: [EMAIL PROTECTED] Subject: Re: Apache - Tomcat - Servlet Mapping It would probably help if the mod_jk howto contained an example showing how to run the examples through Apache. For example, I have Tomcat 3.2.2 running nicely and get the examples to run using http://servername:8080/ to launch the examples. When I connect Apache to Tomcat, using http://servername/ doesn't recognize that the / context should go to ROOT. And going into http://servername/ROOT/ gets you into trouble when it tries to go to the examples context.
RE: two tomcat one machine
I did tried that option with $TOMCAT_HOME/bin/shutdown.sh -host localhost -port 8011 but the connection is still listening. Here's my netstat -an|grep 80 tcp 0 185 127.0.0.1:8011 127.0.0.1:4178 CLOSE (THIS ONE APPEARS AFTER THE SHUTDOWN COMMAND WAS ISSUED) tcp 0 0 127.0.0.0:8012 0.0.0.0:* LISTEN tcp 0 0 127.0.0.0:8011 0.0.0.0:* LISTEN tcp 0 0 127.0.0.0:8009 0.0.0.0:* LISTEN tcp 0 0 127.0.0.0:8007 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN I had 2 additional type Ajp13 connectors on 8011 8012. I am trying to close 8011. An access to the web server still reveals getting a connection from 8011. Environment: Sun JDK1.3 RHat 7.1 Apache 1.3.20 Tomcat 3.3-m4 Thanks. -keng wong -Original Message- From: Jason Koeninger [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 03, 2001 7:15 AM To: [EMAIL PROTECTED] Subject: Re: two tomcat one machine Reviewed the code a couple weeks ago looking for a similar solution. You can call org.apache.tomcat.startup.StopTomcat directly with -host and -port options. Check the code for more details if you have trouble...the -port option works for me on 3.3.m3. btw - It's possible I was looking at current 3.3 code and not 3.2.2 so YMMV. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Tue, 3 Jul 2001 14:41:12 +0200 (CEST), [EMAIL PROTECTED] wrote: Hello! I am running two tomcat 3.2.2 on one Solaris machine, each of them is bind to one IP Address via the inet parameter. But now it is impossible to shut the down with the standard process by calling org.apache.tomcat.startup.Tomcat -stop because none of them listen to 127.0.0.1 anymore... Has anyone an idea for this ? Bye, Oli Eales germany.net Technik Tel: +49-69-63397411
RE: two tomcat one machine
So it looks like I will need to use ajp12 for my loadbalanced workers rather than ajp13 to work (that is to allow shutdowns of certain workers instead of all the workers on the same host) or I will need to shutdown all workers for a particular loadbalanced host with the ./bin/shutdown.sh command (which is the norm anyway). Thanks. -keng wong -Original Message- From: Jason Koeninger [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 03, 2001 3:03 PM To: [EMAIL PROTECTED]; Keng Wong Subject: RE: two tomcat one machine I don't believe ajp13 supports the shutdown commands that Tomcat sends. You should be sending those to an ajp12 port. If you don't have ajp12 running, ps and kill might come in handy. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Tue, 3 Jul 2001 14:59:57 -0700, Keng Wong wrote: I did tried that option with $TOMCAT_HOME/bin/shutdown.sh -host localhost -port 8011 but the connection is still listening. Here's my netstat -an|grep 80 tcp 0 185 127.0.0.1:8011 127.0.0.1:4178 CLOSE (THIS ONE APPEARS AFTER THE SHUTDOWN COMMAND WAS ISSUED) tcp 0 0 127.0.0.0:8012 0.0.0.0:* LISTEN tcp 0 0 127.0.0.0:8011 0.0.0.0:* LISTEN tcp 0 0 127.0.0.0:8009 0.0.0.0:* LISTEN tcp 0 0 127.0.0.0:8007 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN I had 2 additional type Ajp13 connectors on 8011 8012. I am trying to close 8011. An access to the web server still reveals getting a connection from 8011. Environment: Sun JDK1.3 RHat 7.1 Apache 1.3.20 Tomcat 3.3-m4 Thanks. -keng wong -Original Message- From: Jason Koeninger [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 03, 2001 7:15 AM To: [EMAIL PROTECTED] Subject: Re: two tomcat one machine Reviewed the code a couple weeks ago looking for a similar solution. You can call org.apache.tomcat.startup.StopTomcat directly with -host and -port options. Check the code for more details if you have trouble...the -port option works for me on 3.3.m3. btw - It's possible I was looking at current 3.3 code and not 3.2.2 so YMMV. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Tue, 3 Jul 2001 14:41:12 +0200 (CEST), [EMAIL PROTECTED] wrote: Hello! I am running two tomcat 3.2.2 on one Solaris machine, each of them is bind to one IP Address via the inet parameter. But now it is impossible to shut the down with the standard process by calling org.apache.tomcat.startup.Tomcat -stop because none of them listen to 127.0.0.1 anymore... Has anyone an idea for this ? Bye, Oli Eales germany.net Technik Tel: +49-69-63397411
RE: apache mod_rewrite, mod_jk
Jason, The JkMount directives are: JkMount /examples/servlet/* ajp13 JkMount /examples/*.jsp ajp13 I believe only these are passed to the servlet engine and not the entire site. Thanks for your response. -keng wong -Original Message- From: Jason Koeninger [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 28, 2001 8:06 AM To: [EMAIL PROTECTED] Subject: Re: apache mod_rewrite, mod_jk What do your JkMount directives look like? If you've done something like: JkMount /examples/* ajp13 I would think this would work fine (assuming the rewrite rule is done correctly...I'm no expert), but if you did something like: JkMount /hello ajp13 I can see where there would be problems. You, of course, don't want to mount the url you're trying to rewrite If you're doing something like: JkMount /* ajp13 Then, I think you should back off and only mount the servlets until you get your rewrite rule done correctly. I also don't know the interaction of mod_jk and mod_rewrite if they have competing entries so that may cause you some more trouble if you're pushing the whole site through to Tomcat. Hope that helps. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Wed, 27 Jun 2001 23:08:23 -0700, William Wong wrote: Hi, I had tried to setup mod_rewrite with mod_jk (ajp12 ajp13) but with no luck whatsoever. Even tried the approach mentioned in some of the postings (dated Feb 2001) but without success. The setup: jdk1.3 (Sun) RH7.1 apache-1.3.20 (DSO) tomcat-3.2.2 (downloaded from jakarta.apache.org) mod_jk.so (eapi) - downloaded from jakarta.apache.org httpd.conf: LoadModule jk_module libexec/mod_jk.so AddModule mod_jk.c LoadModule rewrite_module libexec/mod_rewrite.so AddModule mod_rewrite.c LoadModule ssl_module libexec/libssl.so AddModule mod_ssl.c IfModule mod_rewrite.c RewriteEngine on RewriteRule ^/hello(.*) /examples/servlet/HelloWorldExample$1 [PT] /IfModule Include /install/jakarta-tomcat-3.2.2/conf/mod_jk.conf ---[END OF httpd.conf] The mod_jk.conf is copied from the mod_jk.conf-auto but the LoadModule is remarked. The following link works: http://localhost/examples/servlet/HelloWorldExample The following does not: http://localhost/hello The error on the screen: Not Found(404) Original request:/hello Not found request:/hello Tomcat log (mod_jk.log) shows: -MM-DD 00:00:00 - Ctx( ):404 R( + /hello + null) null Appreciate all the help I can get. Thanks for your time and attention. -keng wong
RE: apache mod_rewrite, mod_jk
Jason, Thanks a lot. It works when the PT is changed to R (redirect). However, this will break existing paths currently used (jserv). Looks like this is documented in the HOWTO as well. Will this be fixed in 3.3x or Apache 2.x ? -keng wong -Original Message- From: Jason Koeninger [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 28, 2001 10:12 AM To: [EMAIL PROTECTED] Subject: RE: apache mod_rewrite, mod_jk Yes, but the logs below and the error message you get are showing Tomcat seeing /hello. That shouldn't be happening with what appears to be a good configuration. Something else is going on here. Try switching from a pass-through rewrite to a redirect rewrite and see if that works. If it does, then it probably means the interaction betweem mod_jk and mod_rewrite doesn't work as expected. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Thu, 28 Jun 2001 09:09:01 -0700, Keng Wong wrote: Jason, The JkMount directives are: JkMount /examples/servlet/* ajp13 JkMount /examples/*.jsp ajp13 I believe only these are passed to the servlet engine and not the entire site. Thanks for your response. -keng wong -Original Message- From: Jason Koeninger [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 28, 2001 8:06 AM To: [EMAIL PROTECTED] Subject: Re: apache mod_rewrite, mod_jk What do your JkMount directives look like? If you've done something like: JkMount /examples/* ajp13 I would think this would work fine (assuming the rewrite rule is done correctly...I'm no expert), but if you did something like: JkMount /hello ajp13 I can see where there would be problems. You, of course, don't want to mount the url you're trying to rewrite If you're doing something like: JkMount /* ajp13 Then, I think you should back off and only mount the servlets until you get your rewrite rule done correctly. I also don't know the interaction of mod_jk and mod_rewrite if they have competing entries so that may cause you some more trouble if you're pushing the whole site through to Tomcat. Hope that helps. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Wed, 27 Jun 2001 23:08:23 -0700, William Wong wrote: Hi, I had tried to setup mod_rewrite with mod_jk (ajp12 ajp13) but with no luck whatsoever. Even tried the approach mentioned in some of the postings (dated Feb 2001) but without success. The setup: jdk1.3 (Sun) RH7.1 apache-1.3.20 (DSO) tomcat-3.2.2 (downloaded from jakarta.apache.org) mod_jk.so (eapi) - downloaded from jakarta.apache.org httpd.conf: LoadModule jk_module libexec/mod_jk.so AddModule mod_jk.c LoadModule rewrite_module libexec/mod_rewrite.so AddModule mod_rewrite.c LoadModule ssl_module libexec/libssl.so AddModule mod_ssl.c IfModule mod_rewrite.c RewriteEngine on RewriteRule ^/hello(.*) /examples/servlet/HelloWorldExample$1 [PT] /IfModule Include /install/jakarta-tomcat-3.2.2/conf/mod_jk.conf ---[END OF httpd.conf] The mod_jk.conf is copied from the mod_jk.conf-auto but the LoadModule is remarked. The following link works: http://localhost/examples/servlet/HelloWorldExample The following does not: http://localhost/hello The error on the screen: Not Found(404) Original request:/hello Not found request:/hello Tomcat log (mod_jk.log) shows: -MM-DD 00:00:00 - Ctx( ):404 R( + /hello + null) null Appreciate all the help I can get. Thanks for your time and attention. -keng wong
RE: apache mod_rewrite, mod_jk
One thing I did found out is that in order for the PT to work, I have to use the servlet-mapping tag in web.xml for every alias that needs a redirect. Eg. RewriteRule ^/hello(.*) /examples/servlet/HelloWorldExample$1 [PT] (though I could use /servlet/HelloWorldExample instead) Then add the following to my web.xml: servlet servlet-namehello/servlet-name servlet-classHelloWorldExample/servlet-class /servlet servlet-mapping servlet-namehello/servlet-name url-pattern/hello/url-pattern /servlet-mapping This will work for all my previous Rewriterules (from jserv setup). In short, no change to rewrite rules but add every other alias name (hello) used in the rewrite rule to the web.xml file! Thanks for helping me found this. -keng wong -Original Message- From: Keng Wong [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 28, 2001 11:08 AM To: [EMAIL PROTECTED]; Jason Koeninger Subject: RE: apache mod_rewrite, mod_jk Jason, Thanks a lot. It works when the PT is changed to R (redirect). However, this will break existing paths currently used (jserv). Looks like this is documented in the HOWTO as well. Will this be fixed in 3.3x or Apache 2.x ? -keng wong -Original Message- From: Jason Koeninger [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 28, 2001 10:12 AM To: [EMAIL PROTECTED] Subject: RE: apache mod_rewrite, mod_jk Yes, but the logs below and the error message you get are showing Tomcat seeing /hello. That shouldn't be happening with what appears to be a good configuration. Something else is going on here. Try switching from a pass-through rewrite to a redirect rewrite and see if that works. If it does, then it probably means the interaction betweem mod_jk and mod_rewrite doesn't work as expected. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Thu, 28 Jun 2001 09:09:01 -0700, Keng Wong wrote: Jason, The JkMount directives are: JkMount /examples/servlet/* ajp13 JkMount /examples/*.jsp ajp13 I believe only these are passed to the servlet engine and not the entire site. Thanks for your response. -keng wong -Original Message- From: Jason Koeninger [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 28, 2001 8:06 AM To: [EMAIL PROTECTED] Subject: Re: apache mod_rewrite, mod_jk What do your JkMount directives look like? If you've done something like: JkMount /examples/* ajp13 I would think this would work fine (assuming the rewrite rule is done correctly...I'm no expert), but if you did something like: JkMount /hello ajp13 I can see where there would be problems. You, of course, don't want to mount the url you're trying to rewrite If you're doing something like: JkMount /* ajp13 Then, I think you should back off and only mount the servlets until you get your rewrite rule done correctly. I also don't know the interaction of mod_jk and mod_rewrite if they have competing entries so that may cause you some more trouble if you're pushing the whole site through to Tomcat. Hope that helps. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Wed, 27 Jun 2001 23:08:23 -0700, William Wong wrote: Hi, I had tried to setup mod_rewrite with mod_jk (ajp12 ajp13) but with no luck whatsoever. Even tried the approach mentioned in some of the postings (dated Feb 2001) but without success. The setup: jdk1.3 (Sun) RH7.1 apache-1.3.20 (DSO) tomcat-3.2.2 (downloaded from jakarta.apache.org) mod_jk.so (eapi) - downloaded from jakarta.apache.org httpd.conf: LoadModule jk_module libexec/mod_jk.so AddModule mod_jk.c LoadModule rewrite_module libexec/mod_rewrite.so AddModule mod_rewrite.c LoadModule ssl_module libexec/libssl.so AddModule mod_ssl.c IfModule mod_rewrite.c RewriteEngine on RewriteRule ^/hello(.*) /examples/servlet/HelloWorldExample$1 [PT] /IfModule Include /install/jakarta-tomcat-3.2.2/conf/mod_jk.conf ---[END OF httpd.conf] The mod_jk.conf is copied from the mod_jk.conf-auto but the LoadModule is remarked. The following link works: http://localhost/examples/servlet/HelloWorldExample The following does not: http://localhost/hello The error on the screen: Not Found(404) Original request:/hello Not found request:/hello Tomcat log (mod_jk.log) shows: -MM-DD 00:00:00 - Ctx( ):404 R( + /hello + null) null Appreciate all the help I can get. Thanks for your time and attention. -keng wong
RE: Problems with Tomcat behind a firewall
Howler, Firstly, your website is accessible from outside. Secondly, I suspect it's the dreaded 'trailing slash' problem. These urls will work for you - just tried them :) http://howler.hn.org/examples/ http://howler.hn.org/examples/servlet/HelloWorldExample -keng wong -Original Message- From: Howler D. Wolfe [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 21, 2001 6:06 PM To: [EMAIL PROTECTED] Subject: Problems with Tomcat behind a firewall Hello everyone, I've currently got Mandrake 8.0, Apache 1.3.19, and Tomcat 3.2.2 setup on a server at my home. I've been able to get Apache w/mod_jk and Tomcat setup. Everything seems to be working fine behind the Linksys router. All examples, both JSP and Servlet work flawlessly behing the firewall. However when I try http://howler.hn.org/examples from a machine outside my home the page with the examples never displays. It times out. I have port 80 and 21 forwarded to the Linux server. Is there something in a config file I missed? Is there a port that needs to be opened on the routre? Please help. Thank you in advance John Brosan
RE: Problems with Tomcat behind a firewall
It's more of a configuration rather than a 'problem'. You may want to try the RewriteRule directive within apache. -keng wong -Original Message- From: Howler D. Wolfe [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 21, 2001 6:42 PM To: [EMAIL PROTECTED] Subject: RE: Problems with Tomcat behind a firewall Keng, Thanks for the info. Is there anyway to get past the dreaded 'trailing slash' problem? -Original Message- From: Keng Wong [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 21, 2001 3:41 PM To: [EMAIL PROTECTED] Subject: RE: Problems with Tomcat behind a firewall Howler, Firstly, your website is accessible from outside. Secondly, I suspect it's the dreaded 'trailing slash' problem. These urls will work for you - just tried them :) http://howler.hn.org/examples/ http://howler.hn.org/examples/servlet/HelloWorldExample -keng wong -Original Message- From: Howler D. Wolfe [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 21, 2001 6:06 PM To: [EMAIL PROTECTED] Subject: Problems with Tomcat behind a firewall Hello everyone, I've currently got Mandrake 8.0, Apache 1.3.19, and Tomcat 3.2.2 setup on a server at my home. I've been able to get Apache w/mod_jk and Tomcat setup. Everything seems to be working fine behind the Linksys router. All examples, both JSP and Servlet work flawlessly behing the firewall. However when I try http://howler.hn.org/examples from a machine outside my home the page with the examples never displays. It times out. I have port 80 and 21 forwarded to the Linux server. Is there something in a config file I missed? Is there a port that needs to be opened on the routre? Please help. Thank you in advance John Brosan
RE: Session with IE
I'm also having a problem with SingleSignOn (SSO) using 2 different webapps on Tomcat 4. The cookie works with the jsp example within 1 webapp but the SSO did not work. Log shows SSO cookie is not present. The only cookie tht gets set is the JSESSION cookie by the jsp app. Does anyone have any clues ? Thanks. -keng wong -Original Message- From: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 11:02 AM To: '[EMAIL PROTECTED]' Subject: RE: Session with IE Hola Jose Luis: I think you are having problems with cookies, is the only way i see it failing.. Please access the http://localhost:8080/examples/jsp/security/ URL in your installed tomcat, and try to use the Cookies auth to see if works, if not, i'm almost sure the problem is on your browser ( check to see if it can store cookies ) , if not everything goes fine ( as it should ) , the problem is on your app..so be carefull
SSO cookie is not present
Downloaded T4-b5 and tried configuring SSO (SingleSignOn) with FORM authentication. When the first webapp gets executed, the SSO cookie is not set (in browser). Here are my properties: server.xml: Engine name=Standalone defaultHost=localhost debug=3 Realm className=org.apache.catalina.realm.MemoryRealm / Host name=localhost debug=1 appBase=webapps unpackWARs=true Valve className=org.apache.catalina.authenticator.SingleSignOn debug=1/ .. /Host /Engine Made a duplicate webapp called test2 from example. Tried the example jsp/security/protected. Both webapps contains the same web.xml: security-constraint display-nameExample Security Constraint/display-name web-resource-collection web-resource-nameProtected Area/web-resource-name !-- Define the context-relative URL(s) to be protected -- url-pattern/jsp/security/protected/*/url-pattern !-- If you list http methods, only those methods are protected -- http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint !-- Anyone with one of the listed roles may access this area -- role-nametomcat/role-name role-namerole1/role-name /auth-constraint /security-constraint !-- Default login configuration uses form-based authentication -- login-config auth-methodFORM/auth-method realm-nameExample Form-Based Authentication Area/realm-name form-login-config form-login-page/jsp/security/login/login.jsp/form-login-page form-error-page/jsp/security/login/error.jsp/form-error-page /form-login-config /login-config This is what the log shows: 2001-06-14 02:53:52 SingleSignOn[localhost]: Process request for '/test2/jsp/security/protected/index.jsp' 2001-06-14 02:53:52 SingleSignOn[localhost]: Checking for SSO cookie 2001-06-14 02:53:52 SingleSignOn[localhost]: SSO cookie is not present 2001-06-14 02:53:52 StandardHost[localhost]: Mapping request URI '/test2/jsp/security/protected/index.jsp' 2001-06-14 02:53:52 StandardHost[localhost]: Mapped to context '/test2' 2001-06-14 02:54:01 SingleSignOn[localhost]: Process request for '/test2/jsp/security/protected/index.jsp' 2001-06-14 02:54:01 SingleSignOn[localhost]: Checking for SSO cookie 2001-06-14 02:54:01 SingleSignOn[localhost]: SSO cookie is not present 2001-06-14 02:54:01 StandardHost[localhost]: Mapping request URI '/test2/jsp/security/protected/index.jsp' 2001-06-14 02:54:01 StandardHost[localhost]: Mapped to context '/test2' 2001-06-14 02:54:01 jsp: init 2001-06-14 02:54:01 SessionListener: sessionCreated('50E620234093A0539630028227494569') 2001-06-14 02:54:18 SingleSignOn[localhost]: Process request for '/test2/jsp/security/protected/index.jsp' 2001-06-14 02:54:18 SingleSignOn[localhost]: Checking for SSO cookie 2001-06-14 02:54:18 SingleSignOn[localhost]: SSO cookie is not present 2001-06-14 02:54:18 StandardHost[localhost]: Mapping request URI '/test2/jsp/security/protected/index.jsp' 2001-06-14 02:54:18 StandardHost[localhost]: Mapped to context '/test2' Thanks. -- keng wong