리눅스 톰캣7 컴파일 설치

Jmnote (토론 | 기여)님의 2013년 2월 3일 (일) 19:40 판 (→‎서비스 구성)
리눅스 톰캣7 설치

1 사전 작업

2 다운로드 및 설치

톰캣을 다운로드 받고 /usr/share/tomcat7[1]로 옮긴다.

명령어
wget http://apache.mirror.cdnetworks.com/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35.tar.gz
tar xzf apache-tomcat-7.0.35.tar.gz -C /usr/share/
mv /usr/share/apache-tomcat-7.0.35 /usr/share/tomcat7
실행예시
[root@jmnote ~]# wget http://apache.mirror.cdnetworks.com/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35.tar.gz
--2013-02-03 02:38:08--  http://apache.mirror.cdnetworks.com/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35.tar.gz
Resolving apache.mirror.cdnetworks.com... 61.110.198.174
Connecting to apache.mirror.cdnetworks.com|61.110.198.174|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7784675 (7.4M) [application/x-gzip]
Saving to: ??apache-tomcat-7.0.35.tar.gz??

100%[=================================================>] 7,784,675   7.20M/s   in 1.0s    

2013-02-03 02:38:09 (7.20 MB/s) - ??apache-tomcat-7.0.35.tar.gz?? saved [7784675/7784675]
[root@jmnote ~]# tar xzf apache-tomcat-7.0.35.tar.gz -C /usr/share/
[root@jmnote ~]# mv /usr/share/apache-tomcat-7.0.35 /usr/share/tomcat7

3 서비스 구성

/etc/init.d/tomcat7 파일을 만들어 service로 등록한다.

명령어
wget http://jmnote.com/tomcat/%etc%init.d%tomcat7 -O /etc/init.d/tomcat7
chmod 755 /etc/init.d/tomcat7
cat /etc/init.d/tomcat7
실행예시
[root@jmnote ~]# wget http://jmnote.com/tomcat/%etc%init.d%tomcat7 -O /etc/init.d/tomcat7
--2013-02-03 02:39:26--  http://jmnote.com/tomcat/%25etc%25init.d%25tomcat7
Resolving jmnote.com... 175.125.92.11
Connecting to jmnote.com|175.125.92.11|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 849 [text/plain]
Saving to: ??/etc/init.d/tomcat7??

100%[=================================================>] 849         --.-K/s   in 0s      

2013-02-03 02:39:26 (87.9 MB/s) - ??/etc/init.d/tomcat7?? saved [849/849]

[root@jmnote ~]# chmod 755 /etc/init.d/tomcat7

4 시작

service tomcat7 start
netstat -anp | grep :8080

5 방화벽

[root@jmnote ~]# iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
[root@jmnote ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]
[root@jmnote ~]# service iptables restart
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]

6 접속 테스트

7 같이 보기

8 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}