Apache httpd 2.4 インストール2016/08/30 |
|
CentOS 6 標準の Apache httpd のバージョンは 2.2系ですが、2.4系を RPM パッケージでインストールします。
|
|
| [1] | CentOS SCLo Software Collections からインストール可能です。 なお、デフォルトバージョンの 2.2系がインストールされた状態でも、Software Collections パッケージは別パスにインスールされるため、複数バージョンの共存が可能となっています。 |
|
# SCLoからインストール [root@www ~]# yum --enablerepo=centos-sclo-rh -y install httpd24
|
| [2] | Software Collections パッケージは /opt 配下にインストールされます。 /opt 配下にインストールされたコマンドを、環境変数を読み込んで利用するには以下のように実行します。 |
|
# 環境変数を読み込む [root@www ~]# scl enable httpd24 bash
httpd -V
Server version: Apache/2.4.18 (Red Hat)
Server built: Jul 19 2016 22:15:59
Server's Module Magic Number: 20120211:52
Server loaded: APR 1.5.1, APR-UTIL 1.5.4
Compiled using: APR 1.5.1, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/opt/rh/httpd24/root/etc/httpd"
-D SUEXEC_BIN="/opt/rh/httpd24/root/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/opt/rh/httpd24/root/var/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
[root@www ~]# which httpd /opt/rh/httpd24/root/usr/sbin/httpd |
| [3] | 起動/停止等の操作は通常通りです。CentOS 6 標準パッケージの httpd 2.2 との併用も可能ですが、その場合はいずれかの起動ポートをデフォルトの 80 から変更する必要があります。 |
|
# 2.2 停止 [root@www ~]# /etc/rc.d/init.d/httpd stop Stopping httpd: [ OK ] # 2.4 起動 [root@www ~]# /etc/rc.d/init.d/httpd24-httpd start Starting httpd: [ OK ] # 自動起動設定 [root@www ~]# chkconfig httpd24-httpd on |
|
|