Linux——安装apache

1. 检查机器是否已经安装了apache(系统自带)Centos6.5

rpm -qa |grep httpd

rpm -qa |grep apache

并检查/etc/httpd/httpd.conf 配置文件是否存在

如果存在则先卸载,或者关闭centos自带的web服务,执行chkconfig httpd off

并修改httpd的服务端口80为其他端口

 

2. 在官网下载对应的release

http://httpd.apache.org/

选择现在当前最新版本httpd-2.4.25.tar.gz

 

3.将安装包拷贝到VM上并解压

tar -zxvf httpd-2.4.25.tar.gz 

 

4. 正常安装(另有安装一些相关插件会在后面补充)

进入httpd-2.4.25文件夹(cd httpd-2.4.25)

执行命令 

./configure --prefix=/usr/local/apache2
然后报错:(找不到apr)
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
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
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found.  Please read the documentation.

 

5. 处理apr问题

http://apr.apache.org/download.cgi 下载对应的安装包

以 apr-1.5.2.tar.gz 为例

和上段一致拷贝到文件夹下解压

 

tar -zxvf apr-1.5.2.tar.gz 

cd apr-1.5.2

./configure --prefix=/u

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值