CentOS源码安装 apache2.2.5


参看:http://blog.csdn.net/cookies_6362/article/details/2881206

(1) 获得源代码

  # lynx http://www.apache.org/dist/httpd/httpd-2_0_NN.tar.gz

  NN表示当前所用的版本号。

(2) 解压缩

  # gzip -d httpd-2_0_NN.tar.gz

  # tar xvf httpd-2_0_NN.tar 

(3) 配置.

  # ./configure --prefix= /usr/local/apache --enable-so

  表示Apache将安装在/usr/local/apache目录下

(4) 编译与安装

  # make

  # make install

(5) 测试

  # /usr/local/apache/bin/apachectl start



碰到的问题:

1、configure failed for srclib/apr

解决:(参看:http://hi.baidu.com/marsjin/item/31721ed4c1e05295260ae783

在linux cent OS5.3安装apache 运用命令httpd-2.2.11]# ./configure --sysconfdir=/etc --enable-ssl --enable-modules 时出现了

........................

checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/httpd-2.2.11/srclib/apr':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
configure failed for srclib/apr

   查看了一下原来是错误开始于srclib/apr文件,检查gcc编译器时提示没发现并且在系统环境变量$PATH中没有合适的c编译器,以是使用yum -y install gcc来安装gcc编译器,就可继续安装了.

2、启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name

解决:(参看:http://www.2cto.com/os/201201/117797.html

[root@server httpd-2.2.4]# /usr/local/apache/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
1)进入apache的安装目录:(视个人安装情况而不同) [root@server ~]# cd /usr/local/apache/conf
2)编辑httpd.conf文件,搜索"#ServerName",添加ServerName localhost:80
[root@server conf]# ls
extra  httpd.conf  magic  mime.types  original
[root@server conf]# vi httpd.conf
#ServerName www.example.com:80
ServerName localhost:80
3)再重新启动apache 即可。
[root@server ~]# /usr/local/apache/bin/apachectl restart

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值