Server/Linux

아파치 톰켓 수동설치 apache/tomcat

roalwh 2021. 11. 24. 14:28

0. 참고자료

1) 제타위키 참조

https://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EC%95%84%ED%8C%8C%EC%B9%98_%EC%B5%9C%EC%8B%A0%EB%B2%84%EC%A0%84_%EC%84%A4%EC%B9%98_(%EC%BB%B4%ED%8C%8C%EC%9D%BC) 

 

리눅스 아파치 최신버전 설치 (컴파일) - 제타위키

 

zetawiki.com

2) 사용버전

apr-1.7.0.tar.bz2
apr-util-1.6.1.tar.bz2
httpd-2.4.51.tar.bz2
pcre2-10.39.tar.bz2

tomcat_10.0.13 

 

3) 환경

Oracle virtualBox 

Ubuntu 20.04.3 LTS

 

 

1. apache 다운로드

1)apache 다운로드

https://httpd.apache.org/

 

Welcome! - The Apache HTTP Server Project

The Number One HTTP Server On The Internet The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows. The goal of this project is to provide a secure, efficient an

httpd.apache.org

2)apache apr, util 다운로드

https://apr.apache.org/download.cgi

 

Download - The Apache Portable Runtime Project

The currently selected mirror is https://dlcdn.apache.org/. If you encounter a problem with this mirror, please select another mirror. If all mirrors are failing, there are backup mirrors (at the end of the mirrors list) that should be available. You may a

apr.apache.org

3)pcre 다운로드 

https://github.com/PhilipHazel/pcre2/releases

https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2/download

 

Releases · PhilipHazel/pcre2

PCRE2 development is now based here. Contribute to PhilipHazel/pcre2 development by creating an account on GitHub.

github.com

4)JDK,tomcat ,mod_jk 다운로드

JDK - 안정화 버전 은 GA로 적혀있음.

https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases

 

Releases · AdoptOpenJDK/openjdk8-upstream-binaries

Not to be confused with openjdk8-binaries (which are AdoptOpenJDK's official binary release). These are pure unaltered builds from the OpenJDK mercurial jdk8u code stream. - AdoptOpenJDK/openj...

github.com

맞는 버전을 받아서 설정하려는 디렉터리에 저장한다. 혹은 apt-get install openJDK

 

tomcat 다운로드

https://tomcat.apache.org/download-10.cgi#10.0.13

 

Apache Tomcat® - Apache Tomcat 10 Software Downloads

Welcome to the Apache Tomcat® 10.x software download page. This page provides download links for obtaining the latest version of Tomcat 10.0.x software, as well as links to the archives of older releases. Unsure which version you need? Specification versi

tomcat.apache.org

10.0.13 버전 사용

 

mod_jk 다운로드

https://tomcat.apache.org/download-connectors.cgi

 

Apache Tomcat® - Tomcat Connectors (mod_jk) Downloads

You must verify the integrity of the downloaded files. We provide OpenPGP signatures for every release file. This signature should be matched against the KEYS file which contains the OpenPGP keys of Tomcat's Release Managers. We also provide SHA512 checksu

tomcat.apache.org

 

5) 컴파일을 위한 사전설치

sudo apt-get install gcc -y
sudo apt-get install gcc g++ -y
sudo apt-get install make -y
sudo apt-get install perl -y

sudo apt install libexpat1-dev -y

apt  install expect -y

 

2. 설치파일 압축 해제

tar -xvf apr-1.7.0.tar.bz2
tar -xvf apr-util-1.6.1.tar.bz2
tar -xvf httpd-2.4.51.tar.bz2
tar -xvf pcre-8.45.tar.bz2

mv apr-1.7.0 ./httpd-2.4.51/srclib/apr
mv apr-util-1.6.1 ./httpd-2.4.51/srclib/apr-util

3. pcre 설치

cd /usr/local/src/pcre2-10.39/
./configure
make
make install

4.JDK 설치

tar -xzvf OpenJDK8U-jdk_x64_linux_8u312b07.tar.gz
mv openjdk-8u312-b07 java_1.8.0

환경변수 설정
vim /etc/profile

export JAVA_HOME=/WEB/ext/java_1.8.0
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$CLASSPATH:$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar

source /etc/profile

java -version

 

5. apache 설치

cd /usr/local/src/httpd-2.4.51
./configure --prefix=/WEB/ext/apache --enable-module=so --enable-rewrite --enable-so --enable-mods-shared=all
make
make install

 

6. tomcat 설치

tar -xvzf apache-tomcat-10.0.13.tar.gz
mv apache-tomcat-10.0.13 tomcat_10.0.13

7.mod_jk 설치 및 apache-tomcat 연동

tar -xvf tomcat-connectors-1.2.48-src.tar.gz

cd /usr/local/src/tomcat-connectors-1.2.48-src/native

./configure --with-apxs=/~/apache/bin/apxs

make

make install

 

mod_jk 설정파일 이동

 

mv /usr/local/src/tomcat-connectors-1.2.48-src/conf/* /~/apache/conf/

httpd.conf 수정

vi ~/apache/conf/httpd.conf

 LoadModule jk_module modules/mod_jk.so

LoadModule 리스트 하단에 추가

<IFModule jk_module>
Include conf/mod_jk.conf
</IfModule>

맨 하단에 추가

DocumentRoot "/~/tomcat_10.0.13/webapps/ROOT" 수정
<Directory "/~/tomcat_10.0.13/webapps/ROOT"> 수정

mod_jk.conf 수정

이름변경

mv httpd-jk.conf mod_jk.conf
vi mod_jk.conf

JkLogStampFormat "[%y %m %d %H:%M:%S]"  추가

JkMountFile conf/uriworkermap.properties  주석 해제후 수정

workers.properties 수정

worker.list=tom1

worker.tom1.port=8009

worker.tom1.host=localhost

worker.tom1.type=ajp13

worker.tom1.lbfactor=1

uriworkermap.properties 수정

<VirtualHost *:80>

ServerName localhost

JkMount /*.jsp tom1
JkMount /*.json tom1
JkMount /*.xml tom1
JkMount /*.do tom1

</VirtualHost>

 

'Server > Linux' 카테고리의 다른 글

Ubuntu locale 한글 영문  (0) 2023.10.21