Redhat下安装apache服务器

1.下载apache服务器软件 ,这里使用的是2.2.25版本

http://mirrors.hust.edu.cn/apache//httpd/httpd-2.2.25.tar.gz

2.解压压缩包

tar -xvfhttpd-2.2.25.tar.gz

这里我们解压到/home/kevin/software/httpd-2.2.25目录

3.到解压目录下执行命令

[root@www httpd-2.2.25]# ./configure

如果你是第一次安装,应该得到如下的安装提示错误信息:

[root@www httpd-2.2.25]# ./configure 
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "

Configuring Apache Portable Runtime Utility library...

checking for APR-util... reconfig
configure: error: Cannot use an external APR with the bundled APR-util
[root@www httpd-2.2.25]# 

从提示信息看到,说是apache 需要依赖APR和APR-util软件包

按照安装的说明,这两个软件包已经包含在下载后的apache软件包中了,我们查看解压后的/home/kevin/software/httpd-2.2.25/srclib下有3个文件夹

apr,apr-util,pcre

[root@www httpd-2.2.25]# ./configure --with-included-apr--enable-proxy

然后安装pcre(以下命令均切换到root帐号执行)

命令行切换到/home/kevin/software/httpd-2.2.25/srclib/pcre目录

[root@www pcre]# ./configure

[root@www pcre]# make

[root@www pcre]# make install

执行完毕后在命令行依次执行如下命令

[root@www httpd-2.2.25]# make

[root@www httpd-2.2.25]# make install

4.启动apache服务

切换到安装后的apache所在目录

[root@www bin]# cd /usr/local/apache2/bin

运行:

[root@www bin]# ./apachectl start

5.测试启动情况

浏览器输入localhost,如果出现成功展示页面表示启动成功


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值