嘗試了一把從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 獲得更好的性能
新聞熱點
疑難解答