Apache编译与安装 RedHat enterprises 6.2_SONY619-ChinaUnix博客

到http://httpd.apache.org/下载以源码方式安装,我下载的版本是Apache httpd 2.4.3

解压:[root@localhost apache]# tar -jxvf httpd-2.4.3.tar.bz2

配置环境:

[root@localhost httpd-2.4.3]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=all --enable-modules=most

提示configure: error: APR not found. Please read the documentation,

解决:
缺少Apr,下载http://projects.apache.org/indexes/quick.html

解压:[root@localhost apache]# tar zxvf apr-1.4.6.tar.gz

配置环境:

[root@localhost apr-1.4.6]# ./configure --prefix=/usr/local/apr/

编译和安装:

[root@localhost apr-1.4.6]#make

[root@localhost apr-1.4.6]#make install

编译安装完成apr之后,继续编译apache,又有如下的提示configure: error: APR-util not found. Please read the documentation

解决:

缺少APR-util,http://apr.apache.org/下载

解压: [root@localhost apache]# tar zxvf apr-util-1.4.1.tar.gz

配置环境:

在 [root@localhost apr-util-1.4.1]./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config时,提示configure: error: APR could not be located. Please use the --with-apr option,这是路径的问题(这个问题困扰我好久了,在这里找到了说明http://apache.jz123.cn/install.html),应该用下面的命令[root@localhost apr-util-1.4.1]./configure --with-apr=/usr/local/

继续编译Apache,晕啊,仍没有成功,提示如下configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

解决:

下载prce,网址http://sourceforge.net/projects/pcre/

解压:unzip pcre-8.31.zip

配置环境:

[root@localhost pcre-8.31]#./configure --prefix=/usr/local/

编译和安装:

[root@localhost pcre-8.31]#make

[root@localhost pcre-8.31]#make install

再次编译Apache,皇天不负有心人啊,终于通过了!此时运行httpd(service httpd start),在浏览器上输入127:0:0:1,就能看到下面的了

This page is used to test the proper operation of the Apache HTTP server after it has been installed. If you can read this page, it means that the Apache HTTP server installed at this site is working properly.

你可能感兴趣的:(安装,博客,编译)