develog

아파치 1대 + 톰캣 여러대 설정 본문

Web & WAS/Tomcat

아파치 1대 + 톰캣 여러대 설정

냐옴 2012. 7. 9. 13:24

-----------------------------------------------------

httpd-vhost.conf 수정

-----------------------------------------------------

vi /server/apache/conf/extra/httpd-vhosts.conf


<VirtualHost *:80>

    DocumentRoot /home/dev/www

    ServerName test1.mydomain.com

    ServerAlias *.test1.mydomain.com

    ErrorLog logs/test1.mydomain.com-error_log

    CustomLog logs/test1.mydomain.com-access_log common

    JkMount /* worker1

</VirtualHost>


<VirtualHost *:80>

    DocumentRoot /home/dev/www

    ServerName test2.mydomain.com

    ServerAlias *.test2.mydomain.com

    ErrorLog logs/test2.mydomain.com-error_log

    CustomLog logs/test2.mydomain.com-access_log common

    JkMount /* worker2

</VirtualHost>




-----------------------------------------------------

workers.properties 수정

-----------------------------------------------------

vi /server/apache/conf/tomcat/workers.properties


worker.list=worker1,worker2


worker.worker1.port=8013

worker.worker1.host=localhost

worker.worker1.type=ajp13

worker.worker1.lbfactor=1


worker.worker2.port=8014

worker.worker2.host=localhost

worker.worker2.type=ajp13

worker.worker2.lbfactor=1




-----------------------------------------------------

server.xml 수정 (worker1)

-----------------------------------------------------

vi /server/worker1/conf/server.xml


AJP 포트 변경 <Connector port="8013"

도메인 설정 <Host name="test1.mydomain.com"

8080 포트 주석처리 <!--Connector port="8080"

shutdown 포트 변경 <Server port="8008" shutdown="SHUTDOWN">




-----------------------------------------------------

catalina.sh 수정 (worker1)

-----------------------------------------------------

vi /server/worker1/bin/catalina.sh


CATALINA_HOME=/server/worker1




-----------------------------------------------------

ROOT.xml 수정 (worker1)

-----------------------------------------------------

[dev@dev02 ~]$ cd /server/worker1/conf/Catalina/

[dev@dev02 Catalina]$ mkdir test1.mydomain.com

[dev@dev02 Catalina]$ cd test1.mydomain.com

[dev@dev02 test1.mydomain.com]$ vi ROOT.xml


<Context docBase="/home/dev/www" reloadable="true">




-----------------------------------------------------

server.xml 수정 (worker2)

-----------------------------------------------------

vi /server/worker2/conf/server.xml


AJP 포트 변경 <Connector port="8014"

도메인 설정 <Host name="test2.mydomain.com"

8080 포트 주석처리 <!--Connector port="8080"

shutdown 포트 변경 <Server port="8009" shutdown="SHUTDOWN">




-----------------------------------------------------

catalina.sh 수정 (worker2)

-----------------------------------------------------

vi /server/worker2/bin/catalina.sh


CATALINA_HOME=/server/worker2




-----------------------------------------------------

ROOT.xml 수정 (worker2)

-----------------------------------------------------

[dev@dev02 ~]$ cd /server/worker2/conf/Catalina/

[dev@dev02 Catalina]$ mkdir test2.mydomain.com

[dev@dev02 Catalina]$ cd test2.mydomain.com

[dev@dev02 test2.mydomain.com]$ vi ROOT.xml


<Context docBase="/home/dev/www" reloadable="true">




'Web & WAS > Tomcat' 카테고리의 다른 글

tomcat, context.xml, resource 설정  (0) 2013.07.17
maxParameterCount  (0) 2013.07.16
DBCP 커넥션 풀 옵션 (connection pool)  (0) 2013.06.24
apache tomcat java 버전  (0) 2013.02.13
eclipse tomcat dbcp 셋팅 (connection pool)  (0) 2012.10.30
Comments