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