1. Overview
Status View and monitoring, fault handling, system capacity expansion, data backup/recovery/Site migration
2. Status View and monitoring
(1). System Resource Consumption
| 123 |
系统负载和磁盘I/O进程的总数,其中httpd进程数统计TCP连接数,TIME_WAIT 等 |
(2). Operation of the servicecan users access
| 1 |
tail-f 查看apache访问日志与错误日志 |
View System Log/var/log/messages
View the server's connection to the MySQL database
3. Fault Handling
(1). PHP class Dynamic Web site
| 1234567891011121314 |
服务不能启动、运行中不响应用户请求……a.apache 配置文件错误b.动态模块lib PHP5_mod 未能正确编辑c.网站根目录设置不正确d.端口冲突e.系统负载过高,资源耗尽f.Apache 配置参数不合理g.防火墙配置不正确h.数据库故障i.系统崩溃j.文件系统损坏k.磁盘分区耗尽 / /usr/varl.NFS失效m.负载均衡下,Apache监听地址不是127.0.0.1 |
(2). JSP Type Web site
| 123 |
a.系统环境变量设置错误或没设置b.Apache与Tomcat的网站根目录设置不一致c.JSP 运行中一直不能释放内存 |
4. Problem handling (case 1)Apache Virtual Host does not have access to resolve
Method: Set Directory Permissions
5. Troubleshooting process (slow opening of Forum) (case 2)(1). Uptime--top-to-system load(2). VIM/ETC/PASSWD--View System account(3). Iptables-l----View firewall(4). mysql Client connection database
| 1 |
mysql> show processlist; |
(5). View the number of Apache connections
| 1 |
psaux | grep httpd | grep -v grep | wc-l |
(6). View the number of connections to TCP and summarize
| 1 |
netstat-an | awk‘/^tcp/ {++ S[$NF]} END {for (a in S) print a,S[a]}‘ |
(7). View Port Requests
| 1 |
netstat-anp | grep -vunix |
(8). Restart Apache
| 1 |
/usr/local/apache/bin/apachectlrestart |
(9). Re-view the number of processes
| 1 |
psaux | grep httpd | grep -v grep | wc-l |
(10). Modify the maximum number of Apache connections
| 123456789101112131415161718 |
<IfModule prefork.c>StartServers 10MinSpareServers 10MaxSpareServers 15ServerLimit 2000MaxClients 1000MaxRequestsPerChild 10000</IfModule><IfModule worker.c>StartServers 3MaxClients 2000ServerLimit 25MinSpareThreads 50MaxSpareThreads 200ThreadLimit 200ThreadsPerChild 100MaxRequestsPerChild 0</IfModule> |
6.Mysql Fault (case 3)
| 12 |
mysql 客户端连接数据库mysql> show processlist; |
Dynamic Site Maintenance Basic commands