외부 네트워크가 불가능한 상황에서 Apache를 설치하는 방법
Rocky Linux 9
- Apache Source 파일 다운로드
아래의 URL을 접속하여, tar파일을 다운로드
https://httpd.apache.org/download.cgi
Download - The Apache HTTP Server Project
Downloading the Apache HTTP Server Use the links below to download the Apache HTTP Server from our download servers. You must verify the integrity of the downloaded files using signatures downloaded from our main distribution directory. The signatures can
httpd.apache.org
- 필수 패키지 확인 및 설치
이 부분이 가장 시간이 많이 소요되며, 외부 인터넷이 안되는 불편함을 느끼는 부분
apr
apr-util
gcc
gcc-c++
pcre
pcre-devel
expat
expat-devel
zlib-devel
openssl(ssl 적용시)
- 아파치 경로 생성 및 압축 해제
(/home/user 경로안에 생성)
#아파치 설치 경로 생성
cd /home/user
mkdir ./web
#httpd-2.4.54.tar.gz 파일 옮겨놓고 압축해제
cd /home/user/web
tar -zxvf httpd-2.4.54.tar.gz
#심볼릭 링크 생성
ln -s /home/user/web/httpd-2.4.54 apache
- apr & apr-util 압축 풀기 및 이동
( apr & apr-util 의 경우 tar파일을 받아 압축해제 후 아파치 경로의 srclib로 이동시켜줘야한다.)
아래의 경로에서 다운받을 수 있다.
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
#apr & apr-util 압축해제
tar -zxvf apr-1.7.0.tar.gz
tar -zxvf apr-util-1.6.1.tar.gz
#apr & apr-util 이동
mv apr-1.7.0 /home/user/web/apache/srclib/apr
mv apr-util-1.6.1 /home/user/web/apache/srclib/apr-util
- gcc & gcc-c++ & pcre & pcre-devel & expat & expat-devel & zlib-devel
서버마다 설치되어있는 경우도 있고, OS 버전에 맞게 다운로드 받아서 수동 설치
- 아파치 설치 (ssl 미적용)
cd /dopco/web/apache
./configure --prefix=/home/user/web/apache --with-included-apr --enable-module=so --enable-mods-shared=all --enable-so --enable-deflate --enable-rewrite
make
make install
경우에 따라서 아래의 아파치 설치 옵션 참고
https://httpd.apache.org/docs/2.4/programs/configure.html#installationdirectories
configure - 소스 트리를 구성한다 - Apache HTTP Server Version 2.4
configure - 소스 트리를 구성한다 이 문서는 최신판 번역이 아닙니다. 최근에 변경된 내용은 영어 문서를 참고하세요. configure 스크립트는 특정 플래폼에서 아파치 웹서버를 컴파일하고 설치하기
httpd.apache.org
-http.conf 파일 수정
vi /home/user/web/apache/conf/http.conf
#ServerName 검색 후 주석처리 해제
ServerName localhost:80
- 아파치 실행
/home/user/web/apache/bin/apachectl start
---------------------- 아래의 내용은 필요한 경우 참조----------------------
- 80포트 방화벽 허용
(su - 통해 root 접속 필요)
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --reload
firewall-cmd --list-ports
- apache 실행 권한 부여
(user로 apache 실행이 불가한 경우 su - 통해 root 접속 후 user에 실행권한 부여 필요)
chmod -Rf 755 /home/user/
cd /home/user/web/apache/bin
chown root:user httpd
chmod +s httpd
chown user:user apachectl
'Apache & Tomcat' 카테고리의 다른 글
[linux]Apache & Tomcat 연동 (mod_jk, tomcat-connector) (0) | 2024.06.27 |
---|---|
[linux] tomcat multiple instances (톰캣 멀티 인스턴스) (0) | 2024.06.19 |
a tomcat 8.0 installation is expected. 에러 해결 (0) | 2016.11.01 |
mac tomcat 설치 (맥에서 톰캣 설치) (2) | 2016.11.01 |
톰캣 Check that the corresponding file exists within your web application archive! 에러 (0) | 2015.09.22 |