在centos6編譯安裝http-2.4

在centos6 編譯安裝httpd-2.4

安裝httpd-2.4 apache

Ü 依賴於apr-1.4+, apr-util-1.4+, [apr-iconv] vim

Ü apr: : apache portable runtime ,解決跨平臺實現 centos

Ü CentOS 6 :默認:apr-1.3.9, apr-util-1.3.9 app

v 安裝前準備開發包: ui

Ü 開發環境包組: spa

Development Tools,Server ssl

相關包:pcre-devel ,openssl-devel expat-devel 開發

下載源代碼並解壓縮: openssl

httpd-2.4.27.tar.bz2 it

apr-1.6.2.tar.bz2

apr-util-1.6.0.tar.bz2

安裝apr-1.4+

cd apr-1.6.2

./configure --prefix=/app/apr

make && make install

安裝apr-util-1.4+

cd ../apr-util-1.6.0

./configure --prefix=/app/apr-util --with-

apr=/app/apr/

make -j 2 && make install

 

編譯安裝httpd-2.4

cd ../httpd-2.4.27

./configure --prefix=/app/httpd24 --enable-so --

enable-ssl --enable-cgi --enable-rewrite --with-zlib

--with-pcre --with-apr=/app/apr/ --with-apr-

util=/app/apr-util/ --enable-modules=most --enable-

mpms-shared=all --with-mpm=prefork

make -j 4 && make install

 

centos6 編譯安裝httpd-2.4 方法二

cp -av apr-util-1.6.0 httpd-2.4.27/srclib/apr-util

cp -av apr-1.6.2 httpd-2.4.27/srclib/apr

cd httpd-2.4.27/

./configure --prefix=/usr/local/httpd24 --enable-

so --enable-ssl --enable-cgi --enable-rewrite --

with-zlib --with-pcre --with-included-apr --

enable-modules=most --enable-mpms-shared=all --

with-mpm=prefork

make && make install

v Httpd 編譯過程:/usr/local/apache24/build/config.nice

v 自帶的服務控制腳本:/usr/local/httpd24/bin/apachectl

 

在centos6 編譯安裝httpd-2.4

vim /etc/profile.d/httpd24.sh

export PATH=/app/http24/bin:$PATH

v vim /etc/man.config

MANPATH /usr/local/apache24/man

v 自 定義啓動腳本( 參考httpd-2.2 的服務腳本)

cp /etc/rc.d/init.d/httpd /etc/rc.d/init.d/httpd24

vim /etc/rc.d/init.d/httpd24

apachectl=/usr/local/httpd24/bin/apachectl

httpd=${HTTPD-/usr/local/httpd24/bin/httpd}

pidfile=${PIDFILE-/usr/local/httpd24/logs/httpd.pid}

lockfile=${LOCKFILE-/var/lock/subsys/httpd24}

chkconfig –add httpd24 ;chkconfig –list httpd24

相關文章
相關標籤/搜索