########################################################
Apache + Tomcat (webapp module) 연동 가상호스트
########################################################
#----------------- httpd.conf 파일 ---------------------
NameVirtualHost *
<VirtualHost *>
ServerAdmin admin@okejb.com
DocumentRoot /server/tomcat4.12/webapps/ROOT
ServerName okjeb.com
ServerAlias www.okejb.com okejb.com
ErrorLog logs/phonia.okejb.com-error_log
CustomLog logs/phonia.okejb.com-access_log common
<IfModule mod_webapp.c>
WebAppConnection conn1 warp localhost:8008
WebAppDeploy ROOT conn1 /
WebAppDeploy examples conn1 /examples
WebAppInfo /webapp-info
</IfModule>
</VirtualHost>
<VirtualHost *>
ServerAdmin admin@jsp.okejb.com
DocumentRoot /server/tomcat4.12/webapps/jsp
ServerName jsp.okejb.com
ErrorLog logs/jsp.okejb.com-error_log
CustomLog logs/jsp.okejb.com-access_log common
<IfModule mod_webapp.c>
WebAppConnection conn2 warp localhost:8008
WebAppDeploy examples conn2 /
</IfModule>
</VirtualHost>
#----------------- httpd.conf 파일 ---------------------
#----------------- server.xml 파일 ---------------------
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Service name="Tomcat-Standalone">
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Context path="" docBase="/server/tomcat4.12/webapps/ROOT" reloadable="true"/>
</Host>
<Host name="jsp.okejb.com" debug="0" appBase="webapps" unpackWARs="true">
<Context path="" docBase="/server/tomcat4.12/webapps/jsp" reloadable="true"/>
</Host>
</Service>
</Server>
#----------------- server.xml 파일 ---------------------
ROOT Content : http://okejb.com/test.jsp
examples Context : http://www.okejb.com/examples/jsp/
가상호스트 : http://jsp.okejb.com/
http.conf설정
Listen 80
NameVirtualHost *
<VirtualHost *>
DocumentRoot "/usr/local/test/web"
ServerName dpostwb1
# ServerAlias
<IfModule mod_webapp.c>
WebAppConnection conn1 warp localhost:8008
WebAppDeploy ROOT conn1 /
WebAppDeploy examples conn1 /examples
WebAppInfo /webapp-info
</IfModule>
</VirtualHost>
<VirtualHost *>
DocumentRoot /app/sms/webap
ServerName smsdev.test.com
<IfModule mod_webapp.c>
WebAppConnection conn2 warp localhost:8008
WebAppDeploy examples conn2 /
</IfModule>
</VirtualHost>
server.xml
<Host name="smsdev.test.com" debug="0" appBase="webapps" unpackWARs="true">
<Context path="" docBase="/app/sms/webapp" reloadable="true"/>
</Host>