본문 바로가기
컴퓨터 활용(한글, 오피스 등)/50_2.운영체제_리눅스

리눅스 톰캣 기동 점검

by 3604 2023. 5. 12.
728x90

--톰캣설치
wget http://http://mirror.apache-kr.org/tomcat/tomcat-7/v7.0.75/bin/apache-tomcat-7.0.75.tar.gz
# tar -xzvf apache-tomcat-7.0.75.tar.gz -C /usr/local/

 

--서비스등록은 생략.. 잘안됐어요 ㅠㅜ--

--서비스등록,,이젠됩니다.

 

[root@localhost bin]# vi /etc/init.d/tomcat

--------추가

#!/bin/sh

#

#Tomcat auto-start

#

# chkconfig: 2345 90 90

# description: Auto-starts tomcat

# processname: tomcat

 

case $1 in

start)

        sh /usr/local/tomcat/bin/startup.sh

        ;;

stop)

        sh /usr/local/tomcat/bin/shutdown.sh

        ;;

restart)

        sh /usr/local/tomcat/bin/shutdown.sh

        sh /usr/local/tomcat/bin/startup.sh

        ;;

esac

 

exit 0

---------

[root@localhost bin]# chmod 755 /etc/init.d/tomcat

[root@localhost bin]# chkconfig --add tomcat

 

[root@localhost bin]# service tomcat restart

굳이 등록하지 않아도 경로로 bin까지 들어가서 합니다.!!
#cd /usr/local/tomcat7/bin ./startup.sh

-톰캣 설치확인
#netstat -anp | grep :8080
#ps -ef | grep tomcat

 

그리고 http://ip:8080으로 접속하여 고양이나오는지 확인!!

실패 ㅜㅜ
외부 접속을 위해서는 8080 또는 변경해준 포트번호를
방화벽에서 해제해주어야 합니다.

방화벽이 안열린듯..(방화벽해제작업)

 

[root@tomcat ~]# iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
[root@tomcat ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

보통은 여기까지하면 된다. BUT.

service iptables save에서 에러가..
ths service command supports only LSB actions
다시 검색했다.

#systemctl stop firewalld
#systemctl mask firewalld

#yum install iptables-services

#systemctl enable iptables
#service iptables save

 

확인

#vi /etc/sysconfig/iptables

포트8080이 추가됐는지 확인!

이렇게,,하다보니 됐다.ㅡㅡ;

http://할당된ip:8080  <-고양이가나옴!!

728x90
반응형