Tomcat

김상훈·2024년 4월 3일
0

Linux

목록 보기
12/14
post-custom-banner

톰캣 설치 후 실행

openjdk 설치 (PuTTY)


# apt 업데이트
kosa1004@DESKTOP-4U4G4G2:~$ sudo apt update

# openjdk 다운로드
kosa1004@DESKTOP-4U4G4G2:~$ sudo apt install openjdk-8-jdk

# openjdk 다운됐는지 확인
kosa1004@DESKTOP-4U4G4G2:~$ java -version

openjdk version "1.8.0_402"
OpenJDK Runtime Environment (build 1.8.0_402-8u402-ga-2ubuntu1~22.04-b06)
OpenJDK 64-Bit Server VM (build 25.402-b06, mixed mode)

Tomcat 압축파일 다운로드

Apache Tomcat® - Apache Tomcat 9 Software Downloads

압축 풀기

# wget 명령어를 이용해 제공하는 tag.gz에 다이렉트로 다운로드
kosa1004@DESKTOP-4U4G4G2:~$ sudo wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.87/bin/apache-tomcat-9.0.87.tar.gz

# 압축파일 확인
kosa1004@DESKTOP-4U4G4G2:~$ ls
apache-tomcat-9.0.87.tar.gz

# 압축 풀기
kosa1004@DESKTOP-4U4G4G2:~$ sudo tar -zxvf apache-tomcat-9.0.87.tar.gz

경로 이동

# tomcat 깔린지 확인
kosa1004@DESKTOP-4U4G4G2:~$ ls
apache-tomcat-9.0.87  apache-tomcat-9.0.87.tar.gz
-------------------- 이거임

# 이동
kosa1004@DESKTOP-4U4G4G2:~$ cd apache-tomcat-9.0.87/

# 파일들 확인
kosa1004@DESKTOP-4U4G4G2:~/apache-tomcat-9.0.87$ ls

BUILDING.txt     LICENSE  README.md      RUNNING.txt  conf  logs  webapps
CONTRIBUTING.md  NOTICE   RELEASE-NOTES  bin          lib   temp  work

# 서버 실행 파일 확인
kosa1004@DESKTOP-4U4G4G2:~/apache-tomcat-9.0.87$ sudo ls ./bin

bootstrap.jar                 configtest.sh     shutdown.sh   <--종료파일
catalina-tasks.xml            daemon.sh         startup.bat
catalina.bat                  digest.bat        startup.sh    <--실행파일
catalina.sh                   digest.sh         tomcat-juli.jar
ciphers.bat                   makebase.bat      tomcat-native.tar.gz
ciphers.sh                    makebase.sh       tool-wrapper.bat
commons-daemon-native.tar.gz  setclasspath.bat  tool-wrapper.sh
commons-daemon.jar            setclasspath.sh   version.bat
configtest.bat                shutdown.bat      version.sh

# 톰캣 서버 실행
kosa1004@DESKTOP-4U4G4G2:~/apache-tomcat-9.0.87$ sudo ./bin/startup.sh

Using CATALINA_BASE:   /home/kosa1004/apache-tomcat-9.0.87
Using CATALINA_HOME:   /home/kosa1004/apache-tomcat-9.0.87
Using CATALINA_TMPDIR: /home/kosa1004/apache-tomcat-9.0.87/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/kosa1004/apache-tomcat-9.0.87/bin/bootstrap.jar:/home/kosa1004/apache-tomcat-9.0.87/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.   <--- 실행됨

서버 확인

PUTTY 접속했던 IP

포트는 8080

톰캣 끄기

kosa1004@DESKTOP-4U4G4G2:~/apache-tomcat-9.0.87$ sudo bin/shutdown.sh

Using CATALINA_BASE:   /home/kosa1004/apache-tomcat-9.0.87
Using CATALINA_HOME:   /home/kosa1004/apache-tomcat-9.0.87
Using CATALINA_TMPDIR: /home/kosa1004/apache-tomcat-9.0.87/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/kosa1004/apache-tomcat-9.0.87/bin/bootstrap.jar:/home/kosa1004/apache-tomcat-9.0.87/bin/tomcat-juli.jar
Using CATALINA_OPTS:

index.html 생성

kosa1004@DESKTOP-4U4G4G2:~/apache-tomcat-9.0.87$ sudo vi webapps/ROOT/index.html

톰캣 서버 재실행

# 끄기
kosa1004@DESKTOP-4U4G4G2:~/apache-tomcat-9.0.87$ sudo bin/shutdown.sh

Using CATALINA_BASE:   /home/kosa1004/apache-tomcat-9.0.87
Using CATALINA_HOME:   /home/kosa1004/apache-tomcat-9.0.87
Using CATALINA_TMPDIR: /home/kosa1004/apache-tomcat-9.0.87/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/kosa1004/apache-tomcat-9.0.87/bin/bootstrap.jar:/home/kosa1004/apache-tomcat-9.0.87/bin/tomcat-juli.jar
Using CATALINA_OPTS:

# 켜기
kosa1004@DESKTOP-4U4G4G2:~/apache-tomcat-9.0.87$ sudo bin/startup.sh

Using CATALINA_BASE:   /home/kosa1004/apache-tomcat-9.0.87
Using CATALINA_HOME:   /home/kosa1004/apache-tomcat-9.0.87
Using CATALINA_TMPDIR: /home/kosa1004/apache-tomcat-9.0.87/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/kosa1004/apache-tomcat-9.0.87/bin/bootstrap.jar:/home/kosa1004/apache-tomcat-9.0.87/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.

확인

출처

[Ubuntu] Apache Tomcat 설치

아파치 톰캣 톰켓 index.html 경로 설정하기 config 만지기

post-custom-banner

0개의 댓글