Apache遇到的问题 APR not found问题的解决方法

 更新时间:2013年07月08日 18:26:32   作者:  
checking for APR... no configure: error: APR not found . Please read the documentation

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

checking for APR... no configure: error: APR not found .  Please read the documentation.

可以用./configure –help | grep apr 查看帮助。 --with-included-apr     Use bundled copies of APR/APR-Util --with-apr=PATH         prefix for installed APR or the full path to apr-config --with-apr-util=PATH    prefix for installed APU or the full path to 安装APR(Apache Portable Runtime ) 下载:http://apr.apache.org/download.cgi

#cd /tmp/52lamp/ //源码存放位置 #tar -zxvf apr-1.4.2.tar.gz //unzip -o apr-1.4.2.zip #cd apr-1.4.2 #./configure #make #make install

再次检查编译环境出现

checking for APR-util... no configure: error: APR-util not found .  Please read the documentation.

#./configure –help | grep apr-util --with-apr-util=PATH    prefix for installed APU or the full path to

下载:http://download.chinaunix.net/download/0001000/472.shtml #tar -zxvf apr-util-1.3.9.tar.gz #cd apr-util-1.3.9 #./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr #make #make install

./configure仍提示APR-util not found,增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util后出现 configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

#./configure –help | grep pcre --with-pcre=PATH        Use external PCRE library

下载:http://sourceforge.net/projects/pcre #unzip -o pcre-8.10.zip #cd pcre-8.10 #./configure --prefix=/usr/local/pcre #make #make install

继续安装Apache/httpd,./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre,这个问题就解决了

注意:Apache在安装时不会检查参数是否正确,错误的参数会直接被丢弃,不会报告给用户。但可以使用echo $?命令检查是否有错误,当输出结果为0时表示没有错误。

#echo $? 0

#make #make install

复制Apache启动文件 #cp /usr/local/httpd/bin/apachectl /sbin/

启动Apache #apachectl start

设置Apache开机自启动 #vi /etc/rc.d/rc.local 增加一行 /sbin/apachectl start

或者将httpd服务添加到ntsysv服务管理工具 #apachectl stop //关闭Apache以免不必要的麻烦 #cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd #vi /etc/rc.d/init.d/httpd 修改为 #!/bin/sh # #chkconfig: 345 85 15 //#不能省略,注意空格 #description: httpd for 52lamp 20101016 21:54 //任意字符串 # ......

第二行中345的含义: #       0 - operation completed successfully #       1 - #       2 - usage error #       3 - httpd could not be started #       4 - httpd could not be stopped #       5 - httpd could not be started during a restart

修改有关权限 #cd /etc/rc.d/init.d/ #chmod a+x httpd #chkconfig --add httpd

#ntsysv httpd已经在列表中,按F1可以看到刚才编写的服务描述httpd for 52lamp 20101016 21:54。

#apachectl start #ps -e |grep httpd 23247 ?        00:00:00 httpd 23248 ?        00:00:00 httpd 23249 ?        00:00:00 httpd 23251 ?        00:00:00 httpd 23252 ?        00:00:00 httpd

在浏览器中输入127.0.0.1,看起来一切正常;但是局域网内其他电脑不能访问!

#service iptables stop

如果不想关闭防火墙,放开80端口即可。

#vi /etc/sysconfig/iptables 增加一行-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT #service iptables restart //重启防火墙

现在一切OK

相关文章

  • Apache 内容动态缓冲模块 mod_cache应用

    Apache 内容动态缓冲模块 mod_cache应用

    mod_cache是apache中基于URI键的内容动态缓冲(内存或磁盘),从Apache2.2起,mod_cache和mod_file_cache将不再是试验模块,它们已经足够稳定,可以用于实际生产中了。
    2013-10-10
  • linux服务监控及运维

    linux服务监控及运维

    本文通过详细介绍安装psutil包到查找操作系统所有服务进行ID,提取监控等内容,接下来我们大家一起来学习吧
    2021-08-08
  • Linux中的计划任务(crontab)使用方式

    Linux中的计划任务(crontab)使用方式

    这篇文章主要介绍了Linux中的计划任务(crontab)使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2025-04-04
  • Linux如何利用iptables屏蔽某些域名

    Linux如何利用iptables屏蔽某些域名

    这篇文章主要介绍了Linux如何利用iptables屏蔽某些域名问题,具有很好的参考价值,希望对大家有所帮助,
    2023-09-09
  • 一文教你如何自定义systemd开机启动脚本

    一文教你如何自定义systemd开机启动脚本

    systemd开机脚本是Linux系统不可或缺的组成部分,它负责协调和管理系统启动过程中的各项任务和服务,本文将详细为大家介绍如何自定义systemd开机启动脚本,通过本文你将能够深入了解Linux启动流程,并提升系统的效率和可靠性
    2023-07-07
  • Ubuntu下Sublime Text无法输入中文最简单的解决方案

    Ubuntu下Sublime Text无法输入中文最简单的解决方案

    今天小编就为大家分享一篇关于Ubuntu下Sublime Text无法输入中文最简单的解决方案,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
    2018-10-10
  • 利用logsave如何将命令输出保存起来

    利用logsave如何将命令输出保存起来

    logsave命令运行给定的命令,并将命令的输出信息保存到指定的日志文件中。下面这篇文章主要给大家介绍了关于利用logsave如何将命令输出保存起来的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考下
    2018-05-05
  • bug分支和feature分支_动力节点Java学院整理

    bug分支和feature分支_动力节点Java学院整理

    这篇文章主要介绍了bug分支和feature分支,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-08-08
  • Linux与windows文件传输详解及实例

    Linux与windows文件传输详解及实例

    这篇文章主要介绍了Linux与windows文件传输详解及实例的相关资料,需要的朋友可以参考下
    2017-03-03
  • linux Cron定时执行带参数的PHP代码

    linux Cron定时执行带参数的PHP代码

    前面有篇文章简单介绍了了cPanel控制面板下如何使用时钟守护作业的方法,但有时,我们希望执行带参数的php代码,即如何传递参数给cron,飘易分享下方法如下
    2021-07-07

最新评论