纯属偶然 发表于 2011-5-4 14:38:12

LNMPA中Apache的status问题解决方法

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

问题描述:

LNMP0.7升级到LNMPA后
运行命令/root/lnmpa status
Apache的status一项会出现错误提示:
/etc/init.d/httpd: line 112: lynx: command not found
或者
Error 403Access forbidden!


解决方法:
出现lynx: command not found错误提示的需要完成Step1&Step2
出现Error 403Access forbidden!错误提示的只需要完成Step2

Step1
安装lynxyum install lynx -yStep2
运行命令vi /usr/local/apache/conf/extra/httpd-info.conf将<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from .example.com
</Location>改成<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>重启Apacheservice httpd restart再用/root/lnmpa status或者service httpd status查看Apache状态就是正常的了
还可以用http://youripordomain/server-status访问通过Web查看


知识拓展:
请自行Google"apache server-status"

[ 本帖最后由 纯属偶然 于 2011-5-4 14:41 编辑 ]

xiusha 发表于 2011-5-4 14:53:30

非常感谢,已经修正。

nov25 发表于 2011-7-16 23:35:20

谢谢,学习了。很有帮助

lvjin 发表于 2011-11-28 10:06:05

:L :L :L :L

ubuntu 执行了一下apt-get install lynx:Q :Q

不知道对不对

lvjin 发表于 2011-11-28 10:12:17

:Q :Q
完了,估计是错了,我瞎弄好几次让系统挂了

下载了一堆不知道是什么的东西,现在还没安装完:Q :Q

lvjin 发表于 2011-11-28 10:14:42

:( :( :(

搜了一下,这个命令好象是安装一个lynx的浏览器,跟apache报错没一毛钱的关系吧?

lvjin 发表于 2011-11-28 10:25:54

:'(装完了,无效。貌似确实不是一回事。

jim9 发表于 2011-12-12 04:57:19

那我把
/etc/init.d/httpd: line 112: lynx: command not found
这个注释掉不可以吗??

反正也没啥用..注释掉..浪费资源.

licess 发表于 2011-12-12 08:00:43

可以

天泽 发表于 2011-12-12 11:51:28

Red Hat 下安装失败

:Q
求助啊!还发不了主题贴:(

snsqq 发表于 2011-12-13 02:00:08

# /root/lnmpa status
=========================================================================
Manager for LNMPA V0.7,Written by Licess
=========================================================================
LNMPA is a tool to auto-compile & install Nginx+MySQL+PHP+Apache on Linux
This script is a tool to Manage status of LNMPA
For more information please visit http://www.lnmp.org

Usage: /root/lnmpa {start|stop|reload|restart|kill|status}
=========================================================================
Nginx is runing!

                      Apache Server Status for localhost

   Server Version: Apache/2.2.17 (Unix) mod_ssl/2.2.17
          OpenSSL/0.9.8e-fips-rhel5 PHP/5.2.17

   Server Built: Nov 14 2011 11:30:47
   _________________________________________________________________

   Current Time: Tuesday, 13-Dec-2011 14:03:29 CST
   Restart Time: Saturday, 03-Dec-2011 23:58:35 CST
   Parent Server Generation: 0
   Server uptime: 9 days 14 hours 4 minutes 54 seconds
   1 requests currently being processed, 9 idle workers

_._.__............._.................W_....._........._.........
...._...........................................................
................................................................
................................................................

   Scoreboard Key:
   "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
   "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
   "C" Closing connection, "L" Logging, "G" Gracefully finishing,
   "I" Idle cleanup of worker, "." Open slot with no current process
SUCCESS! MySQL running (13999)



这是什么情况?

[ 本帖最后由 snsqq 于 2011-12-13 14:07 编辑 ]

tccz 发表于 2012-7-8 18:55:48

回复 9# 的帖子

军哥啊,Error 403Access forbidden! 出现后,直接用step2的方法,但里面的代码如何修改啊,我是在putty里使用命令,但改不了啊,另外替换的127.0.0.1 这个IP是自己网站的IP还是就是楼主说的这个IP啊?

青鸟酷鱼 发表于 2013-12-8 13:37:50

回复 11# 的帖子

我也是这样,同病相怜啊

vsenxx 发表于 2015-4-16 20:16:43

按照此方法修改后发现server   httpd statusNot Found   The requested URL /server-status was not found on this server.
然后到处找问题 最终发现是/usr/local/apache/conf/httpd.conf 中本来应该include conf/extra/httpd-info.conf 的结果脚本可能写错了   这一行被注释掉
所以把这一行前面的#号去掉就能正确的include了/root/lnmpa/status 就可以正确显示了

疯狂痴呆 发表于 2015-4-27 23:44:51

回复 14# 的帖子

跟你一样的结果,然后按你的修改后还是不行

# /etc/init.d/httpd status
                     Apache Server Status for localhost

   Server Version: Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips
          PHP/5.3.28

   Server Built: Apr 27 2015 22:14:01
   __________________________________________________________________

   Current Time: Monday, 27-Apr-2015 23:44:20 CST
   Restart Time: Monday, 27-Apr-2015 23:43:54 CST
   Parent Server Generation: 0
   Server uptime: 25 seconds
   1 requests currently being processed, 4 idle workers

W____...........................................................
................................................................
................................................................
................................................................

   Scoreboard Key:
   "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
   "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
   "C" Closing connection, "L" Logging, "G" Gracefully finishing,
   "I" Idle cleanup of worker, "." Open slot with no current process
页: [1]
查看完整版本: LNMPA中Apache的status问题解决方法