cp -r /usr/local/src/apr-1.4.6 /usr/local/src/httpd-2.4.7/srclib/apr
cp -r /usr/local/src/apr-util-1.4.1 /usr/local/src/httpd-2.4.7/srclib/apr-util
#这两个包先要解压缩,然后改名复制到指定位置
[root@localhost gd-2.0.35]# cd /usr/local/src/pcre-8.34
#进入解压缩目录
[root@localhost pcre-8.34]#./configure
#编译前配置
[root@localhost pcre-8.34]# make
#编译
[root@localhost pcre-8.34]# make install
#编译安装
[root@localhost pcre-8.34]# cd /usr/local/src/ httpd-2.4.7
[root@localhost httpd-2.4.7]# ./configure \ #编译前配置
--prefix=/usr/local/apache2/ \ #指定Apache安装目录
--sysconfdir=/usr/local/apache2/etc/ \ #指定Apache配置文件保存目录
--with-included-apr \ #使用捆绑APR/APR-Util 的副本
--enable-so \ #以动态共享对象(DSO)方式编译
--enable-deflate=shared \ #启用编小传输编玛支持的模块
--enable-expires=shared \ #根据用户的特别设定来生成失效和隐藏控制的HTTP头信息
--enable-rewrite-shared #启动重写功能的模块
[root@localhost httpd-2.4.7]# make
[root@localhost httpd-2.4.7]# make install
[root@localhost httpd-2.4.7]# /usr/local/apache2/bin/apachectl start
#启动Apache
[root@localhost httpd-2.4.7]# netstat -tlun | grep 80
tcp 0 0::80 ::* LISTEN
#80端口已经启动,说明Apache已经启动了
图 1 Apache测试页
[root@localhost httpd-2.4.7]# vi /etc/rc.local/usr/local/apache2/bin/apachectl start
#在rc.local文件中加入Apache启动命令
本文链接:http://task.lmcjl.com/news/12263.html