wiki:configuring_tomcat_apache_jk_virtual_host
This is an old revision of the document!
Purpose:
1. Support dynamic domain name 2. Set up Apache and Tomcat, linked with mod_jk
Configuration file:
1. jk.conf
<IfModule jk_module> JkWorkersFile workers.properties JkShmFile /var/log/apache2/jk-runtime-status JkLogFile /var/log/apache2/mod_jk.log JkLogLevel error </IfModule>
2. workers.properties
worker.list=worker1,status worker.worker1.port=8009 worker.worker1.host=localhost worker.worker1.type=ajp13 worker.status.type=status
3. virtual host
<VirtualHost *>
ServerAdmin webmaster@localhost
ServerName www.freecode.com.cn
ServerAlias www.freecode.com.cn freecode.com.cn *.freecode.com.cn
RewriteEngine on
RewriteCond %{HTTP_HOST} [^.]+\.freecode\.com\.cn$
RewriteCond %{HTTP_HOST} !^www\.freecode\.com\.cn$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ([^.]+)\.freecode\.com\.cn(.*) /$1$2
...
4. jsp site
<VirtualHost *>
ServerAdmin webmaster@localhost
ServerName jsp.example.com
serveralias jsp.example.com
JkMount /* worker1
wiki/configuring_tomcat_apache_jk_virtual_host.1227193402.txt.gz · Last modified: 2008/11/20 15:03 by mirnshi