Linux安裝配置apache

來源:互聯網
上載者:User

標籤:not found   機器   pac   oam   編譯安裝   ref   lib   arch   產生   

1.下載解壓

cd /usr/local/src/
wget http://mirrors.sohu.com/apache/httpd-2.4.18.tar.gz
tar zvxf httpd-2.4.18.tar.gz
cd httpd-2.4.18

2.編譯安裝

./configure --prefix=/usr/local/apache2 --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --with-pcre

 

解釋:非常全的參數介紹 http://blog.chinaunix.net/uid-20784749-id-1844507.html編譯介紹: http://www.linuxidc.com/Linux/2015-04/116060.htm常用參數: http://www.cnblogs.com/xianglf/archive/2010/12/16/1908174.html./configure   編譯安裝 --prefix  編譯安裝完成後產生一個目錄,該軟體所有的檔案都會被複製到這個目錄裡面,為什麼要指定這個目錄呢?為了以後維護方便,如果不指定,檔案會被複製到系統下各個目錄,用prefix的另一個好處就是方便卸載和移植軟體。把刪除該目錄,整個軟體卸載的乾乾淨淨,移植只需要把這個目錄拷貝到另一台機器即可。 --with-included-apr  如果是開發人員則使用此選項,利於串連apache的代碼或者是調試apache,其消除了由於版本或者編譯中跟APR或者APR-util代碼產生的不匹配; --enable-so   讓apache核心裝載DSO --enable-deflate=shared  表示共用的方式編譯壓縮, apache開啟gizp的壓縮功能。網頁壓縮。擴充:http://blog.csdn.net/yybjroam05/article/details/7726516 --enable-expires=shared  網站需要用到緩衝功能,支援 HTTP 控制 --enable-rewrite=shared  支援 URL 重寫 --with-pcre

  

錯誤1

configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/. apache-2.2與新出的apache-2.4安裝不同的地方在於,2.4版的已經不內建apr庫,所以在安裝apache-2.4之前,需要下載apr。解決cd /usr/local/src  #源碼包統一放到此目錄wget http://mirrors.hust.edu.cn/apache/apr/apr-1.5.2.tar.bz2wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.4.tar.bz2tar -jxvf apr-1.5.2.tar.bz2tar -jxvf apr-util-1.5.4.tar.bz2cp -rf apr-1.5.2 ./httpd-2.4.18/srclib/aprcp -rf apr-util-1.5.4 ./httpd-2.4.18/srclib/apr-util#重新執行 configure 命令:

  

錯誤2

checking for gcc... nochecking for cc... nochecking for cl.exe... no沒有gcc編譯器解決yum install gcc -y#重新執行 configure 命令:

  

 

錯誤3

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org 配置:錯誤:pcre-config libpcre不見了。PCRE是必需的,可以從http://pcre.org解決:yum -y install pcre-devel#重新執行 configure 命令:

  

錯誤4

checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures 檢查是否啟用mod_deflate……配置:錯誤:mod_deflate一直要求但是不能建立由於先決條件失敗解決yum install  zlib-devel -y#重新執行 configure 命令:

  

makemake install

  

儲存鏡像3.備忘apache安裝ok

 

apache安裝完成

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.