# 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)
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:
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.