Install the latest version of Apache from the source in the environment where CentOS-8.1.1911-x86_64 was installed with "minimum installation". SSL settings are excluded
dnf -y update
dnf -y install gcc gcc-c++ make wget tar systemd-devel perl libtool
Check the latest version http://apr.apache.org/
cd /usr/local/src
wget http://ftp.meisei-u.ac.jp/mirror/apache/dist//apr/apr-1.7.0.tar.gz
tar xvzf apr-1.7.0.tar.gz
cd apr-1.7.0
./configure
make
make install
Check the latest version https://libexpat.github.io/
cd /usr/local/src
wget https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.gz
tar xvzf expat-2.2.9.tar.gz
cd expat-2.2.9
./configure
make
make install
Check the latest version http://apr.apache.org/
cd /usr/local/src
wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-util-1.6.1.tar.gz
tar xvzf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --with-apr=/usr/local/apr
make
make install
Check the latest version https://www.pcre.org/
cd /usr/local/src
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar xvzf pcre-8.44.tar.gz
cd pcre-8.44
./configure
make
make install
Check the latest version https://www.zlib.net/
cd /usr/local/src
wget http://zlib.net/zlib-1.2.11.tar.gz
tar xvzf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
make install
Check the latest version https://httpd.apache.org/
cd /usr/local/src/
wget http://ftp.jaist.ac.jp/pub/apache//httpd/httpd-2.4.43.tar.gz
tar xvzf httpd-2.4.43.tar.gz
cd httpd-2.4.43/
./configure --with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr \
--enable-mods-shared=reallyall \
--enable-proxy \
--enable-proxy-ajp \
--enable-dav \
--enable-dav-fs \
--enable-headers \
--enable-rewrite=shared \
--enable-deflate \
--with-pcre=/usr/local
make
make install
cd /usr/local/src/httpd-2.4.43/modules/arch/unix
/usr/local/apache2/bin/apxs -c mod_systemd.c -I /usr/include/systemd/sd-daemon.h
libtool \
--silent \
--mode=compile gcc -std=gnu99 -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong \
--param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_LARGEFILE64_SOURCE -DLINUX -D_REENTRANT -D_GNU_SOURCE \
-pthread -I/usr/local/apache2/include -I/usr/local/apr/include/apr-1 -c -o mod_systemd.lo mod_systemd.c && touch mod_systemd.slo
libtool \
--silent \
--mode=link gcc -std=gnu99 -Wl,-z,relro,-z,now,-L/usr/lib64 -o mod_systemd.la -rpath /usr/local/apache2/modules -module -avoid-version mod_systemd.lo
libtool \
--silent \
--mode=link gcc -std=gnu99 -Wl,-z,relro,-z,now,-L/usr/lib64 -o mod_systemd.la -rpath /usr/local/apache2/modules -module -avoid-version mod_systemd.lo -lsystemd
/usr/local/apache2/bin/apxs -i -a -n systemd mod_systemd.la
vi /usr/lib/systemd/system/httpd.service
httpd.service
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)
[Service]
Type=forking
ExecStart=/usr/local/apache2/bin/apachectl start
ExecReload=/usr/local/apache2/bin/apachectl graceful
ExecStop=/usr/local/apache2/bin/apachectl stop
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target
/usr/local/apache2/bin/httpd -v
Server version: Apache/2.4.43 (Unix)
Server built: Apr 24 2020 20:01:27
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
systemctl daemon-reload
systemctl start httpd
systemctl enable httpd
systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2020-04-24 20:07:26 EDT; 30min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 26056 (httpd)
Tasks: 109 (limit: 23922)
Memory: 17.9M
CGroup: /system.slice/httpd.service
├─26056 /usr/local/apache2/bin/httpd -k start
├─26057 /usr/local/apache2/bin/httpd -k start
├─26058 /usr/local/apache2/bin/httpd -k start
├─26059 /usr/local/apache2/bin/httpd -k start
└─26164 /usr/local/apache2/bin/httpd -k start
http://lostname/ Please access.
It is OK if the following screen is displayed.
https://qiita.com/shadowhat/items/163ee5fdd56c51100e9e
https://www.smiyasaka.com/CentOS7.0_server21.html
Recommended Posts