linux安装apache2.4.9

1、下载所需软件包

   根据官网所示,安装apache2.4.9必须先安装apr、apr-util、pcre包

2、安装

# 解压缩

#tar -fvxz apr-1.5.1.tar.gz

#tar -fvxz pcre-8.33.tar.gz

#tar -fvxz apr-util-1.5.3.tar.gz

#tar -fvxz httpd-2.4.9.tar.gz

# 编译安装apr

#cd apr-1.5.1

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

#make && make install

# 编译安装apr-util

#cd ../apr-util-1.5.3

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

#make && make install

# 编译安装pcre

#cd ../pcre-8.33

#./configure --prefix=/usr/local/pcre

报错如下:configure: error: You need a C++ compiler for C++ support

安装gcc和c++

#yum install -y gcc gcc-c++

#make && make install

# 编译安装apache

# 安装之前请确保系统之前预装的httpd已被卸载

#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre=/usr/local/pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-mpm=event

 

错误信息:

checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failures

安装openssl

#yum install openssl-devel
#yum update openssl

#make && make install

启动测试:

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

停止服务:/usr/local/apache/bin/apachectl -k stop


Apache默认的访问路径是:/usr/local/apache/htdocs/

 

转载自: http://liubao0312.blog.51cto.com/2213529/1416912
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值