톰켓에서 여러 도메인을 동시에 서비스하도록 설정하는 방법이다.
$CALTALINA_HOME/conf/server.xml 을 수정한다
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener
className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener
className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="80"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150"
maxHttpHeaderSize="8192">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm
className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host
appBase="D:/Home/domain.com/DEV"
name="dev.domain.com">
<Valve
className="org.apache.catalina.valves.AccessLogValve"
fileDateFormat="yyyy-MM-dd"
pattern="%h %l %u %t
"%r" %s %b "%{Referer}i"
"%{User-Agent}i""
prefix="dev.domain.com_access_log."
suffix=".txt"/>
</Host>
<Host
appBase="webapps"
name="localhost">
</Host>
<Host
appBase="D:/Home/domain.com/SSO"
name="sso.domain.com">
<Valve className="org.apache.catalina.valves.AccessLogValve"
fileDateFormat="yyyy-MM-dd"
pattern="%h %l %u %t
"%r" %s %b "%{Referer}i"
"%{User-Agent}i""
prefix="sso.domain.com_access_log."
suffix=".txt"/>
</Host>
<Host
appBase="D:/Home/domain.com/WWW"
name="www.domain.com">
<Alias>domain.com</Alias>
<Valve
className="org.apache.catalina.valves.AccessLogValve"
fileDateFormat="yyyy-MM-dd"
pattern="%h %l %u %t
"%r" %s %b "%{Referer}i"
"%{User-Agent}i""
prefix="www.domain.com_access_log."
suffix=".txt"/>
</Host>
<Host
appBase="D:/Home/domain.com/KAS"
name="kas.domain.com">
<Valve className="org.apache.catalina.valves.AccessLogValve"
fileDateFormat="yyyy-MM-dd"
pattern="%h %l %u %t
"%r" %s %b "%{Referer}i"
"%{User-Agent}i""
prefix="kas.domain.com_access_log."
suffix=".txt"/>
</Host>
<Host
appBase="D:/Home/domain.com/BLOG"
name="blog.domain.com">
<Valve className="org.apache.catalina.valves.AccessLogValve"
fileDateFormat="yyyy-MM-dd"
pattern="%h %l %u %t
"%r" %s %b "%{Referer}i"
"%{User-Agent}i""
prefix="blog.domain.com_access_log."
suffix=".txt"/>
</Host>
<Host
appBase="D:/Home/enprog.com/KKABI"
name="kkabi.enprog.com">
<Valve className="org.apache.catalina.valves.AccessLogValve"
fileDateFormat="yyyy-MM-dd"
pattern="%h %l %u %t
"%r" %s %b "%{Referer}i"
"%{User-Agent}i""
prefix="kkabi.enprog.com_access_log."
suffix=".txt"/>
</Host>
</Engine>
</Service>
</Server>
'JAVA' 카테고리의 다른 글
최적 이클립스 개발환경 구축 (0) | 2009.09.03 |
---|---|
JSP에서 엑셀로 받기/저장시 한글깨짐현상 (0) | 2009.09.03 |
톰켓설정 - 여러 포트로 서비스 하기 (0) | 2009.01.13 |
workers.properties.minimal (0) | 2009.01.08 |
Iis6.0 + tomcat5.5 설치하기 (0) | 2009.01.08 |