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