root °¡ ¾Æ´Ñ°èÁ¤À¸·Î ÅèĹÀ» ½ÇÇà½ÃÅ°·Á¸é ÅèĹ ÀÚü°¡ tomcatÀ» µ¹¸®·Á´Â
°èÁ¤ÀÇ È¨µð·ºÅ丮¿¡ ¼³Ä¡µÇ¾î Àְųª, tomcat µð·ºÅ丮¿Í ±× ÇÏÀ§ µð·ºÅ丮¸¦ ÀüºÎ ÅèĹÀ» µ¹¸®·Á´Â °èÁ¤¼ÒÀ¯·Î ¸¸µé¾î¾ß
ÇÕ´Ï´Ù.
Redhat
°è¿(ÇÑÄÄ,¿Í¿ì)À» ±âÁØÀ¸·Î tomcat À̶ó´Â »ç¿ëÀÚ¸íÀ» ÀÌ¿ëÇØ ÈÄÀÚ¿¡ ´ëÇؼ ¸»¾¸µå¸®°Ú½À´Ï´Ù.
root °èÁ¤À¸·Î ·Î±×ÀÎÇÏ¿©
# chown -R tomcat.tomcat
/usr/tomcat
À§¿Í °°ÀÌÇÏ¸é µð·ºÅ丮 ¼ÒÀ¯±ÇÀÌ ¸ðµÎ tomcat °èÁ¤¿¡ ¼ÓÇÏ°Ô
µË´Ï´Ù.
/etc/init.d/rc.local ÆÄÀÏÀÇ ¸Ç ¸¶Áö¸·¿¡ ´ÙÀ½ ÁÙÀ» Ãß°¡ÇØ
ÁÝ´Ï´Ù.
su - tomcat -c
"/usr/tomcat/bin/startup.sh"
ÀÌ°É·Î µÆ½À´Ï´Ù.
Áö±Ý±îÁö
Á¦°¡ º»¹Ù·Î ´ëºÎºÐ »ç¶÷µéÀº ÀüÀÚ(tomcat °èÁ¤ÀÇ È¨µð·ºÅ丮 /home/tomcat)¿¡´Ù°¡ ÅèĹÀ» ±ò°í ½ÇÇàÇÏ´Â °ÍÀ» ¼±È£ÇÏ´Â °Í
°°´õ±º¿ä
Ãâó
- http://okjsp.pe.kr/bbs?act=VIEW&seq=35739&bbs=bbs3&keyfield=subject&keyword=%B0%E8%C1%A4&pg=1
ÅèĹÀ» root °èÁ¤ÀÌ ¾Æ´Ñ tomcat °èÁ¤À¸·Î ½ÇÇà Çϱâ
¿ì¼±
tomcat °èÁ¤À» »ý¼ºÇÑ´Ù.
#
useradd -M tomcat
ÅèĹ
°èÁ¤ ¼³Á¤ È®ÀÎ
°èÁ¤À» »ý¼ºÇϸé home µð·ºÅ丮°¡ /home/tomcatÀ¸·Î ¼³Á¤ µÇ¸ç, À̸¦ CATALINA_HOMEÀ¸·Î
º¯°æÇØÁØ´Ù.
#
grep tomcat /etc/passwd
tomcat:x:501:501::/usr/local/tomcat:/bin/bash
½ÇÇà ½ºÅ©¸³Æ® ÀÛ¼ºÇϱâ
#
vi /etc/rc.d/init.d/tomcat
¾Æ·¡
³»¿ëÀ» ÀÛ¼ºÇÑ´Ù.
#!/bin/bash
# Startup script for the
Tomcat Server
# chkconfig: 345 50 50
#
description: Tomcat is a Web application server.
#
processname: java
# directory : CATALINA_HOME=/usr/local/tomcat
. /etc/profile
case "$1" in
start)
echo "Starting tomcat: "
su - tomcat -c $CATALINA_HOME/bin/startup.sh
;;
stop)
echo "Shutting down tomcat: "
su - tomcat -c $CATALINA_HOME/bin/shutdown.sh
;;
restart)
echo "Restarting tomcat: "
su - tomcat -c
$CATALINA_HOME/bin/shutdown.sh; su - tomcat
-c $CATALINA_HOME/bin/startup.sh
;;
*)
echo "Usage: service tomcat
{start|stop|restart}"
exit 1
esac
exit 0
¼ÒÀ¯±ÇÀ» tomcatÀ¸·Î
º¯°æ
#
chown tomcat:tomcat tomcat
tomcat
½ºÅ©¸³Æ®¿¡ ½ÇÇà±ÇÇÑ ÁÖ±â
#chmod
755 tomcat
runlevel¿¡
µî·Ï
chkconfig¿¡¼
add µÉ ¼ö ÀÖµµ·Ï ½ºÅ©¸³Æ®¿¡ "# chkconfig: 345 50 50" ¸¦ Ãß°¡ÇÑ´Ù.
#chkconfig
--add tomcat
½ÇÁ¦·Î
¸®ºÎÆýà ÅèĹÀÌ tomcat °èÁ¤À¸·Î ½ÇÇàµÇ´ÂÁö È®ÀÎÇÑ´Ù
#
reboot
ÅèĹ
½ÇÇà½Ã µ¥¸ó½ÇÇàÀÌ tomcatÀ¸·Î µÇ¾î ÀÖ´ÂÁö È®ÀÎÇÑ´Ù. tomcatÀÌ ¾Æ´Ñ rootÀΰæ¿ì´Â À߸øµÈ °æ¿ìÀÓ
#
ps -ef | grep tomcat
ÅèĹ
ÇÁ·Î¼¼½º ¼öµ¿ ½ÃÀÛ ¹× Á¾·á
#
service tomcat start
#
service tomcat stop