Skip to content

Instantly share code, notes, and snippets.

@kitak
Last active December 23, 2015 07:39
Show Gist options
  • Save kitak/6602548 to your computer and use it in GitHub Desktop.
Save kitak/6602548 to your computer and use it in GitHub Desktop.
Apacheのソースコードビルドまとめ

iptables off

sudo /etc/init.d/iptables stop

事前にインストールが必要なもの

sudo yum groupinstall "Development Tools"
sudo yum install pcre-devel

(ここまでvagrantのprovisioningで走らせてもよいかも)

ソースコードの取得

http://httpd.apache.org/download.cgi から落とす

ビルドから起動まで

tar xvfz httpd-2.2.25.tar.gz
cd ./httpd-2.2.25
mkdir /usr/local/httpd-2.2.25
./configure --prefix=/usr/local/httpd-2.2.25
make
sudo make install
cd /usr/local/httpd-2.2.25
sudo chown -R daemon .
sudo chgrp -R daemon .
sudo ./bin/apachectl start

参考文献

http://httpd.apache.org/docs/2.2/ja/install.html

いちいちコマンド叩くのめんどくさいからシェルスクリプトにした

VERSION="2.0.65" # 2.4.6, 2.2.25, 2.0.65
TARGET="http://ftp.yz.yamagata-u.ac.jp/pub/network/apache//httpd/httpd-${VERSION}.tar.gz"
sudo /etc/init.d/iptables stop
sudo yum groupinstall -y "Development Tools"
sudo yum install -y pcre-devel
cd /vagrant
wget $TARGET
tar xvfz "httpd-${VERSION}.tar.gz"
cd ./httpd-$VERSION
mkdir /usr/local/httpd-${VERSION}
./configure --prefix=/usr/local/httpd-$VERSION
make
sudo make install
cd /usr/local/httpd-${VERSION}
sudo chown -R daemon .
sudo chgrp -R daemon .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment