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

部分调整:

1、./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的软连接即可。

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

前提:yum install libpng-devel

说明--with-gd开启gd模块用于drupal

你可能感兴趣的:(centos 安装apache2.4及php总结)