在CentOS6安装apache源码包

来源:互联网 发布:好用的洗面奶知乎 编辑:程序博客网 时间:2024/06/05 14:07

一、安装准备

1.安装C语言编辑器:gcc

2.在http://mirror.bit.edu.cn/apache/httpd上下载安装包

3.安装WinSCP

  将下载在windows上的httpd安装拷贝到Linux /root下

 


二、安装

1.解压httpd安装包:在/root下输入  tar -zxvf httpd-2.2.34.tar.gz。

2.进入解压目录:cd httpd-2.2.34。

3.查看安装帮助:vi INSTALL。(步骤在INSTALL文件中带$的语句)

4.指定安装路径: ./configure --prefix=/usr/local/apache。

  我安装时出现错误:configure error:Cannot use an external APR with the bundled APR-util。

  此时需要安装apr和apr-util。

5.安装apr:

cd srclib/apr

./configure --prefix=/usr/local/apr

make && make install

6.安装apt-util:

cd srclib/apr-util

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

make && make install

7.安装apache:

./configure --prefix=/usr/local/apache  --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

make && make instal


三、启动

prefix/bin/apachectl start:/usr/local/apache/bin/apachectl start。

报错httpd:Could not reliably determine the server's fully qualified domain name,using localhost.localdomain for ServerName.