본문 바로가기

OS (Operating System)/Linux

리눅스 (Linux) 톰캣 리눅스 서버배포(우분투), Tomcat Ubuntu Server

728x90

리눅스 서버배포

 

톰캣을 다운

$ wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.81/bin/apache-tomcat-8.5.81.tar.gz

 

 

압축풀고

$ tar -zxvf apache-tomcat-8.5.81.tar.gz

 

 

tomcat/webapps 내부에 war 파일을 넣는다

war파일을 윈도우에서 리눅스로 넘겨주기위해 ftp를 사용했다

https://filezilla-project.org/download.php?type=client#close 

 

Download FileZilla Client for Windows (64bit x86)

Download FileZilla Client for Windows (64bit x86) The latest stable version of FileZilla Client is 3.60.1 Please select the file appropriate for your platform below. Please select your edition of FileZilla Client FileZilla FileZilla with manual FileZilla P

filezilla-project.org

 

 

tomcat/bin/startup.sh 을 실행시키면 webapps 내부에 war파일이 자동으로 압축이풀리며 서버가 실행되는데

기본주소인 localhost:8080을 열면 기본 톰캣화면이 구동된다

톰캣은 webapps 내부에 ROOT 폴더를 기본 ROOT으로 잡고있기 때문이다

 

1. 그렇기 때문에 기존의 ROOT 폴더를 날리고 압축이 해제된 war폴더 명을 'ROOT' 라는 폴더명으로 바꿔주거나

 

or

 

2. 압축이 풀린 war폴더 명을 톰캣이 기본 ROOT로 인식하도록  tomcat/conf/server.xml 에서 <Context>를 추가해주면된다

<!--기본port는 8080으로 잡혀있다 원하는 port로 변경가능-->
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

<!-- <Host>태그 안에 <Context>를 추가한다 (path 에 경로, docBase에 war 명-->
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
    <Context path="/" docBase="war명"  reloadable="false" > </Context>

</Host>

 

둘중 하나의 세팅을 마치고

기본주소인 localhost:8080을 열면 project 화면이 열린다

 

728x90