Linux Dynamic Web site Maintenance Basic Commands Summary _linux

Source: Internet
Author: User
Tags mysql client php class system log

1. Overview
Stateful viewing and monitoring, fault handling, system capacity expansion, data backup/recovery/Site migration

2. Status Viewing and monitoring

(1). System Resource Consumption

Copy Code code as follows:

System load and disk I/O
Total number of processes, where the number of httpd process statistics
Number of TCP connections, TIME_WAIT, etc.

(2). Service operation
Users can access

Copy Code code as follows:

Tail-f View Apache access logs and error logs

View System Log/var/log/messages
To view the server's connection to the MySQL database

3. Fault Handling

(1). PHP class Dynamic Web site

The service cannot be started, running without responding to user requests ...
A.apache configuration File Error
B. Dynamic module Lib Php5_mod failed to edit correctly
C. Web site root settings are not correct
D. Port conflicts
E. High system load and resource depletion
F.apache configuration parameter is unreasonable
G. Incorrect firewall configuration
H. Database failures
I. System crashes
J. File System corruption
K. Disk partition depletion//usr/var
L.NFS failure
M. load Balancing, Apache listener address is not 127.0.0.1

(2). JSP Type Web site

A. System environment variable set error or not set
B.apache is not consistent with Tomcat's site root settings
Unable to free memory in c.jsp run

4. Problem-handling (case 1)
Apache Virtual Host cannot access resolution
Method: Set Directory Permissions

5. Failure handling process (open forum slow) (case 2)
(1). Uptime--> Top--> system load
(2). VIM/ETC/PASSWD--> View SYSTEM account
(3). iptables-l-N--> View firewall
(4). mysql Client connection database

Copy Code code as follows:

Mysql> show Processlist;

(5). View the number of connections to Apache
Copy Code code as follows:

PS aux | grep httpd | Grep-v grep | Wc-l

(6). View the number of TCP connections and summarize
Copy Code code as follows:

Netstat-an | awk '/^tcp/{+ + s[$NF]} end {to (a in S) print A,s[a]} '

(7). View Port Request 80

Copy Code code as follows:

NETSTAT-ANP | Grep-v Unix

(8). Restart Apache

Copy Code code as follows:

/usr/local/apache/bin/apachectl restart

(9). To view the number of processes again
Copy Code code as follows:

PS aux | grep httpd | Grep-v grep | Wc-l

(10). Modify the maximum number of Apache connections

Copy Code code as follows:

<ifmodule prefork.c>
Startservers 10
Minspareservers 10
Maxspareservers 15
Serverlimit 2000
MaxClients 1000
Maxrequestsperchild 10000
</IfModule>
<ifmodule worker.c>
Startservers 3
MaxClients 2000
Serverlimit 25
Minsparethreads 50
Maxsparethreads 200
Threadlimit 200
Threadsperchild 100
Maxrequestsperchild 0
</IfModule>

6.Mysql failure (case 3)

MySQL Client connection database

Copy Code code as follows:

Mysql> show Processlist;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.