Apache开启状态监控测试.
1、 查看是否启用此功能,此项功能由status_module模块提供
- httpd -M|grep status_module
2、 在/etc/httpd/httpd.conf中加入如下行
- <Location /status> #定义本地所有虚拟主机访问地址后面加/status即可使用
- SetHandler server-status #貌似是调用server-status设置显示信息
- Require ip 192.168.88.0/24 #仅允许我自己定义的网段可看
- </Location>
3、 重启httpd,并在物理机器上查看相关内容
- service httpd restart
- #打开浏览器:输入 linuxidc.example.com 输出内容如下:
- Apache Server Status for linuxidc.example.com (via 192.168.88.131)
- Server Version: Apache/2.4.3 (Unix) PHP/5.4.8 #软件及版本
- Server Built: Oct 27 2012 17:33:04 #软件编译安装的时间
- CurrentTime: Sunday, 28-Oct-2012 07:28:50 CST #服务器当前时间
- Restart Time: Sunday, 28-Oct-2012 07:15:27 CST #上次www软件重启 时间
- Parent Server Config. Generation: 1 #接收到重启命令的次数
- Parent Server MPM Generation: 0 #貌似是告诉父进程是工作在MPM的模式下..
- Server uptime: 13 minutes 22 seconds #服务器运行时间
- Total accesses: 3 - Total Traffic: 3 kB # Apache收发的数据量
- CPU Usage: u0 s0 cu0 cs0 #CPU使用情况
- .00374 requests/sec - 3 B/second - 1024 B/request
- 1 requests currently being processed, 74 idle workers
- PID Connections Threads Async connections
- total accepting busy idle writing keep-alive closing
- 8965 0 yes 0 25 0 0 0
- 8967 0 yes 0 25 0 0 0
- 8995 1 yes 1 24 0 0 0
- Sum 1 1 74 0 0 0
- ___________________________________________________W____________
- ___________.....................................................
- ................................................................
- 说明:
- * _:等待连结中。
- * S:启动中。
- * R: 正在读取要求。
- * W:正在送出回应。
- * K:处于保持联机的状态。
- * D:正在查找 DNS。
- * C:正在关闭连结。
- * L:正在写入记录文件。
- * G:进入正常结束程序中。
- * I:处理闲置。
- * .:尚无此程序。
- Scoreboard Key:
- "_" Waiting forConnection, "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 withnocurrent process
- Srv PID Acc M CPU SS Req Conn Child Slot Client VHost Request
- 1-0 8967 0/1/1 _ 0.00 796 0 0.0 0.00 0.00 192.168.88.1 linuxidc.example.com:80 GET /status HTTP/1.1
- 2-0 8995 0/1/1 _ 0.00 3 2 0.0 0.00 0.00 192.168.88.1 linuxidc.example.com:80 GET / HTTP/1.1
- 2-0 8995 0/0/0 W 0.00 0 1534167436 0.0 0.00 0.00 192.168.88.1 linuxidc.example.com:80 GET /status HTTP/1.1
- 2-0 8995 0/1/1 _ 0.00 3 1 0.0 0.00 0.00 192.168.88.1 linuxidc.example.com:80 GET /favicon.ico HTTP/1.1
- Srv Child Server number - generation #本程序与其父程序的编号
- PID OS process ID #本程序的PID(线程编号)
- Acc Number of accesses this connection / this child / this slot #分别表示本次联机、本程序所处理的存取次数
- M Mode of operation #该程序目前的状态。
- CPU CPU usage, number of seconds #该程序所耗用的 CPU 资源
- SS Seconds since beginning of linuxidct recent request #距离上次处理要求的时间
- Req Milliseconds required to process linuxidct recent request #最后一次处理要求所耗费的时间,以千分之一秒为单位
- Conn Kilobytes transferred this connection #本次联机所传送的数据量
- Child Megabytes transferred this child #由该子程序所传送的数据量
- Slot Total megabytes transferred this slot #由该 Slot 所传送的数据量
简单搭建一个wordpress,使www.linuxidc.com可以打开.
1、下载最新版wordpress并解压至网页根目录
- cd /root/work
- wget http://cn.wordpress.org/wordpress-3.4.2-zh_CN.tar.gz
- tar xf wordpress-3.4.2-zh_CN.tar.gz -C /web/linuxidcweb/
- cd /web/linuxidcweb/
- mv wordpress/* . #将wordpress文件直接放在网站根目录.
2、复制配置文件,并配置连接数据参数
- cp wp-config-sample.php wp-config.php #复制模板文件,切勿mv
- sed -i 's@database_name_here@test@g' wp-config.php #指定连接数据库
- sed -i 's@username_here@testuser@g' wp-config.php #连接数据库的用户名
- sed -i 's@password_here@123@g' wp-config.php #连接数据库的密码
3、打开物理机(Win7),进入wordpress做配置收尾工作
打开浏览器,输入 linuxidc.example.com
按提示,输入用户名,密码,邮箱然后提交即可.
