Windows + Apache + Tomcat integration notes
Tomcat read 167 Comments 0
Font size: large, medium, small
Jdk-1_5_0_06-windows-i586-p.exe
Apache_2.2.8-win32-x86-no_ssl.msi
Apache-tomcat-6.0.16.exe
Install JDK
Right-click on my computer-> advanced-> New Variable
System variable value
Java_home C:/program files/Java/j2sdk1.5.0
Classpath
.; % Java_home %/LIB; % java_home %/lib/dt. jar; % java_home %/lib/tools. jar; % java_home %/JRE/LIB; %
Java_home %/JRE/lib/EXT; % java_home %/JRE/lib/RT. jar; % atat_home %/common/lib/mysql-connector-java.jar; %
Tomcat_home %/common/lib
PATH % java_home %; % java_home %/bin
Tomcat_home
C:/tomcat 6.0
Install Tomcat directly
Install the apache service
2. Execute the downloaded file
3. Enter localhost me @ localhost in the air
4. Select disk D for the installation directory
5. Install the rest by default
6. Start the apache service
Use Tomcat and Apache together
It is actually modifying its configuration file.
1. tomcat configuration file
The installation instructions are as follows:
D:/tomcat/CONF/server. xml
Edit the tomcat configuration file server. xml and add the following content to the host segment: (set the Tomcat main directory)
<Context Path = ""
Docbase = "C:/Apache/htdocs" DEBUG = "0" reloadable = "true"
Crosscontext = "true"/>
2. Change the Apache configuration file
D:/Apache/CONF/httpd. conf
Create the mod_jk configuration file "workers. properties" under the Apache configuration directory (D:/Apache/apache2/conf) and create the following
Content (between horizontal lines ):
--------------------------
# Defining a worker named worker1
And of Type
Ajp13
Worker. List = ajp13w (name)
# Setting ajp13w attributes
Worker. ajp13w. type = ajp13
Worker. ajp13w. Host = 127.0.0.1
Worker. ajp13w. Port = 8009
The following five lines are not required
Worker. ajp13w. lbfactor = 50
Worker. ajp13w. cachesize = 10
Worker. ajp13w. cache_time out = 600
Worker. ajp13w. socket_keepalive = 1
Worker. ajp13w. socket_timeout = 300
--------------------------
Add the following at the end of the Apache configuration file:
# Tomcat config #
# Load mod_jk module and download the corresponding version
Loadmodule jk_module
Modules/mod_jk.so
# Addmodule mod_jk.c
# JK configuration file workers. properties loading path
Jkworkersfile
Conf/workers. Properties
# Jk log storage location
Jklogfile logs/mod_jk.log
# Set jk log level
[Debug/error/info]
Jkloglevel info
# Setting the log format
Jklogstampformat "[% A % B % d
% H: % m: % S % Y]"
# Jkoptions indicate to send SSL key size,
Jkoptions
+ Forwardkeysize + forwarduricompat-forwarddirectories
# Jkrequestlogformat
Set the request format
Jkrequestlogformat "% w % v % t"
# Send all Servlet and JSP requests to Tomcat through the ajp13 protocol for Tomcat to process
#
Map the JSP program to the JK connector. The connector name is ajp13w, which is defined in workers. properties.
Jkmount/*. jsp
Ajp13w
# Map the jspx program to the JK Connector
Jkmount/*. jspx ajp13w
#
Map the servlet program to the JK Connector
Jkmount/servlet/* ajp13w
Jkmount/*. servlet
Ajp13w
3. Restart the service
4. Create a simple JSP file test. jsp (we use the resin site example)
This file is stored in: Apache/htdocs/test. jsp
The content is as follows:
<%
Out. Print ("test ");
%>
Enter http: // localhost/test. jsp in the browser and the following result is displayed:
Test
Install MySQL
1. (compressed package installation) run in NT: 2. Run the EXE Installation directly. After installation, set the password on the interface and start the service.
Mysqld-NT-install run SQL
Net start MySQL enable the Service
Mysql-uroot-P press ENTER
Password required
(Enter MySQL)