1. JDK 설치
# sh jdk-6u7-linux-i586.bin
# ln -s jdk1.6.0_07 java
2. Tomcat 압축풀기
# tar xvzf jakarta-tomcat-5.5.9.tar.gz
# ln -s jakarta-tomcat-5.5.9 tomcat
#vi /etc/profile [엔터]
이 파일의 맨 하단에 아래의 내용을 추가
**************************************************
PATH="$PATH:/usr/local/java/bin/:/usr/local/tomcat/bin"
export JAVA_HOME="/usr/local/java"
export CATALINA_HOME="/usr/local/tomcat"
export PATH=$PATH
**************************************************
- 환경 설정 파일을 다시읽기 위해..
#source /etc/profile
-. 다시한번 tomcat을 실행시켜 본 후 아래 내용이 나오면 성공...
# catalina.sh start [엔터]
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/locat/tomcat/temp
Using JAVA_HOME: /usr/local/java
- http://IP:8080 에 접속하여 tomcat 상태를 확인합니다. <고양이>가 나오면 성공.
- 부팅시 자동으로 tomcat daemon이 실행되게 하지 위해서는 다음과 같이 설정.
#vi /etc/rc.d/init.d/tomcat [첨부한 tomcat 자료를 다운로드 하여 사용 바람..]
****************************************************
#!/bin/sh
#
#Startup script for Tomcat, the Apache Servlet Engine
#
# chkconfig: - 85 15
# description: Start Tomcat
#
# processname: tomcat
#
# Source function library.
. /etc/rc.d/init.d/functions
export JAVA_HOME=/usr/local/java
export CATALINA_HOME=/usr/local/tomcat
export PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin
# See how we were called.
case "$1" in
start)
echo -n "Starting tomcat: "
daemon $CATALINA_HOME/bin/catalina.sh start
touch /var/lock/subsys/tomcat
echo
;;
stop)
echo -n "Shutting down tomcat: "
daemon $CATALINA_HOME/bin/catalina.sh stop
rm -f /var/lock/subsys/tomcat
echo
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
******************************************
#cd /etc/rc.d/init.d/
#chmod 755 tomcat
#chkconfig --add tomcat
#chkconfig --level 3 tomcat on
------------------------ server.xml 예제 -----------------------------
<Host name="i4.asw.co.kr" unpackWARs="true" appBase="/var/www/i4.asw.co.kr/">
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs"
prefix="i4.asw.co.kr_log." suffix=".txt" timestamp="true"/>
<Context path="" docBase="" />
<!-- Admin -->
<Context path="/admin" docBase="./admin/">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="211.47.130.193,211.47.130.194,211.47.130.195,211.47.130.198,211.47.130.199,211.47.130.200,211.47.130.201,211.47.130.203,211.47.130.204,211.47.130.208" />
</Context>
</Host>
좋은정보가 되셨다면 아래 한번 클릭해주세요^^ |
댓글