實驗環境:
centos6.3
2.6.32-431.20.3.el6.i686
用到的包:
APR 1.5.1
APR-util 1.5.3
httpd-2.4.9
操作步驟:
第一步:根據依賴關係,先解壓、編譯安裝apr1.5.1
# tar xf apr-1.5.1.tar.bz2 -C /home
# cd /home/apr-1.5.1
# ./configure --prefix=/usr/local/apr
# make && make install
第二步:解壓、編譯安裝apr-util-1.5.3
# tar xf aprutil-1.5.3.tar.gz -C /home
# cd /home/apr-util-1.5.3
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make && make install
第三步:解壓、編譯安裝httpd-2.4.9
# tar xf httpd-2.4.9.tar.bz2 -C /home
# cd /home/httpd-2.4.9
# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mpms-shared=all --with-mpm=event --with-openssl=/usr/local/openssl
# make && make install
第四步:httpd簡單配置及啓動
cd /usr/local/apache/
ln -sv /usr/local/apache/include /usr/include/httpd
vim /etc/profile.d/httpd.sh \\申明PATH執行路徑
exprot PATH=/usr/local/apache/bin:$PATH
:wq
/etc/profile.d/httpd.sh \\執行腳本
apachectl start
cp /etc/rc.d/init.d/httpd /etc/rc.d/init.d/httpd24 \\修改啓動服務文件
vim /etc/rc.d/init.d/httpd24
apachectl=/usr/local/apache/bin/apachectl
httpd=${HTTPD-/usr/local/apache/bin/httpd}
pidfile=${PIDFILE-/usr/local/apache/logs/httpd.pid}
:wq
service httpd stop
service httpd24 start
第五步:apache詳細配置請參考其他文檔