1. download and install the jdk-6u17-linux-x64-rpm.bin, and modify the Java path and PATH variable;
2. Download installation httpd-2.2.14
The compilation and installation commands are as follows:
./Configure -- prefix =/usr/local/apache2 -- enable-so
Make
Make install
3. Download and install atat-connectors-1.2.30-src.tar
CD native
./Configure -- With-apxs =/usr/local/apache2/bin/apxs
Make
CP/native/Apache-2.0/mod_jk.so/usr/local/apache2/modules/
CP/CONF/httpd_jk.conf/usr/local/apache2/CONF/extra/
CP/CONF/workers. properties. Minimal/usr/local/apache2/CONF/workers. Properties
4. Download and configure APACHE-Tomcat-6.0.20
Note: Modify the port numbers in/CONF/server. xml. The default port number is port 8080. We will change it to port 8081. In addition, ajp13 uses port 8009. We will change it to port 9001 here. Do not conflict with the ports of other Tomcat instances or other systems;
4. Configure Apache
Modify httpd. conf
Listen: 80
# Virtual Hosts
Include CONF/extra/httpd-vhosts.conf
# Mod_jk
Include CONF/extra/httpd-jk.conf
5. Modify the workers. properties File
Add testworker to worker. List.
Worker. testworker. type = AJP
Worker. testworker. Port = 9001
6, modify httpd-vhosts.conf
<Virtualhost *: 80>
Serveradmin webmaster@www.test.com
<! -- Generally, the site files are directly deployed under the root path of Tomcat and webapps -->
DocumentRoot "/usr/local/tomcat_instances/www.test.com/web#/root"
<! -- Be sure to write http: // The domain name following it. If you have www, you must include it. -->
Servername www.test.com
Serveralias www.test.com
Errorlog "logs/www.test.com-error_log"
Customlog "logs/www.test.com-access_log" common
<! -- Here, I understand that when a request is initiated -->
Jkmount/servlet/* testworker
Jkmount/*. jsp testworker
Jkmount/*. Do testworker
Directoryindex index.html index.htm index. jsp
<! -- The following is an example of imitating the permission settings for directories on the Internet, but it only applies to static files because. JSP requests are all managed by Tomcat, so Tomcat should be responsible for permission control on them. I wonder if this understanding is correct. -->
<Directory "/usr/local/tomcat_instances/www.test.com/web#/root">
Options followsymlinks
AllowOverride none
Order deny, allow
Allow from all
</Directory>
</Virtualhost>
7. Modify the local hosts file for testing,
127.0.0.1 www.test.com
For apache2/bin/apachectl-K start, enter http: // localhost/to check whether the test page is displayed.
For tomcat/bin/startup. Sh, enter http: // localhost: [port number, which is 8081] to check whether Tomcat is normal.