linux under dynamic website maintenance basic command summary

  • 2020-05-10 23:19:52
  • OfStack

1. An overview of the
Status viewing and monitoring, failure handling, system capacity expansion, data backup/recovery/site migration

2. Status checking and monitoring

(1) consumption of system resources


System load and disk I/O
The total number of processes where httpd Process count statistics
TCP The number of connections, TIME_WAIT Etc.

(2) service operation
User access


tail -f To view apache Access logs and error logs

View system logs /var/log/messages
View the server's connection to the Mysql database

3. Troubleshooting

(1).PHP class dynamic website

The service cannot be started, does not respond to user requests while running...
a.apache configuration file error
b. dynamic module lib PHP5_mod could not be edited correctly
c. The root directory is not set correctly
d. Port conflict
e. System load is too high and resources are exhausted
The f.Apache configuration parameter is not reasonable
g. Firewall configuration not correct
h. Database failure
i. System crash
j. File system corrupted
k. Disk partition depletion / /usr /var
l NFS failure
m. Under load balancing, Apache listening address is not 127.0.0.1

(2).JSP type website

a. System environment variable set incorrectly or not set
b.Apache and Tomcat's root directory Settings are different
c.JSP run 1 cannot free memory

4. Problem handling (case 1)
Apache virtual host could not access the solution
Method: set directory permissions

5. Fault handling process (slow opening of the forum) (case 2)
(1).uptime -- > top -- > System load
(2).vim /etc/passwd -- > View system account
(3).iptables -L -n -- > View firewall
(4).mysql client connects to database


mysql> show processlist;

(5). View the number of connections for Apache

ps aux | grep httpd | grep -v grep | wc -l

(6). Check the number of connections of TCP and summarize

netstat -an | awk '/^tcp/ {++ S[$NF]} END {for (a in S) print a,S[a]}'

(7). View port request 80


netstat -anp | grep -v unix

(8). Restart Apache


/usr/local/apache/bin/apachectl restart

(9). View the number of processes again

ps aux | grep httpd | grep -v grep | wc -l

(10). Modify the maximum number of connections of Apache


<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 fault (case 3)

The mysql client connects to the database


mysql> show processlist;


Related articles: