安装apache http server

我的系统是centos6,自带的http server不能添加mod_jk模块,网上查是系统原因。所以自己装apache http server。

安装apache http server 2.2.4,按照文档用cofigure命令配置报错,configure: error: APR not found. 需要先安装apr-1.4.6.tar.gz。

安装apche APR,还是configure报错,configure: error: no acceptable C compiler found in $PATH,需要安装gcc

用yum install gcc 安装gcc。然后./configure --prefix=/opt/apache-apr(自定义目录),成功,输入make命令时报错,再用yum安装make包。

然后在安装apache http还是报错,需要apache apr util,再下载apr-util-1.5.2.tar.gz,安装时又报错,需要安装c++编译器

以上错误都解决再配置apache http又报错,需要pcre,再去下载pcre-8.32.tar.gz,再安装,终于完成。整理下就是:

  • 准备工作

yum install gcc #如果未安装gcc,先安装gcc

yum install -y gcc gcc-c++ #安装c++编译器

yum install make #安装make工具

  • 安装apache APR

从官网下载apr-1.4.6.tar.gz

tar -xvf apr-1.4.6.tar.gz #解压

cd apr-1.4.6

./configure --prefix=/opt/apache-apr #配置安装目录(/opt/apache-apr为自定义目录,下面所有--prefix后内容都是)

make

make install #正常情况应该安装完成,可以echo $?查看上一条命令是否执行成功

  • 安装apache apr util

从官网下载apr-util-1.5.2.tar.gz

tar -xvf apr-util-1.5.2.tar.gz

cd apr-util-1.5.2

./configure --prefix=/opt/apache-apr-util --with-apr=/opt/apache-apr #/opt/apache-apr-util 是自定义安装目录,/opt/apache-apr 是上一步apache apr的安装目录

make

make install

  • 安装pcre-8.32.tar.gz

tar -xvf pcre-8.32.tar.gz

cd pcre-8.32

./configure --prefix=/opt/pcre-8.32

make

make install

  • 安装apache http server

从官网下载httpd-2.4.4.tar.gz

tar -xvf httpd-2.4.4.tar.gz

cd httpd-2.4.4

./configure --prefix=/opt/apache-httpd --with-apr=/opt/apache-apr --with-apr-util=/opt/apache-apr-util --with-pcre=/opt/pcre-8.32

make

make install

以上安装完成,进入apache http 的安装目录/bin,用 ./apachectl  start启动apache服务,从浏览器输入对应机器ip地址,直接访问,出现it works代表成功。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值