컴파일 설치
컴파일 할 소스 다운로드
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 one of our mirrors. You must verify the integrity of the downloaded files using signatures downloaded from our main distribution directory. The signatures can be
httpd.apache.org
접속하여 최신버전 .tar.gz 파일을 다운받는다.
리눅스에서 직접 다운로드 설치
wget https://downloads.apache.org/httpd/httpd-2.4.52.tar.gz
압축해제
tar -xvf httpd-2.4.52.tar.gz
소스 설치시에는 자동으로 종속성이 설치가 되지 않으므로 수동으로 하나씩 종속성을 설치 해줘야 한다.
yum으로 설치시에는 종속성을 자동으로 설치해 준다.
종속성 설치
Apache는2.4 부터 apr,apr-util 이 소스에서 빠졌다. 별도로 설치해서 아파치 소스 경로에 복사 해 줘야 한다.
sudo yum install wget
sudo yum install net-tools
sudo yum install gcc
sudo yum install gcc-c++
sudo yum install make
sudo yum install pcre-devel
sudo yum install openssl-devel
sudo yum install expat-devel
// apr 다운로드
wget https://downloads.apache.org/apr/apr-1.7.2.tar.gz
압축을 푼다
tar -xvf apr-1.7.2.tar.gz
// apr-util 다운로드
wget https://downloads.apache.org/apr/apr-util-1.6.3.tar.gz
tar -xvf apr-util-1.6.3.tar.gz
압축해제한 파일들을 apache소스의 srclib폴더로 이동한다.
mv apr-1.7.2 httpd-2.4.52/srclib/apr
mv apr-util-1.6.3 httpd-2.4.52/srclib/apr-util
// pcre 다운로드
wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
tar -xvf pcre-8.45.tar.gz
// 아파치 서버를 설치할 폴더를 생서한다.
mkdir apps
// pcre 폴더로 이동해서 환경설정을 한다.
./configure --prefix=/apps
컴파일
make
컴파일 배포
make install
ls /apps
apps 폴더에 배포가 된것 확인
- 아파치 서버 Configuration
압축푼 아파이 폴더로 이동
cd httpd-2.4.52/
./configure \
--prefix=/apps/apache \
--with-included-apr \
--enable-ssl=shared \
--enable-rewrite \
--enable-modules=most \
--enable-mods-shared=all
에러없이 환경설정이 완료되었다면 make 명령어를 사용하여 컴파일 한다.
make
ERROR
xml/apr_xml.c:35:19: fatal error: expat.h: 그런 파일이나 디렉터리가 없습니다
-> sudo yum install expat-devel
undefined reference to `XML_GetErrorCode'
-> vi build/config_vars.mk
AP_LIBS 로 시작하는 라인을 찾아서 -lexpat을 추가 후 make.
컴파일 배포
make install
아파치 서버 기동
cd /apps/apache/bin
./apachectl start
다음과 같은 에러가 발생시 조치사항
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
httpd.conf 파일 열어서 ServerName 주석해제
ServerName localhost:80
저장후 실행
기동 확인
80 포트 기동 확인하기
curl http://localhost:80
외부 접속 가능하게 방화벽 포트 허용
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
firewall-cmd --list-all
'시스템 > 리눅스' 카테고리의 다른 글
Centos8 에 JenKins 설치 (0) | 2022.07.12 |
---|---|
Centos-stream8 postgressql 컴파일 설치 (0) | 2022.07.12 |
리눅스 sudo 권한 부여하기 (0) | 2021.12.23 |
CentOS,RHEL 리눅스 ISO파일로 로컬 저장소 만들기 (2) | 2021.12.23 |
인터넷 없는 환경에서 패키지 설치 (0) | 2021.12.15 |
댓글