Apache2.4.2編譯安裝2個常見錯誤和解決方案_Linux

來源:互聯網
上載者:User

嘗試了一把從2005年以來第一次重大更新的新版本apache,不僅加入了雲端運算的基因更大幅提升了效能,I/O讀寫和記憶體佔用最佳化程度比較大,主要是增加了一個enevt模式,測試效果不錯。

實際我測試的 單純的編譯後靜態檔案和nginx的處理效能,確實已經相差不大,測試是使用ab測試的,單台nginx和阿帕奇測試後對比資料獲得的結果,下次進行系統的測試在發測試資料,暫時只是測試了jpg圖片 和html靜態檔案 資料可能沒代表性。

下面把編譯的時候,常見的錯誤貼下:

錯誤一:

複製代碼 代碼如下:
rotatelogs.o: In function post_rotate':
rotatelogs.c:(.text+0x5ed): undefined reference to apr_file_link'
collect2: ld returned 1 exit status
make[2]: *** [rotatelogs] Error 1
make[2]: Leaving directory /root/src/httpd-2.4.2/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory /root/src/httpd-2.4.2/support'
make: *** [all-recursive] Error 1

這些是因為沒apr的包

有2個解決方案:

第一種解決辦法:

複製代碼 代碼如下:
yum remove “apr*”
wget http://ftp.jaist.ac.jp/pub/apache/apr/apr-1.4.6.tar.gz
tar xzf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure ; make ; make install
wget http://ftp.jaist.ac.jp/pub/apache/apr/apr-util-1.4.1.tar.gz
tar zxvf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
./configure –with-apr=/usr/local/apr
yum install -y pcre-devel lua-devel libxml2-devel

第二種解決辦法:
下載arp的包以後 cp到httpd的檔案夾
複製代碼 代碼如下:
cp -r apr-1.4.6 httpd-2.4.2/srclib/apr
cp -r apr-util-1.4.1 httpd-2.4.2/srclib/apr-util

就可以解決了

第二個常見的錯誤 這種只有mini安裝會出現 一般大部分菜鳥都不會安裝devel的包

複製代碼 代碼如下:
checking for OpenSSL version >= 0.9.7… FAILED
configure: WARNING: OpenSSL version is too old
no
checking whether to enable mod_ssl… configure: error: mod_ssl has been requested but can not be built due to prerequisite failures

解決辦法

複製代碼 代碼如下:
yum install openssl-devel
yum update openssl

近期準備把所有伺服器都升級到httpd 2.4.2 獲得更好的效能

聯繫我們

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