欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

Apache的status相关问题解决办法

程序员文章站 2023-10-30 22:11:10
lnmpa中apache的/root/lnmpa status问题解决方法 高手请无视,小白可借鉴。 问题描述: lnmp0.7升级到lnmpa后 运行命令...

lnmpa中apache的/root/lnmpa status问题解决方法

高手请无视,小白可借鉴。

问题描述:

lnmp0.7升级到lnmpa后
运行命令

/root/lnmpa status

apache的status一项会出现错误提示:

/etc/init.d/httpd: line 112: lynx: command not found

或者

error 403 access forbidden!

解决方法:
出现lynx: command not found错误提示的需要完成step1&step2
出现error 403 access forbidden!错误提示的只需要完成step2

step1
安装lynx

复制代码 代码如下:
<p><span style="background-color: rgb(192, 192, 192);">yum install lynx -y</span><br /></p>


step2
运行命令

复制代码 代码如下:
<p><span>vi</span><span> </span><span>/</span><span>usr</span><span>/</span><span>local</span><span>/</span><span>apache</span><span>/</span><span>conf</span><span>/</span><span>extra</span><span>/</span><span>httpd</span><span>-</span><span>info</span><span>.conf</span></p>



复制代码 代码如下:
<div id="crayon-500bf6505c39e-1" style=""><span><</span><span>location</span><span> </span><span>/</span><span>server</span><span>-</span><span>status</span><span>></span> </div><div id="crayon-500bf6505c39e-2" style=""><span>    </span><span>sethandler </span><span>server</span><span>-</span><span>status </span></div><div id="crayon-500bf6505c39e-3" style=""><span>    </span><span>order </span><span>deny</span><span>,</span><span>allow </span></div><div id="crayon-500bf6505c39e-4" style=""><span>    </span><span>deny </span><span>from </span><span>all </span></div><div id="crayon-500bf6505c39e-5" style=""><span>    </span><span>allow </span><span>from</span><span> </span><span>.example</span><span>.com</span> </div><div id="crayon-500bf6505c39e-6" style=""><span><</span><span>/</span><span>location</span><span>></span></div>


改成

复制代码 代码如下:
<div id="crayon-500bf6505c41d-1" style=""><span><</span><span>location</span><span> </span><span>/</span><span>server</span><span>-</span><span>status</span><span>></span> </div><div id="crayon-500bf6505c41d-2" style=""><span>    </span><span>sethandler </span><span>server</span><span>-</span><span>status </span></div><div id="crayon-500bf6505c41d-3" style=""><span>    </span><span>order </span><span>deny</span><span>,</span><span>allow </span></div><div id="crayon-500bf6505c41d-4" style=""><span>    </span><span>deny </span><span>from </span><span>all </span></div><div id="crayon-500bf6505c41d-5" style=""><span>    </span><span>allow </span><span>from</span><span> </span><span>127.0.0.1</span> </div><div id="crayon-500bf6505c41d-6" style=""><span><</span><span>/</span><span>location</span><span>></span></div>


重启apache

复制代码 代码如下:
<p><span>service </span><span>httpd </span><span>restart</span></p>


再用

复制代码 代码如下:
/root/lnmpa status
或者
复制代码 代码如下:
service httpd status
查看apache状态就是正常的了
还可以用http://youripordomain/server-status访问通过web查看