Operating environment: Windows2003 Server SP4 + j2sdk1.5.0 + Apache2.0.54 + Tomcat5.5.9
To prepare the software:
1. Install Apache 2.0.54
2.Tomcat 5.5.14
3.JK2 Connector (mod_jk2.so)
First, configure Apache and Tomcat
Apache installed under D:/apache2, listening on port 80;
Tomcat under D:/TOMCAT51, listening on port 8080;
Both are installed with Windows 2000 service.
Copy the mod_jk2.so to the D:/apache2/modules directory:
1. Edit the d:/apache2/conf/httpd.conf file and add it to the LoadModule section of the code:
LoadModule Jk2_module modules/mod_jk2.so
2. Change the Adddefaultcharset iso-8859-1 to Adddefaultcharset GB2312 so that Apache automatically supports Chinese display;
3. Add in "Virtual Host Configuration Snippet": (This configuration can be modified according to your actual situation)
<VirtualHost *:80>
ServerAdmin linvsfen◎163.com DocumentRoot "d:/ Tomcat51/webapps/jsp-examples
ServerName localhost ErrorLog logs/error_log CustomLog logs/access_log common
</VirtualHost>
Write the Workers2.properties file and add the d:/apache2/conf directory, which reads as follows:
# usually commented out onproduction environments[logger.apache2]file= "
d:/apache2/logs/error.log" level=ERROR# Provide the basic config Needed[config]
file=d:/apache2/conf/workers2.propertiesdebug=1# provide the location of SHM file on the
Apache web server[shm]file=d:/apache2/conf/jk2.shmsize=1000000
[channel.socket:localhost : 8009]port=8009host=localhost#define the worker
[ajp13:localhost:8009]channel=channel.socket:localhost:8009# Map the Tomcat
examples WebApp to the WEB server URI spaces [uri:/jsp-examples/*][uri:/*.jsp]
Write a JSP file (sessiontest.jsp), put it under D:/tomcat51/webapps/jsp-examples, start Apache and Tomcat after reboot, and access http://localhost/ jsp-examples/sessiontest.jsp can be accessed.