Install/integrate/configure Tomcat 5.0.20 and Apache 2 in Linux
Preface
Official Website
Http://jakarta.apache.org/tomcat/connectors-doc/
2004/11/15/has announced that JK2 will not be further developed.
The reason is that the installation and configuration of JK2 are complex and difficult to attract developers' interest. (Note: JK2 is still usable, not to mention any fatal vulnerability in JK2)
In the future, httpd2.1 will be integrated into the new proxy_ajp, and the new proxy_balancer will be developed for load balancing.
Either wait quietly or check the following document for JK2 configuration.
References
Tomcat5.0.20 + apache2.0.47 + JK2 for Linux
Http://www.javaworld.com.tw/jute/post/view? Bid = 9 & id = 48815 & TPG = 3 & PPG = 1 & sty = 1 & age = 0 #48815
<JSP Technical Manual>
Official Website
Http://jakarta.apache.org/tomcat/connectors-doc/
[Help] Apache + Tomcat integration problems
Http://www.matrix.org.cn/forum_view.asp? Forum_id = 17 & view_id = 12656
My understanding of Apache + Tomcat + JK2 Integration
Http://www.kehui.net/html/article/23/23791.html
Focus on the first three items
Required software packages
Httpd-2.0.52.tar.gz
Jakarta-tomcat-5.5.7.tar.gz
Jdk-1_5_0_01-linux-i586.bin
Jakarta-tomcat-connectors-jk2-src-current.tar.tar (author note: the version is 2.0.2)
Libtool-1.5.tar.gz (required in some Linux environments, I don't use it. See <JSP Technical Manual>)
Installation Process
Install JDK
For more information, see
JDK installation and environment variable configuration in Linux
Http://blog.csdn.net/sswt/archive/2004/08/19/79471.aspx
Install Apache
Case requiring: httpd-2.0.52.tar.gz
Dynamic Action:
Release your own-tar xvfz httpd-2.0.47.tar.gz
Security guard
CD httpd-2.0.47
./Configure -- prefix =/usr/local/Apache -- enable-so
(Note: prefix indicates the path for Apache installation. The default value is/usr/local/Apache)
(Note: Enable corresponds to the key file mod_jk2.so needed later)
Make
Make install
Set-Modify httpd. conf
Change Listen 80 to listen <your IP>: 80
Change servername to servername (The above two regions are visible for IP addresses)
Add index. jsp after finding directoryindex
Find adddefacharcharset XXX and add it at the beginning # mark it to invalidate it
(This setting can be set by myself, I use a UTF-8)
Install Tomcat
Case requiring: jakarta-tomcat-5.0.20.tar.gz
Dynamic Action:
Release your own-tar xvfz jakarta-tomcat-5.0.20.tar.gz
Security guard
Music jakarta-tomcat-5.0.20/usr/local/
Ln-S/usr/local/jakarta-tomcat-5.0.20/usr/local/tomcat
Open/usr/local/tomcat/bin/Catalina. SH and add
Java_home =/usr/local/Java/catalina_home = "/usr/local/tomcat /"
Install JK2 connector [Key]
Case requiring: jakarta-tomcat-connectors-jk2-src.tar.gz
Dynamic Action:
Release your own-tar xvfz jakarta-tomcat-connectors-jk2-src.tar.gz
Security guard
CD jakarta-tomcat-connectors-jk2/JK/native2
./Buildconf. Sh
./Configure -- with-apxs2 =/usr/local/Apache/bin/apxsmake
Cp jk/build/JK2/apache2/mod_jk2.so/usr/local/Apache/modules
Set
[Key] add httpd. conf to the conf resource configuration under Apache Project
Loadmodule jk2_module modules/mod_jk2.so
In httpd. conf, find DocumentRoot and change it to "/usr/local/tomcat/webapps/" (this operation is a satisfactory decision)
[Key]
Copy workers2.properties under/jakarta-tomcat-connectors-jk2-2.0.2-src/JK/CONF/
/Apache/CONF/
[Key] modifying files
VI/usr/local/Apache/CONF/workers2.properties
Add an application directory pointing to Tomcat/webapp/at the end, for example
# Map the Tomcat examples webapp to the Web server URI Space
[URI:/JSP-examples/*]
Info = map the whole webapp
[Key] modifying files
VI/usr/local/tomcat/CONF/jk2.properties
# List of needed handlers.
Handler. List = channelsocket, request
# Override the default port for the channelsocket
Channelsocket. Port = 8009
Set Environment Variables
VI/etc/profile
Add
Export java_home =/usr/local/Java
Export Path = $ path: $ java_home/bin: $ java_home/JRE
Export classpath = $ java_home/lib: $ java_home/lib/tools. Jar
Export catalina_home =/usr/local/tomcat
Export catalina_base =/usr/local/tomcat
(Note: I only added export catalina_home =/usr/local/tomcat, which was originally available in Java)
Start, close, and test
Start
/Tomcat/bin/Catalina. Sh start
/Apache/bin/apachectl start
Close
/Tomcat/bin/Catalina. Sh stop
/Apache/bin/apachectl stop
Test
Http: // 202.108.39.179/JSP-examples/
If the JSP-examples/page of Tomcat appears