httpdをソースコードからインストール

CentOSで行った.

インストール

yum install -y gcc make pcre pcre-devel wget

cd /usr/local/src
wget http://ftp.yz.yamagata-u.ac.jp/pub/network/apache//apr/apr-1.5.2.tar.gz
tar xzvf apr-1.5.2.tar.gz 
cd apr-1.5.2
./configure --prefix=/opt/apr/apr-1.5.2
make
make test
make install

cd /usr/local/src
wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-util-1.5.4.tar.gz
tar -xvzf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/opt/apr-util/apr-util-1.5.4 --with-apr=/opt/apr/apr-1.5.2
make
make test
make install 

cd /usr/local/src
wget http://ftp.jaist.ac.jp/pub/apache/httpd/httpd-2.4.18.tar.gz
tar -xvzf httpd-2.4.18.tar.gz
cd /usr/local/src/httpd-2.4.18
./configure --prefix=/opt/httpd/httpd-2.4.18 --with-apr=/opt/apr/apr-1.5.2 --with-apr-util=/opt/apr-util/apr-util-1.5.4
make
make install

動的モジュールのインストール

# httpd開発ツール
yum install -y httpd-devel

そして

# mod_infoを入れる場合
httpd -M | grep info # 何も出ない場合, 未インストール
cd /Apacheのソース/modules/generators/
apxs -i -a -c mod_info.c

httpd.conf側で

LoadModule info_module modules/mod_info.so

<IfModule mod_info.c>
  <Location /server-info>
    SetHandler server-info
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
  </Location>
</IfModule>

としてhttpdを再起動