1.检查是否安装apache
rpm -qa | grep apache
或 rpm -qa | grep httpd
卸载apache
rpm -e gnome-user-share-2.28.2-3.el6.i686
rpm -e httpd-2.2.15-5.el6.centos.i686
rpm -e httpd-tools-2.2.15-5.el6.centos.i686
重启是否看是否影响系统运行
2.安装依赖软件
(1)下载APR和APR-util(apr.apache.org)
解压并将其复制到$APACHE_SOURCE_LOCATION/srclib/apr
注:复制,目标文件夹不包含版本号
cp -r apr-1.4.6 httpd-2.4.1/srclib/apr
cp -r apr-util-1.4.1 httpd-2.4.1/srclib/apr-util
(2)安装perl-compatible Regular Expressions Library
./configure --prefix=/usr/local/pcre
make
make install
3.下载apache httpd
./configure --enable-so --with-included-apr --with-pcre=/usr/local/pcre
make
make install
4.测试是否安装成功
./apachectl -k start
在浏览器地址栏输入:http://localhost;看见It works!,表示安装成功。
./apachectl -k stop