Beruflich Dokumente
Kultur Dokumente
CHAPTER 1
Step 1.
Cho rang ban da co san Tomcat va Xampp duoc cai dat:
Tomcat: //apache-tomcat-5.5.23 (after install it, rename //tomcat)
Xampp: //lampp
Step 2.
Download mod_jk from http://apache.siamwebhosting.com/tomcat/tomcat-
connectors/jk/binaries/linux/jk-1.2.25/i386/
Download file: mod_jk-1.2.25-httpd-2.2.4.so for Xampp ver 1.6.x, then renaming
mod_jk.so
and copy this file to //lampp/libexec
Step 3.
Open file httpd.conf in the path //lampp/etc, insert the bottom this file with the
following line “Include //tomcat/conf/mod_jk.conf”:
Step 4.
create file //tomcat/conf/workers.properties (if not exist), insert the following lines:
workers.tomcat_home=//tomcat
workers.java_home=//jdk1.5.0_11
ps=/
worker.list=worker1, ajp13
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
Testing:
In this test, we are directing all URLs that begin with "/jsp-examples" to Tomcat.
In a real world situation, we might only direct JSPs or servlets to the JK worker.
Make sure no other server is running on the default Tomcat ports of 8005, 8009 and
8080.
Make sure no other server is running on the Apache port, which is normally 8080 or
80.
Start Tomcat first: Always start Tomcat first and then start Apache.
If you have to bounce Tomcat, remember to take down Apache first and restart it after
Tomcat restarts.
Start Apache: Point your browser to http://localhost and verify that you get the default
Apache page. Substitute "localhost" for the actual machine name/IP if necessary.
Point your browser to http://localhost:8080 and verify that you get the default Tomcat
page.
Point your browser to http://localhost/jsp-examples/ and verify that you get the index
page for the Tomcat examples.
This will be served by Apache and will indicate that you have completed your
integration of Apache and Tomcat successfully.
CHAPTER 2
CONNECT TO OWN YOUR WEBAPP
<IfModule !mod_jk.c>
LoadModule jk_module libexec/mod_jk.so
</IfModule>
JkWorkersFile "/opt/tomcat/conf/workers.properties"
JkLogFile "/opt/lampp/logs/mod_jk.log"
JkLogLevel info
<VirtualHost xxx.yyy.com>
ServerName xxx.yyy.com
<Directory "/opt/tomcat/webapps/jsp-examples">
Options Indexes FollowSymLinks
DirectoryIndex index.html index.htm index.jsp
</Directory>
#<Location "/jsp-examples/META-INF/*">
#AllowOverride None
#deny from all
#</Location>
# Static files
Alias /tomcat-docs "/opt/tomcat/webapps/tomcat-docs"
<Directory "/opt/tomcat/webapps/tomcat-docs">
Options Indexes FollowSymLinks
DirectoryIndex index.html index.htm index.jsp
</Directory>
#<Location "/tomcat-docs/META-INF/*">
#AllowOverride None
#deny from all
#</Location>
# Static files
Alias /webdav "/opt/tomcat/webapps/webdav"
<Directory "/opt/tomcat/webapps/webdav">
Options Indexes FollowSymLinks
DirectoryIndex index.jsp index.html index.htm
</Directory>
<Location "/webdav/META-INF/*">
AllowOverride None
deny from all
</Location>