>From what I can see, it should work. So you can browse >http://someserver:8080/examples on the server where Tomcat is installed, right? >Also, there just to be on the safe side, your network allows communication from one >machine to another on port 8009. Try using telnet to access the server running >tomcat from a seperate computer to see if the port is even accessible. Or if you >have nmap, scan the tomcat box to see what ports are open or accessible. I performed >a similar setup on a couple of test servers and it worked. One machine was running >apache on linux and the other was running tomcat on windows.
I am running out of things to tell ya. Anyone else want to take a stab at this??? Of course looking at your logs more closely, these lines here would assume that you are connecting the examples context?? [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker [jk_uri_worker_map.c (477)]: Attempting to map URI '/examples' [jk_uri_worker_map.c (491)]: jk_uri_worker_map_t::map_uri_to_worker, Found an exact match ajp13 -> /examples Randall -----Original Message----- From: Hari Om [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:15 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; Randall Svancara Subject: RE: Apache+Tomcat + MOD_JK on different machine NO...I am still struglling....wonder why..... Please check the logs 3 files.... ---------------- ERROR_LOG ---------------- [Tue Mar 23 15:50:39 2004] [notice] Apache/2.0.47 (Unix) mod_jk/1.2.2 configured -- resuming normal operations ------------- ACCESS_LOG ------------- [23/Mar/2004:15:51:33 -0700] "GET / HTTP/1.1" 200 1456 [23/Mar/2004:15:51:40 -0700] "GET /examples HTTP/1.1" 400 0 --------------- MOD_JK.LOG --------------- [jk_uri_worker_map.c (172)]: Into jk_uri_worker_map_t::uri_worker_map_alloc [jk_uri_worker_map.c (375)]: Into jk_uri_worker_map_t::uri_worker_map_open [jk_uri_worker_map.c (396)]: jk_uri_worker_map_t::uri_worker_map_open, rule map size is 4 [jk_uri_worker_map.c (345)]: Into jk_uri_worker_map_t::uri_worker_map_open, exact rule /examples=ajp13 was added [jk_uri_worker_map.c (321)]: Into jk_uri_worker_map_t::uri_worker_map_open, match rule /examples/=ajp13 was added [jk_uri_worker_map.c (345)]: Into jk_uri_worker_map_t::uri_worker_map_open, exact rule /abc=ajp13 was added [jk_uri_worker_map.c (321)]: Into jk_uri_worker_map_t::uri_worker_map_open, match rule /abc/=ajp13 was added [jk_uri_worker_map.c (408)]: Into jk_uri_worker_map_t::uri_worker_map_open, there are 4 rules [jk_uri_worker_map.c (422)]: jk_uri_worker_map_t::uri_worker_map_open, done [jk_worker.c (88)]: Into wc_open [jk_worker.c (222)]: Into build_worker_map, creating 1 workers [jk_worker.c (228)]: build_worker_map, creating worker ajp13 [jk_worker.c (148)]: Into wc_create_worker [jk_worker.c (162)]: wc_create_worker, about to create instance ajp13 of ajp13 [jk_ajp13_worker.c (108)]: Into ajp13_worker_factory [jk_worker.c (171)]: wc_create_worker, about to validate and init ajp13 [jk_ajp_common.c (1219)]: Into jk_worker_t::validate [jk_ajp_common.c (1239)]: In jk_worker_t::validate for worker ajp13 contact is utahdiseasereport.utah.gov:8009 [jk_ajp_common.c (1267)]: Into jk_worker_t::init [jk_ajp_common.c (1287)]: In jk_worker_t::init, setting socket timeout to 0 [jk_worker.c (187)]: wc_create_worker, done [jk_worker.c (238)]: build_worker_map, removing old ajp13 worker [jk_worker.c (250)]: build_worker_map, done [jk_worker.c (111)]: wc_open, done 1 [jk_worker.c (118)]: Into wc_close [jk_worker.c (199)]: close_workers got 1 workers to destroy [jk_worker.c (206)]: close_workers will destroy worker ajp13 [jk_ajp_common.c (1324)]: Into jk_worker_t::destroy [jk_ajp_common.c (1331)]: Into jk_worker_t::destroy up to 1 endpoint to close [jk_worker.c (120)]: wc_close, done [jk_uri_worker_map.c (190)]: Into jk_uri_worker_map_t::uri_worker_map_free [jk_uri_worker_map.c (441)]: Into jk_uri_worker_map_t::uri_worker_map_close [jk_uri_worker_map.c (172)]: Into jk_uri_worker_map_t::uri_worker_map_alloc [jk_uri_worker_map.c (375)]: Into jk_uri_worker_map_t::uri_worker_map_open [jk_uri_worker_map.c (396)]: jk_uri_worker_map_t::uri_worker_map_open, rule map size is 4 [jk_uri_worker_map.c (345)]: Into jk_uri_worker_map_t::uri_worker_map_open, exact rule /examples=ajp13 was added [jk_uri_worker_map.c (321)]: Into jk_uri_worker_map_t::uri_worker_map_open, match rule /examples/=ajp13 was added [jk_uri_worker_map.c (345)]: Into jk_uri_worker_map_t::uri_worker_map_open, exact rule /abc=ajp13 was added [jk_uri_worker_map.c (321)]: Into jk_uri_worker_map_t::uri_worker_map_open, match rule /abc/=ajp13 was added [jk_uri_worker_map.c (408)]: Into jk_uri_worker_map_t::uri_worker_map_open, there are 4 rules [jk_uri_worker_map.c (422)]: jk_uri_worker_map_t::uri_worker_map_open, done [jk_worker.c (88)]: Into wc_open [jk_worker.c (222)]: Into build_worker_map, creating 1 workers [jk_worker.c (228)]: build_worker_map, creating worker ajp13 [jk_worker.c (148)]: Into wc_create_worker [jk_worker.c (162)]: wc_create_worker, about to create instance ajp13 of ajp13 [jk_ajp13_worker.c (108)]: Into ajp13_worker_factory [jk_worker.c (171)]: wc_create_worker, about to validate and init ajp13 [jk_ajp_common.c (1219)]: Into jk_worker_t::validate [jk_ajp_common.c (1239)]: In jk_worker_t::validate for worker ajp13 contact is utahdiseasereport.utah.gov:8009 [jk_ajp_common.c (1267)]: Into jk_worker_t::init [jk_ajp_common.c (1287)]: In jk_worker_t::init, setting socket timeout to 0 [jk_worker.c (187)]: wc_create_worker, done [jk_worker.c (238)]: build_worker_map, removing old ajp13 worker [jk_worker.c (250)]: build_worker_map, done [jk_worker.c (111)]: wc_open, done 1 [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker [jk_uri_worker_map.c (477)]: Attempting to map URI '/' [jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker [jk_uri_worker_map.c (477)]: Attempting to map URI '/index.html' [jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker [jk_uri_worker_map.c (477)]: Attempting to map URI '/index.html.var' [jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker [jk_uri_worker_map.c (477)]: Attempting to map URI '/index.html.en' [jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker [jk_uri_worker_map.c (477)]: Attempting to map URI '/examples' [jk_uri_worker_map.c (491)]: jk_uri_worker_map_t::map_uri_to_worker, Found an exact match ajp13 -> /examples [mod_jk.c (1671)]: Into handler r->proxyreq=0 r->handler=jakarta-servlet r->notes=269677136 worker=ajp13 [jk_worker.c (132)]: Into wc_get_worker_for_name ajp13 [jk_worker.c (136)]: wc_get_worker_for_name, donefound a worker [mod_jk.c (488)]: agsp=80 agsn=serph.health.utah.gov hostn=serph.health.utah.gov shostn=serph.health.utah.gov cbsport=80 sport=80 [jk_ajp_common.c (1404)]: Into jk_worker_t::get_endpoint [jk_ajp_common.c (1116)]: Into jk_endpoint_t::service [jk_ajp_common.c (295)]: Into ajp_marshal_into_msgb [jk_ajp_common.c (432)]: ajp_marshal_into_msgb - Done [jk_connect.c (158)]: Into jk_open_socket [jk_connect.c (165)]: jk_open_socket, try to connect socket = 10 [jk_connect.c (174)]: jk_open_socket, after connect ret = 0 [jk_connect.c (183)]: jk_open_socket, set TCP_NODELAY to on [jk_connect.c (200)]: jk_open_socket, return, sd = 10 [jk_ajp_common.c (614)]: In jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 10 [jk_ajp_common.c (642)]: sending to ajp13 #465 [jk_ajp_common.c (884)]: ajp_send_request 2: request body to send 0 - request body to resend 0 [jk_ajp_common.c (729)]: received from ajp13 #33 [jk_ajp_common.c (483)]: ajp_unmarshal_response: status = 400 [jk_ajp_common.c (488)]: ajp_unmarshal_response: Number of headers is = 1 [jk_ajp_common.c (532)]: ajp_unmarshal_response: Header[0] [Content-Type] = [text/html] [jk_ajp_common.c (729)]: received from ajp13 #2 [jk_ajp_common.c (1382)]: Into jk_endpoint_t::done, recycling connection >From: "Randall Svancara" <[EMAIL PROTECTED]> >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]> >To: "Hari Om" ><[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>,<[EMAIL PROTECTED]> >CC: <[EMAIL PROTECTED]> >Subject: RE: Apache+Tomcat + MOD_JK on different machine >Date: Wed, 24 Mar 2004 13:41:46 -0700 > >So, did you ever get this working then?? > > >-----Original Message----- >From: Hari Om [mailto:[EMAIL PROTECTED] >Sent: Wednesday, March 24, 2004 7:52 AM >To: [EMAIL PROTECTED]; Randall Svancara; >[EMAIL PROTECTED] >Cc: [EMAIL PROTECTED] >Subject: RE: Apache+Tomcat + MOD_JK on different machine > > >Thanks again Randall and Henry for your reply... appreciate that! > >When I try http://my_web_server/abc, it shows "HTTP 400-Bad Request" >BUT when I try http://my_web_server/pqr, it shows "HTTP 404 - File Not >Found" >BUT when I try http://my_web_server, it works fine...which means that >APACHE >IS NOT SENDING THE REQUEST to TOMCAT....wonder why. > >I've added workers.properties in my conf directory on Web Server. >I also have MOD_JK.CONF file there. > >-------------------- >WORKERS.PROPERTIES >-------------------- >worker.list=ajp13 >worker.ajp13.port=8009 >worker.ajp13.host=102.103.103.1 >#the above is IP of my App Server >worker.ajp13.type=ajp13 > >-------------------- >mod_jk.conf >-------------------- > Include "conf/mod_jk.conf" > JkWorkersFile "conf/workers.properties" > Include "conf/mod_jk.conf" > JkLogFile "logs/mod_jk.log" > JkLogLevel debug > JkMount /examples ajp13 > JkMount /examples/* ajp13 > JkMount /abc ajp13 > JkMount /abc/* ajp13 > >-------------------- >HTTPD.CONF >-------------------- > JkWorkersFile "conf/workers.properties" > JkLogFile "logs/mod_jk.log" > JkLogLevel debug > JkMount /examples ajp13 > JkMount /examples/* ajp13 > JkMount /abc ajp13 > JkMount /abc/* ajp13 > > > > From: "Randall Svancara" <[EMAIL PROTECTED]> >To: "Hari Om" <[EMAIL PROTECTED]>,"Tomcat Users List" ><[EMAIL PROTECTED]> >Subject: RE: Apache+Tomcat + MOD_JK on different machine >Date: Tue, 23 Mar 2004 09:21:36 -0700 > >Your workers.properties should be on your webserver where apache is >located. > I typically place the workers.properties in the same directory where >httpd.conf is located. > >workers.properties is needed for mod_jk so it makes sense that it needs to >be in the same machine where mod_jk and apache are installed. At least far >as I know anyways. Sometimes apache has a difficult time finding it. I >have >used this line to tell apache where to find the workers.properties. You >might try >including a line like this in your apache configuration file: > > ><IfModule mod_jk.c> > JkSet config.file /etc/apache2/conf/workers.properties > Include /etc/apache2/conf/mod_jk2.conf ></IfModule> > >If anyone else has anything to add to this or correct me on, please feel >free because I am still learning to, but then again who isn't?? >I hope that helps. > >-----Original Message----- >From: Hari Om [mailto:[EMAIL PROTECTED] >Sent: Tuesday, March 23, 2004 8:56 AM >To: [EMAIL PROTECTED] >Cc: Randall Svancara >Subject: RE: Apache+Tomcat + MOD_JK on different machine > > >Thanks Randall for your reply... appreciate that! > >My MOD_JK.CONF file is AUTOGENERATED on my AppServer. I start my App Server >FIRST which AUTOGENERATES "mod_jk.conf" file. So, how can I reference this >file on my HTTPD.CONF ("Include conf/mod_jk.conf") - which is indeed >located >on a different machine? > >Where should I place my workers.properties? should it be on App Server or >Web Server? > >Should I first start App Server or Web Server or it does'nt matter? > >In my HTTPD.CONF I have different mount points (example 'abc') so when I >type http://IPADDRESS/abc it shows "HTTP 400 Bad Request" on my browser >Howevere, when I type http://IPADDRESS/lmn it shows "HTTP 404 Page Not >Found" (Note: lmn is not added a JKMount in my Httpd.conf) > >My MOD_JK.log file shows it added all the JKMounts. >My ACCESS_LOG file shows: >[23/Mar/2004:08:44:05 -0700] "GET /abc HTTP/1.1" 400 0 >[23/Mar/2004:08:50:24 -0700] "GET /lmn HTTP/1.1" 404 301 > > >My ERROR_LOG file shows: >[Tue Mar 23 08:41:46 2004] [notice] Apache/2.0.47 (Unix) mod_jk/1.2.2 >configured -- resuming normal operations > >Any related information on above is appreciated. > >THANKS again! > >HARI OM > > > > >From: "Randall Svancara" <[EMAIL PROTECTED]> > >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]> > >To: "Tomcat Users List" <[EMAIL PROTECTED]> > >Subject: RE: Apache+Tomcat + MOD_JK on different machine Date: Tue, 23 >Mar > >2004 08:15:40 -0700 > > > >I would leave your httpd.conf file the same as you have it shown below. >I > >would also confirm in you logs that everything is working ok. However, > >Apache should not even startup if the included configuration file, > >mod_jk.conf is not present. > > > >------------------------------ > >httpd.conf (on Web Server) > >------------------------------ > >LoadModule jk_module modules/mod_jk.so > >ServerName xyz.com > > > >Include conf/mod_jk.conf > > > >JkWorkersFile "conf/workers.properties" > >JkLogFile "logs/mod_jk.log" > > > >JkLogLevel debug > > > >JkMount /examples ajp13 > >JkMount /examples/* ajp13 > > > > > >The trick here is to make some changes to your workers.properties in >order > >to connect to another box. > >It looks as if your are trying to configure a load balancer. If you are > >connecting to only one instance > >of tomcat this is not necessary. Also you need to look in your >server.xml > >and see that you have the coyote connector > >running on port 8009. I would exclude the line: worker.ajp13.lbfactor=5 > >from this configuration. Besides, you have not defined > >a worker for load balancer, so i believe this line is not necessary. > >I would probably write your workers.properties files the following way: > > > >------------------------------------ > >workers.properties (on Web Server) > >------------------------------------ > > > >workers.CATALINA_HOME=/usr/local/tomcat4 > >workers.java_home=$(JAVA_HOME) > >ps=/ > > > >worker.list=ajp13 > >worker.ajp13.port=8009 > >worker.ajp13.host=101.102.103.104 > >#above is IP address of abc.com > >worker.ajp13.type=ajp13 > >#Remove the following line. > >#worker.ajp13.lbfactor=5 > > > > > > > >I am going to send you my workers.properties for reference. IF AND ONLY >IF > >you do configure a load balancer, then make sure in your server.xml to > >change following line from: > > <Engine name="Standalone" defaultHost="localhost" debug="0"> > > > >to > > > > <Engine name="Standalone" defaultHost="localhost" debug="0" > >jvmRoute="worker2" > > >This is necessary for load balancing. The value of jvmRoute should be > >equal to the worker that you want to connect to that particular instance >of > >tomcat. > > > > > >#*****Begin worker.properties***** > ># > >worker.worker2.type=ajp13 > >worker.worker1.type=ajp13 > ># > >#Specifies the load balance factor when used with a load balancing >worker. > >#Note: > >#-----> lbfactor must be > 0 > >#-----> Low lbfactor means less work done by the worker. > ># > >worker.worker1.lbfactor=1 > >worker.worker2.lbfactor=10 > ># > >#Specify the size of the open connection cache. > >#worker.ajp13.cachesize > ># > >#------DEFAULT LOAD BALANCER WORKER DEFINITION----------- > ># > >#The loadbalancer (type lb) worker perform weighted round-robin > >#load balancing with sticky sessions. > >#Note: > >#---> If a worker dies, the load balancer will check its state once > >#in a while. Until then all work is redirected to peer worker. > ># > >worker.loadbalancer.type=lb > >worker.loadbalancer.balanced_workers=worker2,worker1 > ># > >#worker.tomcat_home should point to the location where you installed > >#tomcat. This is where you have your conf, webapps and lib directories. > >#Note: Please make sure to enter the appropriate path from your machine. > ># > >worker.tomcat_home=/usr/local/tomcat > ># > >#worker.java_home should point to your Java installation. > >#Normally you should have a bin and lib directories beneath it. > >#Note: Please make sure to enter the appropriate path from your machine. > ># > >worker.java_home=/usr/local/java > ># > >#You should configure your environment slash...ps=\on NT and / on UNIX > >#and may be different elsewhere. > ># > >ps=/ > >#-------ADVANCED MODE------- > >#------------------------------ > ># > ># > >#-------DEFAULT worker list------ > >#---------------------------------- > ># > >#The worker that your plugins should create and work with > ># > >worker.list=worker2,loadbalancer, worker1 > ># > >#----DEFAULT ajp13 WORKER DEFINITION----- > ># > >#Defining a worker named ajp13 and of type ajp13 > >#Note that the name and the type do not have to match. > ># > >worker.worker2.port=8009 > >worker.worker2.host=localhost > >worker.worker2.cachesize=100 > >worker.worker2.cache_timeout=1000 > >worker.worker2.socket_keepalive=3 > >worker.worker2.socket_timeout=1000 > > > >worker.worker1.port=8019 > >worker.worker1.host=216.222.102.252 > >worker.worker1.cachesize=100 > >worker.worker1.cache_timeout=1000 > >worker.worker1.socket_keepalive=3 > >worker.worker1.socket_timeout=1000 > > > ># > >#*****End worker.properties***** > > > > > > > > > > > > > > > > > >------------------------------------ > >workers.properties (on Web Server) > >------------------------------------ > > > >workers.CATALINA_HOME=/usr/local/tomcat4 > >workers.java_home=$(JAVA_HOME) > >ps=/ > > > >worker.list=ajp13 > >worker.ajp13.port=8009 > >worker.ajp13.host=101.102.103.104 > >#above is IP address of abc.com > >worker.ajp13.type=ajp13 > >worker.ajp13.lbfactor=5 > > > > > > > >-----Original Message----- > >From: Hari Om [mailto:[EMAIL PROTECTED] > >Sent: Tuesday, March 23, 2004 7:58 AM > >To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > >Subject: Apache+Tomcat + MOD_JK on different machine > > > > > >SUBJECT: Apache+Tomcat + MOD_JK on different machine > > > >I am using Apache 2.0.47 and Tomcat 4.1.27 on my SuSE Linux. I had > >configured my mod_jk and it works just great! (My Web and App Server were > >on > >same box) > > > >Now I have a Web Server and App Server on a different box and was >wondering > >what changes do I have to make to "MOD_JK" for the Integration to work. > > > >My old settings were: > >---------- > >httpd.conf > >---------- > >LoadModule jk_module modules/mod_jk.so > >ServerName abc.com > > > >Include /usr/local/tomcat4/conf/auto/mod_jk.conf > > > >JkWorkersFile "/usr/local/apa2047/conf/workers.properties" > >JkLogFile "/usr/local/apa2047/logs/mod_jk.log" > > > >JkLogLevel debug > > > >JkMount /examples ajp13 > >JkMount /examples/* ajp13 > > > >-------------------- > >workers.properties > >-------------------- > > > >workers.CATALINA_HOME=/usr/local/tomcat4 > >workers.java_home=$(JAVA_HOME) > >ps=/ > > > >worker.list=ajp13 > >worker.ajp13.port=8009 > >worker.ajp13.host=101.102.103.104 > >#above is IP address of abc.com > >worker.ajp13.type=ajp13 > >worker.ajp13.lbfactor=5 > > > > > >Now that I have both APACHE and TOMCAT on DIFFERENT Boxes, I was >wondering > >what changes do I have to make for the above to work. > > > >My Web Server is "xyz.com" and my App Server is "abc.com". I have mod_jk > >configured in my Web Server. > > > >My new HTTPD.CONF file is: > >My NEW settings are: > >------------------------------ > >httpd.conf (on Web Server) > >------------------------------ > >LoadModule jk_module modules/mod_jk.so > >ServerName xyz.com > > > >Include conf/mod_jk.conf > > > >JkWorkersFile "conf/workers.properties" > >JkLogFile "logs/mod_jk.log" > > > >JkLogLevel debug > > > >JkMount /examples ajp13 > >JkMount /examples/* ajp13 > > > >------------------------------------ > >workers.properties (on Web Server) > >------------------------------------ > > > >workers.CATALINA_HOME=/usr/local/tomcat4 > >workers.java_home=$(JAVA_HOME) > >ps=/ > > > >worker.list=ajp13 > >worker.ajp13.port=8009 > >worker.ajp13.host=101.102.103.104 > >#above is IP address of abc.com > >worker.ajp13.type=ajp13 > >worker.ajp13.lbfactor=5 > >_________________________________________________________________ >Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ >Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]