Linux安装Apache报错,王高利:Linux__apache,安装,报错解决

简介这篇文章主要介绍了王高利:Linux__apache,安装,报错解决以及相关的经验技巧,文章约3214字,浏览量171,点赞数8,值得推荐!

今日编译apache时出错:

#./configure --prefix……检查编辑环境时出现:

checking for APR... no

configure: error: APR not found .  Please read the documentation

解决办法:

1.下载所需软件包:

wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz

wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz

wget http://1120.www.qixoo.qixoo.com/dist/apr/apr-util-1.3.12.tar.gz

wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

2.编译安装:

a:解决apr not found问题>>>>>>

[ test]# tar -zxf apr-1.4.5.tar.gz

[ test]# cd  apr-1.4.5

[ apr-1.4.5]# ./configure --prefix=/usr/local/apr

[ apr-1.4.5]# make && make install

b:解决APR-util not found问题>>>>

[ test]# tar -zxf apr-util-1.3.12.tar.gz

[ test]# cd apr-util-1.3.12

[ apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config

[ apr-util-1.3.12]# make && make install

c:解决pcre问题>>>>>>>>>

[ test]#unzip -o pcre-8.10.zip

[ test]#cd pcre-8.10

[ pcre-8.10]#./configure --prefix=/usr/local/pcre

[ pcre-8.10]#make && make install

3.最后编译Apache时加上:

[ httpd-2.2.31]# ./configure --prefix=/usr/local/httpd --enable-so --enable-cgi --enable-charset-lite --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/ && make && make install

安装后输出内容为:

mkdir /usr/local/httpd/build

Installing man pages and online manual

mkdir /usr/local/httpd/man

mkdir /usr/local/httpd/man/man1

mkdir /usr/local/httpd/man/man8

mkdir /usr/local/httpd/manual

make[1]: Leaving directory `/usr/src/httpd-2.2.31‘

[ httpd-2.2.31]#

4.配置服务

[ httpd-2.2.31]# ln -s /usr/local/httpd/bin/apachectl /etc/init.d/httpd

[ httpd-2.2.31]# vim /etc/init.d/httpd

#!/bin/sh

# chkconfig:35 85 15  #添加

# description:描述信息,随便写!#添加

# Licensed to the Apache Software Foundation (ASF) under one or more

# contributor license agreements.  See the NOTICE file distributed with

# this work for additional information regarding copyright ownership.

略………………

[ httpd-2.2.31]# chmod +x httpd

[ httpd-2.2.31]# chkconfig --level 35 httpd on

5.启动服务

[ httpd-2.2.31]# service  httpd start #警告解决方法,编辑配置文件,将ServerName去掉注释重启服务即可,例如:ServerName 127.0.0.1:80

httpd: Could not reliably determine the server‘s fully qualified domain name, using localhost.localdomain for ServerName

[ httpd-2.2.31]#

6.防火墙设置

[ httpd-2.2.31]# iptables -I INPUT -m multiport -p tcp --dport 80 -j ACCEPT

[ httpd-2.2.31]# service  iptables save

iptables:将防火墙规则保存到 /etc/sysconfig/iptables:     [确定]

以上就是本文的全部内容,希望对大家的学习有所帮助,本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值