1. 아파치 설치
# yum install httpd# yum install httpd-devel
apxs를 위한 httpd-devel설치
2. Tomcat 설치
# yum install tomcat6# yum install tomcat6-webapps
# yum install tomcat6-admin-webapps
- servlet invoker 관련내용의 주석 제거
#vi /usr/share/tomcat6/conf/web.xml
아래 가,나 부분을 주석 제거<!-- --> 지운 표시를 위해 제거부분 위, 아래를 <!-- del --> 로 표시해 놓았다.
가. 121줄 ~ 131줄
<servlet>
<servlet-name>invoker </servlet-name>
.... 중략 ....
</servlet>
나. 369줄 ~ 372줄
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
- ROOT 폴더를 통합
# cd /usr/share/tomcat6/webapps
#l n -s /var/www/html /usr/share/tomcat6/webapps/ROOT
- context.xml 수정
# vim /usr/share/tomcat6/conf/context.xml
<Context>태그를 아래와 같이 변경
<Context reloadable="true" privileged="true" >
3. Connector 설치
# wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connenctors-1.2.37-src.tar.gz# tar xvzf tomcat-connenctors-1.2.37-src.tar.gz
# cd tomcat-connenctors-1.2.37-src
# cd native
# ./configure -with-apxs=/usr/sbin/apxs
# make
# make install
# vi /etc/httpd/modules
위 모듈 폴더에 mod_jk.so 생성 확인
4. 연동하기
- httpd.conf파일에 mod_jk.so 로드 추가# vi /etc/httpd/conf/httpd.conf
LoadModule jk_module modules/mod_jk.so
<IfModule jk_module>
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /etc/httpd/logs/mod_jk.log
JkShmFile /usr/share/tomcat6/logs/jk.shm
JkMount /*.jsp worker2
JkMount /ExpertGrid_Exam/* worker2
</IfModule>
- index 추가
DirectoryIndex index.jsp
- workers.properties 생성
#vi /etc/httpd/conf/workers.properties
worker.list=worker2
worker.worker2.type=ajp13
worker.worker2.host=localhost
worker.worker2.port=8009
worker.worker2.lbfactor=1
worker.worker2.connection_pool_timeout=600
worker.worker2.socket_keepalive=1
worker.worker2.socket_timeout=60
4. 재시작
# service httpd restart# service tomcat6 restart
댓글 없음:
댓글 쓰기