1. Download Apache, Tomcat, Jakarta-Tomcat-Connectors http://httpd.apache.org/download.cgihttp://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgihttp://apache.justdn. ORG / JAKARTA / TOMCAT-Connectors / JK2 / JAKARTA-TOMCAT-Connectors-jk2-src-current.tar.gz
2. Compilation and install Apache 2.0.53 # ./configure --prefix = / usr / local / apache # Install Apache to / usr / local / apache directory # make # make install
3. Unpacking installation Tomcat 5.0.28
TAR-ZXVF JAKARTA-TOMCAT-5.0.28.tar.gz -c / opt / tomcat28
4. Compile the integrator of Tomcat and Apache (Jakarta-Tomcat-Connectors Ver.2.0.4)
(1) Unzip the downloaded package to / backup. (2) Enter the directory #CD /BACKUP/JAKARTA-TOMCAT-CONNECTORS-JK2-2.0.4-src/jk/native2 (3) Compile installation #. / Configure --with-apxs2 = / usr / local / apache / bin / apxs # make # cd ../build/jk2/apache2#/usr/local/apache/bin/apxs -n jk2 -i mod_jk2.so
(4) Edit Apache Profile /usR/local/apache/conf/httpd.conf Add to the following line: LoadModule JK2_Module Modules / Mod_jk2.so
(5) Editing the text file called Workers2.Properties in / usr / local / apache / conf / directory, the content is: Code: [Logger] level = Error
[config:] file = / usr / local / apache / conf / workers2.propertiesdebug = 0debugev = 0
# Alternate file logger [logger.file] # level = debuglevel = errorfile = / var / log / httpd / jk2.log
[shm:] info = scoreboard. Required for reconfiguration and status with multiprocess serversfile = / var / log / httpd / jk2.shmsize = 1048576Debug = 0disabled = 0
[Channel.Socket: localhost: 8009] info = ajp13 forwarding over socketdebug = 0tomcatid = localhost: 8009keepalive = 1
[AJP13: Localhost: 8009] Channel = Channel. Socket: Localhost: 8009Debug = 0
[status:] info = status worker, displays runtime informations
[URI: / JKSTATUS / *] Info = Display Status Information and Checks the config file for changes.worker = ajp13: localhost: 8009
[URI: / *. jsp] worker = ajp13: localhost: 8009context = / (6) Modify /opt/tomcatapache/conf/server.xml, in
Save exit. (7) Test a) Method 1: Firefox Address Bar Enter http: // localhost / example /, see JSP Samples and its two icons link. B) Method 2: Edit a Test.jsp file under / usr / local / apache / htdocs, the content is the following five lines: Code: <% @ page language = "java" contenttype = "text / html; charSet = GB2312"%% > <% out.print ( " This is JSP's test page font>
!");%> Hello The time is now <% = new java.util.Date! ()%>
Enter http://localhost/test.jsp: //localhost/test.jsp, have output below?
THIS JSP's Test Page! Hello! The Time Is Now Fri Apr 15 15:07:09 CST 2005
OK, all the work will come to a paragraph, very good!
Reference: http://www.linuxfans.org/nuke/modules.php? Name = forums & file = viewtopic & t = 107525 & highlight =