사전 설치
yum install -y gcc gcc-c++ pcre-devel expat-devel make
1. apr, apr-util, pcre, httpd 다운로드 및 압축해제
cd /tmp
wget [<http://mirror.navercorp.com/apache//apr/apr-1.7.0.tar.gz>](<http://mirror.navercorp.com/apache//apr/apr-1.7.0.tar.gz>)
wget [<http://mirror.navercorp.com/apache//apr/apr-util-1.6.1.tar.gz>](<http://mirror.navercorp.com/apache//apr/apr-util-1.6.1.tar.gz>)
wget [<https://archive.apache.org/dist/httpd/httpd-2.4.46.tar.gz>](<https://archive.apache.org/dist/httpd/httpd-2.4.46.tar.gz>)
tar zxvf apr-1.7.0.tar.gz
tar zxvf apr-util-1.6.1.tar.gz
tar zxvf httpd-2.4.46.tar.gz
직접 다운로드후 서버로 복사
[<https://sourceforge.net/projects/pcre/files/pcre/8.43/pcre-8.43.tar.gz/download>](<https://sourceforge.net/projects/pcre/files/pcre/8.43/pcre-8.43.tar.gz/download>)
tar zxvf pcre-8.43.tar.gz
mv apr-1.7.0/ /tmp/httpd-2.4.46/srclib/apr
mv apr-util-1.6.1/ /tmp/httpd-2.4.46/srclib/apr-util
2. pcre 설치
cd /tmp/pcre-8.43
./configure --prefix=/usr/local/pcre
make
make install
3. apache 설치
cd /tmp/httpd-2.4.46
./configure --prefix=/usr/local/httpd-2.4.46 --with-included-apr --with-pcre=/usr/local/pcre/bin/pcre-config
make
make install
4. systemd 등록
수동 설치 할 경우 systemd에 서비스가 등록 되지 않아 수동으로 등록
vi /usr/lib/systemd/system/httpd.service
[Unit]
Description=The Apache HTTP Server
[Service]
Type=forking
#EnvironmentFile=/usr/local/apache2/bin/envvars
PIDFile=/usr/local/httpd-2.4.46/logs/httpd.pid
ExecStart=/usr/local/httpd-2.4.46/bin/apachectl start
ExecReload=/usr/local/httpd-2.4.46/bin/apachectl graceful
ExecStop=/usr/local/httpd-2.4.46/bin/apachectl stop
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target
:wq
systemctl daemon-reload
systemctl restart httpd
systemctl enable httpd
5. 홈페이지 접속