Apache Tomcat 虚拟主机配置杂项

类别:Java 点击:0 评论:0 推荐:


############tomcat4.1 虚拟主机配置:################
server.xml 文件加入:
#----------------------------------------------------------
<Host name="www.web1.com" debug="0" appBase="D:\WAMP\web\web1_com" unpackWARs="true" autoDeploy="true">
 <alias>web1.com</alias>
 <alias>web1</alias>
 <Context path="" docBase="D:\WAMP\web\web1_com" debug="0" reloadable="true"/>
</Host>
<Host name="www.web2.com" debug="0" appBase="D:\WAMP\web\web2_com" unpackWARs="true" autoDeploy="true">
 <alias>eastsoft.com.cn</alias>
 <alias>eastsoft</alias>
 <Context path="" docBase="D:\WAMP\web\web2_com" debug="0" reloadable="true"/>
</Host>
#------------------------------------------------------------

###################apache2 训主机配置:#################
httpd.conf 文件加入:
#----------------------------------------------------------
NameVirtualHost *
<VirtualHost *>
 ServerName www.web1.com
 ServerAlias *.web1.com
 DocumentRoot D:/WAMP/web/web1_com
 DirectoryIndex index.jsp index.php index.htm index.html
</VirtualHost>
<VirtualHost *>
 ServerName www.web2.com
 ServerAlias *.web2.com
 DocumentRoot D:/WAMP/web/web2_com
 DirectoryIndex index.jsp index.php index.htm index.html
</VirtualHost>
#-----------------------------------
###############tomcat和apache配合#################
拷贝mod_jk.dll到D:/WAMP/Apache2/modules/下
httpd.conf 文件加入:
#-----------------------------------
LoadModule jk_module modules/mod_jk.dll
JkWorkersFile "D:/WAMP/Tomcat4.1/conf/workers.properties"
JkMount /servlet/* ajp13
JkMount /*.jsp ajp13
#-----------------------

tomcat4.1/conf目录下建立workers.properties文件,内容如下:
#---------------------------------
workers.tomcat_home=D:/WAMP/Tomcat4.1/
workers.java_home=D:/WAMP/jdk14
ps=\
# worker.list=ajp13
worker.list=ajp12,ajp13 
worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp12
worker.ajp12.lbfactor=1            
worker.ajp13.port=8009        
worker.ajp13.host=localhost     
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12, ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)classes
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)jaxp.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)parser.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)jasper.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)servlet.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)webserver.jar
worker.inprocess.class_path=$(workers.java_home)$(ps)lib$(ps)tools.jar
worker.inprocess.cmd_line=-config
worker.inprocess.cmd_line=$(workers.tomcat_home)/conf/jni_server.xml
worker.inprocess.cmd_line=-home
worker.inprocess.cmd_line=$(workers.tomcat_home)
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)inprocess.stderr
worker.inprocess.sysprops=tomcat.home=$(workers.tomcat_home)
#-----------------------------------

本文地址:http://com.8s8s.com/it/it12609.htm