# Set properties for worker named ajp13 to use ajp13 protocol, Create the " workers.properties" file and place it in " d:\myproject\tomcat\conf" as follows: Next, observe that the configuration refers to a worker file called " workers.properties", and forward certain requests to a JK worker called " ajp13". (You can of course add those statements into " nf" directly.) The include statement simply appends all the statements from the file " d:\myproject\tomcat\conf\mod_jk.conf" into " nf". Note: Unix's forward slash is used as the directory separator instead of backward slash (because Apache was originally built for Unix). Include d:/myproject/tomcat/conf/mod_jk.conf Include the above configuration directives into the Apache's configuration by adding the following include statement at the end of " d:\myproject\apache\conf\nf": (Check the URL of the Tomcat's servlet and JSP examples from the Tomcat's welcome page! It may move!) In the above configuration, Apache forwards all requests to web contexts " /examples" and " /ws" to Tomcat, via a "worker" called " ajp13". # Send everything for context /examples to worker ajp13įor each web context that is to be forwarded from Apache to Tomcat, include two JKMount statements as shown. # Send everything for context /ws to worker ajp13 # JkRequestLogFormat set the request format JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkOptions indicate to send SSL KEY SIZE, JkLogFile d:/myproject/tomcat/logs/mod_jk.log # Update this path to match your logs directory location JkWorkersFile d:/myproject/tomcat/conf/workers.properties # Update this path to match your conf directory location # Update this path to match your modules location Step 2: Configure Apache - We need to configure the Apache HTTP Server to load and initialize the JK module.Ĭreate a configuration file called " mod_jk.conf" as follows and place it in " d:\myproject\tomcat\conf": Rename the downloaded module to " mod_jk.so" and move into directory " d:\myproject\apache\modules". Step 1: Download the Apache-Tomcat Connector Module -Īn Apache-Tomcat connector - JK1.2 module - which is an adapter module used by Apache to communicate with Tomcat (using AJP v1.3 protocol through TCP port 8009), can be downloaded from Tomcat mother site (⇒ Download ⇒ Tomcat Connectors ⇒ JK 1.2 ⇒ JK 1.2 Binary Releases ⇒ win32 ⇒ jk-1.2.xx ⇒ " mod_jk-1.2.xx-httpd-2.2.x.so"). I shall denote Tomcat's installed directory as $CATALINA_HOME (Catalina is the code name for Tomcat 5 and above). Tomcat's shall contains two web contexts: " /examples" (Tomcat's servlets and JSP examples) and " /ws" (to be created by you). I shall assume that Tomcat is installed in directory " d:\myproject\tomcat", runs on port 8080. I shall denote the apache installed directory as $APACHE_HOME. I shall assume that Apache is installed in directory " d:\myproject\apache", and runs on port 7000. I will only describe the JK1.2 module with Apache 2 here. There are a few adapter modules available, such as Apache JServ Protocol (AJP) v1.2 "JServ" module (outdated), AJP v1.3 "JK 1.2" module (in use) and "JK 2" module (deprecated). If so, it lets the adapter takes the request and forwards it to Tomcat, as illustrated below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |