CentOS7にソースから最新版apacheをインストール
2016/02/24
パッケージからではなく、ソースから最新版のapacheをインストールします。
サーバ環境
CentOS Linux release 7.1.1503 (Core)
ビルドに必要なソフトインストール
yum -y install gcc pcre-devel gcc-c++ openssl-devel
APRインストール
cd /usr/local/src
wget http://ftp.tsukuba.wide.ad.jp/software/apache/apr/apr-1.5.2.tar.gz
tar zxvf apr-1.5.2.tar.gz
cd apr-1.5.2/
./configure && make && make test
make install
APR-utilインストール
cd /usr/local/src
wget http://ftp.tsukuba.wide.ad.jp/software/apache/apr/apr-util-1.5.4.tar.gz
tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4/
./configure --with-apr=/usr/local/apr && make && make test
make install
Apacheインストール
cd /usr/local/src
wget http://ftp.tsukuba.wide.ad.jp/software/apache/httpd/httpd-2.4.12.tar.gz
tar zxvf httpd-2.4.12.tar.gz
cd httpd-2.4.12
./configure --prefix=/usr/local/apache2 \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
--enable-logio \
--enable-headers \
--enable-ssl \
--enable-rewrite \
--enable-so
make install
Apacheの起動
/usr/local/apache2/bin/apachectl start