下载安装包

wget http://apache.etoak.com/httpd/httpd-2.2.11.tar.gz

创建apache用户

groupadd apache;useradd -g apache apache

编译安装

./configure --prefix=/usr/local/apache2 \
--enable-modules=all \
--enable-ssl \
--enable-so \
--enable-rewrite \
--enable-mime-magic \
--enable-file-cache \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
--enable-static-rotatelogs \
--enable-vhost-alias
make
make install

配置

修改apache配置文件

vi /usr/local/apache2/conf/httpd.conf

修改:

DirectoryIndex index.html index.htm index.php
User apache
Group apache

添加:

ServerName 127.0.0.1:80
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps

启动apache

/usr/local/apache2/bin/apachectl start

设置开机启动

vi /etc/rc.local

添加

/usr/local/apache2/bin/apachectl start

感谢老男赐予的文档…