Article Title: RedHatAS5 integrates Apache and Tomcat server applications. 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.
AS5 comes with Tomcat 5, which is very convenient. We recommend that you run all the RPM packages cp and install them with YUM. This is not the focus of this article. It is very convenient to install Tomcat in AS5, and Apache uses the RPM package for installation.
1. Download mod_jk
The current stable version of mod_jk connector is 1.2.23, use a Web browser to access http://www.apache.org/dist/tomca ...... Es/linux/jk-1.2.23/, download mod_jk-1.2.23-apache-2.2.x-linux-i686.so.
2. install and configure mod_jk
Mv mod_jk-1.2.23-apache-2.2.x-linux-i686.so/etc/httpd/modules/mod_jk.so
Create a subdirectory jk in the/usr/share/tomcat5/conf directory, and create the file works. properties. The content is as follows:
Workers. tomcat_home =/usr/share/tomcat5 Workers. java_home =/us/lib/jvm/java Ps =/ Worker. list = ajp13 Worker. ajp13.port = 8009 Worker. ajp13.host = 127.0.0.1 Worker. ajp13.type = ajp13 Worker. ajp13.lbfactor = 1
Vi/usr/share/tomcat5/conf/server. xml, add |
Restart Tomcat 5
Cp/usr/share/tomcat5/conf/auto/mod_jk.conf/usr/share/tomcat5/conf/jk
Mv/usr/share/tomcat5/conf/jk/mod_jk.conf/usr/share/tomcat5/conf/jk/mod_jk.conf-auto
Vi/usr/share/tomcat5/conf/mod_jk.conf-auto, change the content of this file as follows:
LoadModules jk_module "/etc/httpd/modules/mod_jk.so"
JkWorkersFile "/usr/share/tomcat5/conf/jk/workers. properties"
JkLogFile "/usr/share/tomcat5/logs/mod_jk.log"
JkLogLevel emerg
ServerNmae localhost
JkMount/*. jsp ajp13
3. Configure Tomcat vi/usr/share/tomcat5/conf/server. xml
Add the following statement after xmlValidation = "false" xmlNamespaceAware = "false">:
4. Configure Apache vi/etc/httpd/conf/httpd. conf
Add the following statement to the last line:
Include/usr/share/tomcat5/conf/jk/mod_jk.conf-auto
5. Restart the Apache service and Tomcat service.
6. Test the integration of Apache and Tomcat.
Vi/var/www/html/test. jsp
Hello! The time is