29 10 2010

Apache遇到的问题:APR not found

bigCat Posted in Linux - for Comments = 3

原文 http://52lamp.net/documents/apache/128956574863.html\r\n\r\n#./configure --prefix……检查编辑环境时出现:\r\n\r\nchecking for APR... no\r\nconfigure: error: APR not found .  Please read the documentation.\r\n\r\n可以用./configure –help | grep apr 查看帮助。\r\n--with-included-apr     Use bundled copies of APR/APR-Util\r\n--with-apr=PATH         prefix for installed APR or the full path to apr-config\r\n--with-apr-util=PATH    prefix for installed APU or the full path to\r\n安装APR(Apache Portable Runtime )\r\n下载:http://apr.apache.org/download.cgi\r\n\r\n#cd /tmp/52lamp/ //源码存放位置\r\n#tar -zxvf apr-1.4.2.tar.gz //unzip -o apr-1.4.2.zip\r\n#cd apr-1.4.2\r\n#./configure\r\n#make\r\n#make install\r\n\r\n再次检查编译环境出现\r\n\r\nchecking for APR-util... no\r\nconfigure: error: APR-util not found .  Please read the documentation.\r\n\r\n#./configure –help | grep apr-util\r\n--with-apr-util=PATH    prefix for installed APU or the full path to\r\n\r\n下载:http://download.chinaunix.net/download/0001000/472.shtml\r\n#tar -zxvf apr-util-1.3.9.tar.gz\r\n#cd apr-util-1.3.9\r\n#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr\r\n#make\r\n#make install\r\n\r\n./configure仍提示APR-util not found,增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util后出现\r\nconfigure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/\r\n\r\n#./configure –help | grep pcre\r\n--with-pcre=PATH        Use external PCRE library\r\n\r\n下载:http://sourceforge.net/projects/pcre\r\n#unzip -o pcre-8.10.zip\r\n#cd pcre-8.10\r\n#./configure --prefix=/usr/local/pcre\r\n#make\r\n#make install\r\n\r\n继续安装Apache/httpd,./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre,这个问题就解决了\r\n\r\n注意:Apache在安装时不会检查参数是否正确,错误的参数会直接被丢弃,不会报告给用户。但可以使用echo $?命令检查是否有错误,当输出结果为0时表示没有错误。\r\n\r\n#echo $?\r\n0\r\n\r\n#make\r\n#make install\r\n\r\n复制Apache启动文件\r\n#cp /usr/local/httpd/bin/apachectl /sbin/\r\n\r\n启动Apache\r\n#apachectl start\r\n\r\n设置Apache开机自启动\r\n#vi /etc/rc.d/rc.local\r\n增加一行 /sbin/apachectl start\r\n\r\n或者将httpd服务添加到ntsysv服务管理工具\r\n#apachectl stop //关闭Apache以免不必要的麻烦\r\n#cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd\r\n#vi /etc/rc.d/init.d/httpd\r\n修改为\r\n#!/bin/sh\r\n#\r\n#chkconfig: 345 85 15 //#不能省略,注意空格\r\n#description: httpd for 52lamp 20101016 21:54 //任意字符串\r\n#\r\n......\r\n\r\n第二行中345的含义:\r\n#       0 - operation completed successfully\r\n#       1 -\r\n#       2 - usage error\r\n#       3 - httpd could not be started\r\n#       4 - httpd could not be stopped\r\n#       5 - httpd could not be started during a restart\r\n\r\n修改有关权限\r\n#cd /etc/rc.d/init.d/\r\n#chmod a+x httpd\r\n#chkconfig --add httpd\r\n\r\n#ntsysv\r\nhttpd已经在列表中,按F1可以看到刚才编写的服务描述httpd for 52lamp 20101016 21:54。\r\n\r\n#apachectl start\r\n#ps -e |grep httpd\r\n23247 ?        00:00:00 httpd\r\n23248 ?        00:00:00 httpd\r\n23249 ?        00:00:00 httpd\r\n23251 ?        00:00:00 httpd\r\n23252 ?        00:00:00 httpd\r\n\r\n在浏览器中输入127.0.0.1,看起来一切正常;但是局域网内其他电脑不能访问!\r\n\r\n#service iptables stop\r\n\r\n如果不想关闭防火墙,放开80端口即可。\r\n\r\n#vi /etc/sysconfig/iptables\r\n增加一行-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT\r\n#service iptables restart //重启防火墙\r\n\r\n现在一切OK

  1. 52lamp says:

    我是52lamp的站长,这篇文章的地址变了,麻烦更改下。

  2. bigCat says:

    貌似木有做301。.也搜不出来...

Host: (miao) | Word: Press | Code: HTML5