Common Linux commands (including Apache and MySQL)

Source: Internet
Author: User
ArticleDirectory
    • Change Password
    • Add IP addresses to the NIC
    • Restart
    • Apache
Change Password
 
Passwd Root
Add IP addresses to the NIC
 
Ifconfig eth0: 1 184.82.167.219 netmask 255.255.255.255.248Ifconfig eth0:2 184.82.167.220 netmask 255.255.255.248
Restart
 
Rebotshutdown-R now#Restart immediately (used by the root user)Shutdown-R 10#Restart automatically in 10 minutes (used by root users)Shutdown-r 20:35#Restart at (for root users)

If you use the shutdown command to set the restart, you can use the shutdown-C command to cancel the restart.

Shutdown
Halt#Shut down immediatelyPoweroff#Shut down immediatelyShutdown-H now#Shut down immediately (used by root users)Shutdown-H 10#Automatically shut down in 10 minutes
Apache
 
Service httpd startapachectl-Vapachectl startapachectl stopapachectl restart

/Etc/httpd/CONF/extra

/Var/log/httpd/

Tail/etc/httpd/logs/ Access_logtail  -F /Etc/httpd/logs/ Access_logcat /Etc/httpd/logs/access_log | awk '{print $1 } '| Sort | uniq-c | sort-Nr | Lesscat /Etc/httpd/logs/access_log | grep '02/APR/100' | awk '{print $1 } '| Sort | uniq-c | sort-Nr | Less  Netstat -N | grep TCP | WC- Lnetstat -N | grep UDP | WC- LPS -Aux | grep httpd | WC- LPS -Ef | grep httpd | WC- Lnetstat -N | awk '/^ TCP/{++ s [ $ NF ]}End { For ( In S) print a, s [a]}'

At the same time, a command is found during data query:

 
Netstat-N | awk '/^ TCP/{++ s [$ NF]} end {for (a in S) print a, s [a]}'

The returned results of this statement are as follows:

 
Last_ack 5syn_recv 30 established 1597fin_wait1 51fin_wait2 504time_wait 1057

Syn_recv indicates the number of requests waiting for processing, established indicates the normal data transmission status, and time_wait indicates the number of requests waiting for timeout. The returned result is very concise and straightforward, that is, the sentence is a little long -_-

Disable IP Access
 
Rewritecond % {http_host }!^ Www.abc.com [Nc] rewritecond% {Http_host }!^ Abc.com [Nc] rewriterule (.*) Http: // 127.0.0.1 [R = 301, l]
MySQL

Start/etc/rc. d/init. d/mysqld start

Restart/etc/rc. d/init. d/mysqld restart

Stop/etc/rc. d/init. d/mysqld stop

 
Service mysqld start
 
Netstat-N | grep 'mysql. Sock '| WC-L

 

 

 

Related Article

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.