centos 安裝apache2.4及php總結

centos6.5默認安裝apache2.2, 因爲apache已知漏洞,須要升級至apache2.4。

但,yum中的apache最高版本即爲2.2,須要使用源碼安裝方式。

整體安裝參考文章:http://php.net/manual/zh/install.unix.apache2.php

http://httpd.apache.org/docs/current/install.html

部分調整:

一、./configure –prefix=/usr/local/apache2 -enable-rewrite -enable-so -with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util

遇到問題:成功安裝後,執行以下命令

cd /usr/local/apache2/bin

httpd -v

顯示的版本信息仍然是系統默認安裝的2.2.15。難道沒安裝成功?

No, 此處執行的httpd是系統path路徑中的,即/usr/sbin/httpd這個文件。

手工刪除原有httpd,新建2.4的httpd的軟鏈接便可。

二、./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --enable-mbstring --with-pdo-mysql

前提:yum install libpng-devel

說明--with-gd開啓gd模塊用於drupalphp

相關文章
相關標籤/搜索