天天看點

編譯安裝httpd

httpd-2.4 編譯安裝

 ①依賴于更高版本的apr和apr-util。apr全稱為apache portable runtime(一個讓apache跨平台的     工具,底層庫)

 ②依賴于pcre-devel

安裝包

編譯安裝httpd
1、關閉目前系統的httpd服務

# service httpd stop   停止服務
# chkconfig httpd off  開機不啟動      

2、安裝pcre-devel

#yum -y install pcre-devel      

3、編譯安裝apr-1.5.0

#tar xf apr-1.5.0.tar.bz2
#cd apr-1.5.0
#./configure --prefix=/usr/local/apr
#make && make install      

4、編譯安裝apr-util-1.5.3

# tar xf apr-util-1.5.3.tar.bz2
# cd apr-util-1.5.3
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make && make install      
# tar xf apr-util-1.5.3.tar.bz2
# cd apr-util-1.5.3
# ./configure
# make && make install      

5、 編譯安裝httpd

# tar xf httpd-2.4.9.tar.bz2
# cd httpd-2.4.9
# ./configure --help
# ./configure --prefix=/usr/local/apache --sysconfdir=
/etc/httpd24 --enable-so --enable-ssl --enable-cgi --en
able-rewrite --with-zlib --with-pcre --with-apr=/usr/lo
cal/apr --with-apr-util=/usr/local/apr-util --enable-mo
dules=most --enable-mpms-shared=all -with-mpm=event
# make && make install      

6、編譯後的配置

  6.1 導出頭檔案  

# ln -sv /usr/local/apache/include /usr/include/httpd      

  6.2 導出庫檔案

# ln -sv /usr/local/apache/include /usr/include/httpd      

  6.3 配置二進制檔案

# vim /etc/profile.d/httpd.sh
  export PATH=/usr/local/apache/bin:$PATH      

  6.4 配置man手冊

# vim /etc/man.config
  MANPATH /usr/local/apache/man
# man -M /usr/local/apache/man httpd      

  6.5 檢測

# apachectl start
# apachectl stop
# apachectl restart
# ss -ntl      

繼續閱讀