My operating system is WIN XP, Apache and Tomcat installed in the following directory C: / Program Files / Apache Group / Apache2 version Apache_2.0.47c: / Program Files / Apache Group / Tomcat 4.1 Version 4.1 Although my Tomcat is 4.1 But I see 5.0 on the book is also the same. If you have any questions, you can tell me your version and the situation.
Integration 1. Download MOD_JK1.DLL, pay attention to my jk1.3 version, if you download the 1.4 version, the configuration may be different 2, copy the mod_jk1.dll to the apache2 / moudules directory 3, modify the HTTPD under the Apache2 / Conf directory .conf, increase the following configuration
LoadModule jk_module modules / mod_jk1.dllJkWorkersFile "C: / Program Files / Apache Group / Apache2 / conf / workers.properties" JkLogFile "C: / Program Files / Apache Group / Apache2 / logs / mod_jk.log" JkLogLevel severe
JKMOUNT / Web / * ajp13 jkmount /*.jsp Ajp13jkmount / Web-INF / * AJP13
Note: The path has a space to be quoted. "The JKMount configuration is to indicate that apache is based on the URL feature. 4. Built a WORKERS.PROPERTIES text file in Apache, add the following configuration
Workers.tomcat_home = "c: / program files / apache group / tomcat 4.1" # Let the Mod_JK module know the Tomcat installation path
Workers.java_home = C: / J2EESDK / JDK # Let the Mod_JK module know the JDK path
PS = / worker.list = ajp13 # This is the key, the name is consistent with httpd.conf. If you change this, httpd.conf is also changed.
Worker.ajp13.port = 8009 # Work port, Tomcat's JK listening port, you can view the Worker.ajp13.host = localhost #tomcat The machine is located, if you install different machines with apache, you need to set IP Worker.ajp13.type = ajp13 # type, it seems that you can't change, you will have problems. Worker.ajp13.lbFactor = 1 # This is not clear 5. After the above configuration, you have to check the port configuration. Under normal circumstances, the TOMCAT is listened to the 2 ports 8080 and 8009, where 8080 is a web service port. After the test is successful, the port can be turned off; 8009 is a port integrated with other web servers, they can modify in Server.xml. , Restart Tomcat after modification. Apache can also choose port 80 or 8080 when installing. It should be noted that the port does not conflict with Tomcat and you can select 80 port. 6, the setting of the settings, these, the configuration can be measured, my test situation is as follows: directly through the 8080 port to access Tomcat, write down one of the URLs, and modify the Apache configuration to map test. For example, I deployed a web service in Tomcat, URL as follows: http: // localhost: 8080 / Web / INDEX.HTMLHTTP: / / LOCALHOST: 8080 / Web / Services / HellossSionHttp: // localhost: 8080 / Web / Services / Hellosession? WSDL In order to turn all the URLs at all / web, I am adding JKMount / Web / * Ajp13 in httpd.conf. Then restart Apache, test http://localhost/web/index.htmlhttp: // localhost: 8080 / web / services / helloseession? WSDL with the following URL test. Find all requests to send down Tomcat, check Apache's logs / mod_jk.log, you can see the request and the received response to the send. 7. Summary MOD_JK.DLL is an interactive bridge between Apache and Tomcat, which is loaded by Apache's module. MOD_JK and TOMCAT are a model of Client / Server, so you have to know which port of Tomcat's JK is listening. Once integrated, you can close Tomcat's web port to save resources and reduce security risks. To make the Apache and Tomcat work well, the most critical is that your application is well design, making it good to handle this Tomcat processing by configuring a small amount of JKMount. 8. Expansion Apache can be configured to configure loadbalance so that multiple Tomcat can share handling services. This way Apache processes some static page calls, and complex logic processing, database processing has multiple Tomcat to share. Can greatly improve your website processing capabilities. The basic configuration of LoadBalance is also very simple, out of responsibility to yourself, I will send it to my blog after personally practice. Please continue to pay attention. In addition, Tomcat can be combined with JBoss, there is no problem when you need to use EJB. Because personal level is limited, it is inevitable. If you have any comments and suggestions, please don't know.