13,002
回編集
28行目: | 28行目: | ||
Apache2をビルドするために必要なライブラリをインストールする。<br> | Apache2をビルドするために必要なライブラリをインストールする。<br> | ||
sudo zypper install apr-devel apr-util-devel expat-devel libnghttp2-devel zlib-devel libxml2-devel \ | sudo zypper install apr-devel apr-util-devel expat-devel libnghttp2-devel zlib-devel libxml2-devel \ | ||
libopenssl-devel libopenssl-1_1-devel lua53-devel pcre-devel | libopenssl-devel libopenssl-1_1-devel lua53-devel pcre-devel systemd-devel | ||
<br> | <br> | ||
[https://httpd.apache.org/download.cgi Apache2の公式Webサイト]にアクセスして、ソースコードをダウンロードする。<br> | [https://httpd.apache.org/download.cgi Apache2の公式Webサイト]にアクセスして、ソースコードをダウンロードする。<br> | ||
39行目: | 39行目: | ||
../configure --prefix=<Apache2のインストールディレクトリ> \ | ../configure --prefix=<Apache2のインストールディレクトリ> \ | ||
--with-apr --with-apr-util \ | |||
--with-included-apr \ # srclib内のAPRとAPR-Utilもビルド対象にする | --with-included-apr \ # srclib内のAPRとAPR-Utilもビルド対象にする | ||
--with-mpms-shared=all \ # worker, prefork, eventをビルド対象にする | |||
--with-pcre=<PCREのインストールディレクトリ> \ # 例. /usr/local/src/pcre-<バージョン>/pcre-config | --with-pcre=<PCREのインストールディレクトリ> \ # 例. /usr/local/src/pcre-<バージョン>/pcre-config | ||
--with-ssl=<OpenSSLのインストールディレクトリ> \ # 例. /usr/local/src/ssl | --with-ssl=<OpenSSLのインストールディレクトリ> \ # 例. /usr/local/src/ssl | ||
-- | --enable-dav --enable-dav-fs \ | ||
--enable-deflate \ | |||
--enable-headers \ | |||
--enable-mods-shared=all \ # 動的モジュールをビルド対象にする | --enable-mods-shared=all \ # 動的モジュールをビルド対象にする | ||
--enable-proxy --enable-proxy-ajp \ | |||
--enable-rewrite=shared \ | |||
--enable-ssl \ # SSLモジュールをビルド対象にする | --enable-ssl \ # SSLモジュールをビルド対象にする | ||
--enable- | --enable-speling=shared \ | ||
--enable-systemd | |||
make -j $(nproc) | make -j $(nproc) | ||
make install | make install | ||
68行目: | 76行目: | ||
Description=The Apache HTTP Server | Description=The Apache HTTP Server | ||
After=network.target remote-fs.target nss-lookup.target | After=network.target remote-fs.target nss-lookup.target | ||
Documentation=man:httpd(8) | |||
Documentation=man:apachectl(8) | |||
[Service] | [Service] | ||
Type=forking | Type=forking | ||
#Type=notify | |||
#EnvironmentFile=/<Apache2の設定ファイルがあるディレクトリ>/conf/httpd.conf | |||
#Environment=LD_LIBRARY_PATH=/usr/local/ssl/lib:/usr/local/lib:/usr/local/lib64:/usr/lib | |||
ExecStart=/<Apache2のインストールディレクトリ>/bin/apachectl start | ExecStart=/<Apache2のインストールディレクトリ>/bin/apachectl start | ||
ExecReload=/<Apache2のインストールディレクトリ>/bin/apachectl graceful | ExecReload=/<Apache2のインストールディレクトリ>/bin/apachectl graceful | ||
ExecStop=/<Apache2のインストールディレクトリ>/bin/apachectl stop | ExecStop=/<Apache2のインストールディレクトリ>/bin/apachectl stop | ||
#ExecStart=/<Apache2のインストールディレクトリ>/bin/httpd \$OPTIONS -DFOREGROUND | |||
#ExecReload=/<Apache2のインストールディレクトリ>/bin/httpd \$OPTIONS -k graceful | |||
#ExecStop=/bin/kill -WINCH \${MAINPID} | |||
# 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] | [Install] |