34. CentOS-6.3安裝配置Apache2.2.6

來源:互聯網
上載者:User

標籤:

安裝說明

安裝環境:CentOS-6.3
安裝方式:源碼編譯安裝 
軟體:httpd-2.2.6.tar.gz  | pcre-8.32.tar.gz | apr-1.4.6.tar.gz | apr-util-1.5.1.tar.gz
:http://mirror.bjtu.edu.cn/apache/httpd/
http://apr.apache.org/download.cgi
http://jaist.dl.sourceforge.net/project/pcre/pcre
安裝位置:/urs/local/apache

安裝前提

系統已安裝了gcc和cmake,如果沒有安裝請參考《CentOS-6.3安裝配置Cmake》。 
執行以下操作:

#檢查是否安裝了apache
[[email protected] /]# rpm -qa | grep httpd
httpd-2.2.15-15.el6.centos.1.x86_64
httpd-tools-2.2.15-15.el6.centos.1.x86_64
#卸載系統內建的apache
[[email protected] /]# rpm -e --nodeps httpd-2.2.15-15.el6.centos.1.x86_64
[[email protected] /]# rpm -e --nodeps httpd-tools-2.2.15-15.el6.centos.1.x86_64

#使用yum卸載 
[[email protected] apache]# yum remove apache

#檢驗apr版本,卸載安裝新版本 
[[email protected] apache]# rpm -qa | grep apr
apr-1.3.9-5.el6_2.x86_64
apr-util-1.3.9-3.el6_0.1.x86_64
apr-util-ldap-1.3.9-3.el6_0.1.x86_64
#卸載apr
[[email protected] apache]# yum remove apr
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs
#安裝pcre
[[email protected] local]#  tar -zxv -f pcre-8.32.tar.gz
[[email protected] local]#  cd pcre-8.32
[[email protected] apr-1.4.6]# ./configure
[[email protected] apr-1.4.6]# make
[[email protected] apr-1.4.6]# make install

#安裝新版本apr
[[email protected] local]#  tar -zxv -f apr-1.4.6.tar.gz
[[email protected] local]#  cd apr-1.4.6
[[email protected] apr-1.4.6]# ./configure --prefix=/usr/local/apr
[[email protected] apr-1.4.6]# make
[[email protected] apr-1.4.6]# make install

#安裝apr-util
[[email protected] local]#  tar -zxv -f apr-util-1.5.1.tar.gz
[[email protected] local]# cd apr-util-1.5.1
[[email protected] apr-util-1.5.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[[email protected] apr-util-1.5.1]# make
[[email protected] apr-util-1.5.1]# make install

安裝apache

將httpd-2.4.3.tar.gz上傳到/usr/local中,執行以下操作:

#執行安裝 
[[email protected] local]# cd /usr/local
[[email protected] local]# tar -zxv -f httpd-2.4.3.tar.gz           #解壓壓縮包 
[[email protected] local]# rm -rf httpd-2.4.3.tar.gz            #刪除壓縮包 
[[email protected] local]# mv httpd-2.4.3 apache
[[email protected] local]# cd apache
#設定參數安裝 
[[email protected] php5.4]# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/
[[email protected] php5.4]# make
[[email protected] php5.4]# make install
驗證安裝

啟動apache伺服器:

[[email protected] /]# /usr/local/apache/bin/apachectl start

使用瀏覽器訪問:http://192.168.15.239/ 出現以下資訊: 

恭喜,安裝成功!!

 

34. CentOS-6.3安裝配置Apache2.2.6

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.