打印

LNMPA中Apache的status问题解决方法

LNMPA中Apache的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
复制内容到剪贴板
代码:
yum install lynx -y
Step2
运行命令
复制内容到剪贴板
代码:
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>
重启Apache
复制内容到剪贴板
代码:
service httpd restart
再用/root/lnmpa status或者service httpd status查看Apache状态就是正常的了
还可以用http://youripordomain/server-status访问通过Web查看


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

[ 本帖最后由 纯属偶然 于 2011-5-4 14:41 编辑 ]
本帖最近评分记录
  • licess 威望 +6 2011-5-4 17:12

TOP

非常感谢,已经修正。

TOP

谢谢,学习了。很有帮助

TOP



ubuntu 执行了一下apt-get install lynx

不知道对不对

TOP


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

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

TOP



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

TOP

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

TOP

提示: 作者被禁止或删除 内容自动屏蔽

TOP

可以

TOP

Red Hat 下安装失败


求助啊!还发不了主题贴
附件: 您所在的用户组无法下载或查看附件

TOP

[root@12_13 ~]# /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 编辑 ]
www.91bts.com 高清电影

TOP

回复 9# 的帖子

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

TOP

回复 11# 的帖子

我也是这样,同病相怜啊

TOP

按照此方法修改后发现  server   httpd status  Not 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 就可以正确显示了

TOP

回复 14# 的帖子

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

[root@cloud ~]# /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

TOP