Article title: integrate RH3 + TOMCAT5 + APACHE2 + jk2. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Running environment: RedHat Enterprise 3.0
1. Instructions The purpose of this article is to integrate Apache and Tomcat with JK2 in the RH3 environment, without involving virtual hosts or PHP. the following steps may not be necessary.
Location of the configuration file:
Httpd. conf->/usr/local/apache/conf/httpd. conf
Workers2.properties->/usr/local/apache/conf/workers2.properties
Server. xml->/usr/local/tomcat/conf/server. xml
Jk2.properties->/usr/local/tomcat/conf/jk2.properties
II. installation steps JDK: rps-ivh j2sdk-1_4_2_03-linux-i586.rpm
Apache: tar xvfz httpd-2.0.49.tar.gz
Cd httpd-2.0.47
./Configure -- prefix =/usr/local/apache -- enable-so
Make
Make install
(Note: No Web service is installed when RH3 is installed)
Tomcat: tar xvfz jakarta-tomcat-5.0.19.tar.gz
Edit the file/usr/local/tomcat/bin/catalina. sh
Insert the following lines after the comment line:
JAVA_HOME =/usr/local/jdk/
CATALINA_HOME = "/usr/local/tomcat /"
JAVA_OPTS = "-Xms256m-Xmx256m"
Add users and groups:
Groupadd tomcat
Useradd-g tomcat-c "Tomcat User"-d/usr/local/tomcat
Chown-R tomcat: tomcat/usr/local/tomcat
Chown-R tomcat: tomcat/usr/local/jakarta-tomcat-5.0.19
Mkdir/usr/local/tomcat/webapps/mylog
JK2: tar xvfz jakarta-tomcat-connectors-jk2-src-current.tar.gz
Cd jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2
Chmod 755 buildconf. sh
./Buildconf. sh
./Configure -- with-apxs2 =/usr/local/apache/bin/apxs \
---- With-apr-lib =/usr/local/apache/lib \
-- With-tomcat-41 =/usr/local/tomcat \
-- With-java-home =/usr/local/jdk \
-- With-jni
Make
Libtool -- finish/usr/local/apache/httpd/modules
Cd jakarta-tomcat-connectors-jk2-2.0.4-src/jk/build/jk2/apache2
Cp mod_jk2.so/usr/local/apache/modules/
Cp libjkjni. so/usr/local/apache/modules/
When running at startup, edit the file:/etc/rc. d/rc. local and add the following two rows:
Su-tomcat-c/usr/local/tomcat/bin/startup. sh
/Usr/local/apache/bin/apachectl start
3. modify the configuration file. if the configuration file does not exist, create it. Httpd. conf:
Comment out the adddefacharcharset row
Added: LoadModule jk2_module modules/mod_jk2.so
Workers2.properties:
# Only at beginnin. In production uncomment it out
[Logger. apache2]
Level = DEBUG
[Uri:/jsp-examples/*]
Info = Map the jsp-examples webapp
Worker = ajp13: localhost: 8009
[Uri:/servlets-examples/*]
Info = Map the servlets-examples webapp
Worker = ajp13: localhost: 8009
Jk2.properties:
# This file may be overriden at runtime. MAKE SURE TOMCAT IS STOPED
# When you edit the file.
# Comments will be _ LOST _
# Documentation of the format in JkMain javadoc.
# Set the desired handler list
# Handler. list = apr, request, channelJni
Handler. list = channelSocket, request
#
# Override the default port for the socketChannel
# Channel socket. port = 8019
ChannelSocket. port = 8009
# Default:
# ChannelUnix. file =$ {jkHome}/work/jk2.socket
# Just to check if the config is working
# Shm. file =$ {jkHome}/work/jk2.shm
# In order to enable jni use any channelJni direve ve
# ChannelJni. disabled = 0
# And one of the following ctictives:
# Apr. jniModeSo =/opt/apache2/modules/mod_jk2.so
# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
# Apr. jniModeSo = inprocess
Server. xml:
Debug = "0"/>
Debug = "0"/>
Type = "org. apache. catalina. UserDatabase"
Description = "User database that can be updated and saved">
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.