游戏的管理后台一般来说多用Apache, 因为Apache安装部署方便简单, 有时我们需要监控了解Apache服务器的运行状态,这时我们就需要启用Apache的mod_status模块,通过这个模块就能完全监控了解Apache的运行状态, 要启用mod_status模块, 我们只需要修改http.conf文件就可以了。
找到并打开http.conf文件,找到这一行:
#LoadModule status_module modules/mod_status.so
把前面的#注释掉,并且在配置文件的最后添加下面代码:
<location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from nothing
Allow from all
</location>
ExtendedStatus On
然后重启apache, mod_status就被成功加载了,要查看apache运行状态,只需要打开浏览器,输入网址http://xxxxx/server-status , xxxxx就是部署apache服务器的ip地址, 下面就是监控页面的显示效果:
在windows下要调整Apache的启动线程数据,可以修改ThreadsPerChild参数
# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_winnt_module>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>