티스토리 뷰
16년 12월 기준.
wget http://mirror.navercorp.com/apache/tomcat/tomcat-8/v8.5.8/bin/apache-tomcat-8.5.8.tar.gz
tar -xzvf apache-tomcat-8.5.8.tar.gz
mv apache-tomcat-8.5.8.tar /usr/local/tomcat
ln -s apache-tomcat-8.5.8. tomcat
/etc/profile
export JAVA_HOME=/usr/java/idk
export CATALINA_HOME=/usr/local/tomcat
source /etc/profile
yum install iptables-services // iptables-services 설치
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
service iptables restart
vi /etc/init.d/tomcat
#!/bin/sh
# chkconfig: 345 90 90
# description: init file for tomcat
# processname: tomcat
# Get Config
[ -f /usr/local/tomcat/conf/server.xml ] && [ -f /usr/local/tomcat/conf/web.xml ] || exit 0
source /etc/profile
# Source function library
. /etc/rc.d/init.d/functions
# caution :
# variable=<value> space between variable and value is not allowed
RETVAL=0
prog=tomcatd
# Start function
start()
{
echo -n "Starting $prog : "
daemon $CATALINA_HOME/bin/startup.sh
RETVAL=$?
echo
touch /var/lock/subsys/tomcat
return $RETVAL
}
# Stop fucntion
stop()
{
echo -n "Stopping $prog : "
daemon $CATALINA_HOME/bin/shutdown.sh
RETVAL=$?
echo
rm -f /var/lock/subsys/tomcat
return $RETVAL
}
# Restart function
restart()
{
stop
start
}
# See how we were called
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage : $0 {start|stop|restart}"
esac
exit $RETVAL
chmod 755 /etc/init.d/tomcat
chkconfig -add tomcat
chkconfig -list tomcat
systemctl enable tomcat
systemctl status tomcat
// CentOS7
/etc/init.d/tomcat start
'Study' 카테고리의 다른 글
node js(노드제이에스) install(설치) error(에러) (0) | 2024.02.18 |
---|---|
node js(노드제이에스) install(설치) 관련 (0) | 2024.02.18 |
Linux(리눅스) Firewall(방화벽) 관련 (0) | 2024.02.18 |
Observer(옵저버) 패턴 (0) | 2024.02.18 |
webstorm(웹스톰) 관련 (0) | 2024.02.18 |