티스토리 뷰

톰켓을 설치하기전, 최신버전을 확인합니다.  --> https://tomcat.apache.org

 

Apache Tomcat® - Welcome!

The Apache Tomcat® software is an open source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. The Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket specifications are

tomcat.apache.org

2019.06.29일 현재 Tomcat 9.0.21이 최신 버전입니다.

Tomcat7 9.0.21 다운로드 페이지

Centos7 이므로 Coredml tar.gz. 에서 마우스 오른쪽 클릭하여, 주소를 복사한다.

그리고 파일을 다운 받는다.

다운받는 경로는 /usr/local 이다.

[root@localhost db_backup]# cd /usr/local
[root@localhost local]# wget http://mirror.navercorp.com/apache/tomcat/tomcat-9/v9.0.21/bin/apache-tomcat-9.0.21.tar.gz
--2019-06-29 19:20:45--  http://mirror.navercorp.com/apache/tomcat/tomcat-9/v9.0.21/bin/apache-tomcat-9.0.21.tar.gz
Resolving mirror.navercorp.com (mirror.navercorp.com)... 125.209.216.167
Connecting to mirror.navercorp.com (mirror.navercorp.com)|125.209.216.167|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10874669 (10M) [application/x-gzip]
Saving to: ‘apache-tomcat-9.0.21.tar.gz’

100%[========================================================================>] 10,874,669  6.01MB/s   in 1.7s

2019-06-29 19:20:47 (6.01 MB/s) - ‘apache-tomcat-9.0.21.tar.gz’ saved [10874669/10874669]

다운로드 된 파일의 압축을 푼다.

[root@localhost local]# tar -xvf apache-tomcat-9.0.21.tar.gz
apache-tomcat-9.0.21/conf/
apache-tomcat-9.0.21/conf/catalina.policy
apache-tomcat-9.0.21/conf/catalina.properties
apache-tomcat-9.0.21/conf/context.xml
apache-tomcat-9.0.21/conf/jaspic-providers.xml
...

해당경로로 이동하여 톰캣을 실행한다.

[root@localhost local]# ls
apache-tomcat-9.0.21         bin  games    lib    libexec  share
apache-tomcat-9.0.21.tar.gz  etc  include  lib64  sbin     src
[root@localhost local]# cd apache-tomcat-9.0.21
[root@localhost apache-tomcat-9.0.21]# ls
bin           conf             lib      logs    README.md      RUNNING.txt  webapps
BUILDING.txt  CONTRIBUTING.md  LICENSE  NOTICE  RELEASE-NOTES  temp         work
[root@localhost apache-tomcat-9.0.21]# cd bin
[root@localhost bin]# ls
bootstrap.jar       commons-daemon.jar            digest.sh         shutdown.sh           tool-wrapper.sh
catalina.bat        commons-daemon-native.tar.gz  makebase.bat      startup.bat           version.bat
catalina.sh         configtest.bat                makebase.sh       startup.sh            version.sh
catalina-tasks.xml  configtest.sh                 setclasspath.bat  tomcat-juli.jar
ciphers.bat         daemon.sh                     setclasspath.sh   tomcat-native.tar.gz
ciphers.sh          digest.bat                    shutdown.bat      tool-wrapper.bat
[root@localhost bin]# sh startup.sh
Using CATALINA_BASE:   /usr/local/apache-tomcat-9.0.21
Using CATALINA_HOME:   /usr/local/apache-tomcat-9.0.21
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.21/temp
Using JRE_HOME:        /usr/lib/jvm/java-12-openjdk-12.0.1.12-1.rolling.el7.x86_64
Using CLASSPATH:       /usr/local/apache-tomcat-9.0.21/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.21/bin/tomcat-juli.jar
Tomcat started.
[root@localhost bin]# ls

톰캣 실행 명령은 다음과 같다.(bin폴더)

# 톰캣 서버 구동
sh startup.sh

# 톰캣 서버 내리기
shutdown.sh

참조 : https://dev-toryhenry.tistory.com/15

 

톰캣서버 외부 접속을 위해 기본 포트인 8080 포트를 방화벽에 추가한다.

# 8080 포트 추가
sudo firewall-cmd --permanent --add-port=8080/tcp

# 방화벽 재기동
sudo firewall-cmd --reload

# 부팅후 시작하기
sudo systemctl start httpd
sudo systemctl enable httpd

해당 IP:8080으로 접속하면 아랴와 같은 화면이 나타난다.

톰켓 로그는 아래 폴더에서 확인할수 있다.

[root@localhost logs]# pwd
/usr/local/apache-tomcat-9.0.21/logs
[root@localhost logs]# ls -l
total 24
-rw-r-----. 1 root root 6705 Jun 29 19:23 catalina.2019-06-29.log
-rw-r-----. 1 root root 6877 Jun 29 19:23 catalina.out
-rw-r-----. 1 root root    0 Jun 29 19:22 host-manager.2019-06-29.log
-rw-r-----. 1 root root  408 Jun 29 19:23 localhost.2019-06-29.log
-rw-r-----. 1 root root  913 Jun 29 20:11 localhost_access_log.2019-06-29.txt
-rw-r-----. 1 root root    0 Jun 29 19:22 manager.2019-06-29.log
[root@localhost logs]#
댓글
댓글쓰기 폼
Total
44,454
Today
23
Yesterday
41
«   2019/10   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31