service:was:tomcat:debian
목차
Deian Linux (Etch) 에서 Apache 2.2 와 Tomcat 5.5 설치
Sun JDK 1.5 설치
- sources.list 파일에 non-free 를 추가한다.
# vi /etc/apt/sources.list deb http://ftp.kr.debian.org/debian/ etch main non-free deb-src http://ftp.kr.debian.org/debian/ etch main non-free deb http://security.debian.org/ etch/updates main contrib non-free deb-src http://security.debian.org/ etch/updates main contrib non-free
- 패키지 목록을 업데이트하고 설치한다.
# apt-get update # apt-get install sun-java5-jdk sun-java5-fonts # vi /etc/profile export JAVA_HOME="/usr/lib/jvm/java-1.5.0-sun" export PATH=$JAVA_HOME/bin:$PATH # source /etc/profile # java -version java version "1.5.0_14" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03) Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)
Apache 2.2 and Tomcat 5.5 설치
- apt를 통한 패키지 설치
# apt-get install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps libapache2-mod-jk apache2 apache2-utils
- Apache 2.2 의 Virtual Host 설정에서 아래와 같이 해준다.
# mkdir /opt/project_name/web/WEB-INF # cd /etc/apache2/sites-available # vi project_name NameVirtualHost *:80 <VirtualHost *:80> ServerName test.com ServerAlias www.test.com DocumentRoot /opt/project_name/web </VirtualHost> # a2ensite project_name - Tomcat 5.5 의 Virtual Host 설정을 아래와 같이 해준다.
# cd /etc/tomcat5.5 # vi server.xml ... <!-- test.com --> <Host name="test.com" debug="0" appBase="" unpackWARs="true" autoDeploy="true"> <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="test.com_" suffix=".log" timestamp="true"/> <Context path="" docBase="/opt/project_name/web" debug="0"> <Resources className="org.apache.naming.resources.FileDirContext" allowLinking="true" /> </Context> </Host> ... - /etc/init.d/tomcat5.5 를 열어서 아래와 같이 수정해준다.
TOMCAT5_SECURITY=no
- tomcat 데몬을 재시작한다.
# /etc/init.d/tomcat5.5 restart
Apache 2.2 + Tomcat 5.5 연동
- 설정파일 변경
# vi /etc/libapache2-mod-jk/workers.properties workers.tomcat_home=/usr/share/tomcat5.5 workers.java_home=/usr/lib/jvm/java-1.5.0-sun # cd /etc/apache2 # cp /usr/share/doc/libapache2-mod-jk/httpd_example_apache2.conf mods-available/jk.conf # ln -s /etc/apache2/mods-available/jk.conf mods-enabled/jk.conf # /etc/init.d/apache2 restart
- 브라우저를 통한 테스트
이후에 /opt/project_name/web 디렉토리에 test1.html 과 test2.jsp 파일을 작성하여 브라우저에서 테스트해본다.
service/was/tomcat/debian.txt · 마지막으로 수정됨: 저자 starlits
