linux下安裝apache

來源:互聯網
上載者:User

標籤:style   http   io   color   ar   sp   for   檔案   div   


1:Apache 官方網http://httpd.apache.org/下載所需安裝包 httpd-2.4.10.tar.gz
   
2: 上傳到伺服器  目錄自行決定  tar -zxvf 3:mv httpd-2.4.10 apache
    cd apache
    設定安裝參數,命令如下:
   ./configure --prefix=/usr/local/apache --enable-module=so 


4:可能會出現以下錯誤 
   checking for APR... no configure: error: APR not found . Please read the documentation.
 則需要安裝apr-1.4.2.tar.gz 
5:下載apr-1.4.2.tar.gz 
   a):上傳到伺服器,tar -zxvf apr-1.4.2.tar.gz  
     b): cd apr-1.4.2
     c):  ./configure 
   d):make , make install


6:再次檢查編譯環境出現  ,可能會出現以下錯誤 


       checking for APR-util... no configure: error: APR-util not found . Please read the documentation.


7:下載apr-util-1.3.9.tar.gz
   a):上傳到伺服器,tar -zxvf apr-util-1.3.9.tar.gz
     b): cd apr-util-1.3.9
     c):  ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
   d):make , make install
      
8:再次檢查編譯環境出現  ,可能./configure仍提示APR-util not found,增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util後出現
 
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/


9:下載pcre-8.10.zip


   a):上傳到伺服器,unzip -o pcre-8.10.zip
     b): cd pcre-8.10
     c): ./configure --prefix=/usr/local/pcre
   d):make , make install


10:繼續安裝Apache/httpd
./configure  --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pare
make
make install 


11:進入到/usr/local/apache  修改PATH環境變數,      在登入使用者的home目錄開啟.bash_profile,在檔案中添加一行      PATH=$PATH:/usr/local/apache/bin
12: apachectl start  啟動  預設連接埠:80
13:http://ip:80  出現it works!表示正常配置。

14:說明:文檔中出現的路徑都是我自己伺服器路徑,並且注意安裝版本,其他可能存在不相容問題,
http://download.csdn.net/detail/tangyuanshark/7713369 
這裡的幾個安裝檔案我已經測試,正常安裝。



linux下安裝apache

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.