1. 관련 라이브러리 설치
yum install gcc
yum install gcc-c++
yum install libstdc++
yum 명령어를 통해 관련 라이브러리 패키지를 설치합니다.
2. APR , APR-UTIL, PCRE2 설치
2-1. APR 설치
$ tar -zxvf apr-1.7.0.tar.gz
$ cd apr-1.7.0
$ ./configure --prefix=/usr/local
rm: cannot remove `libtoolT': No such file or directory
위와 같은 오류 발생 시 다음 명령 후 다시 ./configure 명령어를 실행 합니다.
$ ln -sf libtool libtoolT
$ ./configure --prefix=/usr/local
$ make
$ make install
2-2. APR-UTIL 설치
$ tar -xzvf apr-util-1.6.1.tar.gz
$ cd apr-util-1.6.1
$ ./configure --prefix=/usr/local/ --with-apr=/usr/local
$ make
$ make install
2-3. PCRE2 설치
$ tar -xzvf pcre2-10.40.tar.gz
$ cd pcre2-10.40
$ ./configure --prefix=/usr/local/ --with-apr-util=/usr/local/ --with-apr=/usr/local
$ make
$ make install
3. HTTP (Apache) 설치
$ tar -zxvf httpd-2.4.54.tar.gz
$ cd httpd-2.4.54
$ ./configure --prefix=/usr/local/apache2 --enable-modules=all
--enable-mods-shared=all --enable-so -with-apr=/usr/local -
-with-apr-util=/usr/local/ --with-ssl=builtin --enable-ssl=shared --with-pcre=/usr/local
$ make
$ make install
해당 SSL 사용 시 Yum 을 통해 openssl-devel 을 먼저 다운로드 해야합니다.
$ yum install openssl-devel
3. HTTP (Apache) 서비스 설정
서비스 설정을 위해서는 해당 /etc/systemd/system 경로 아래 httpd.service 를 만들어야 합니다.
$ cd /etc/systemd/system
$ vi httpd.service
httpd.service 내용은 다음과 같습니다.
[Unit]
Description=Apache HTTP Service
[Service]
Type=forking
PIDFile=/usr/local/apache2/logs/httpd.pid
ExecStart=/usr/local/apache2/bin/apachectl start
ExecStop=/usr/local/apache2/bin/apachectl stop
ExecReload=/usr/local/apache2/bin/apachectl graceful
KillSignal=SIGNOUT
PrivateTmp=true
[Install]
WantBy=muti-user.target
작성 완료 후 새로 고침을 한 후 상태확인 후 시작합니다.
$ systemctl daemon-reload
$ systemctl status httpd
$ systemctl start httpd