apache的原始碼編譯安裝

來源:互聯網
上載者:User

標籤:

1.下載Apache安裝包,http://httpd.apache.org/,我下載的是httpd-2.4.16,是最新的;然後對安裝包進行解壓,並進行初始化配置和編譯安裝;

 

 編譯命令:

./configure –prefix=/usr/local/apache –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util –with-pcre=/usr/local/pcre(這是初始化配置,--prefix代表apache安裝的目錄是/usr/local/apache,後面幾個—with代表除了安裝apache,還要依賴於要安裝apr,apr-util,pcre幾個關聯包)

make

make install

 

 

在編譯apache-2.4.16時分別出現了apr not found、APR-util not found、pcre-config for libpcre

not found的問題,下面就httpd-2.4.3的這些問題解決來實際操作。

 

首先在apache官網下載apr,apr-util和pcre幾個安裝包

1解決apr not found問題

 tar –zxvf apr-1.5.2.tar.gz

 ./configure --prefix=/usr/local/apr

 make

 make install

 

2.解決APR-util not found問題

 tar –zxvf apr-util-1.5.4

 ./configure –prefix=/usr/local/apr-util

 make

 make install

 

3、解決pcre-config for libpcre not found問題

 tar –zxvf pcre-8.36

 ./configure –prefix=/usr/local/pcre

 make

 make install

 

啟動Apache:/usr/local/apache/bin/apachectl start

 

網站放在/usr/local/apache/htdocs目錄下

在IE中輸入http://localhost:80,如果看到頁面中顯示“It works!”字樣,則代表Apache驗證通過;

 

2.關於安裝pcre出現的一些問題總結:

我在編譯pcre的時候,也即是make這一步的時候,總是出現“no rule to make target ‘AUTHORS’,needed by all-am,stop”這樣的錯誤,意思是編譯Makefile這個檔案時沒有找到目標檔案AUTHORS的意思,其實pcre這個目錄下是有authors這個檔案,但是是小寫,然後我就把authors這個檔案改成大寫後,編譯的錯誤就沒發生了,pcre也就正常安裝了。

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.