修改密码
passwd root
网卡添加IP地址
ifconfig eth0:1 184.82.167.219 netmask 255.255.255.248ifconfig eth0:2 184.82.167.220 netmask 255.255.255.248
重启
rebotshutdown -r now #立刻重启(root用户使用)shutdown -r 10 #过10分钟自动重启(root用户使用)shutdown -r 20:35 #在时间为20:35时候重启(root用户使用)
如果是通过shutdown命令设置重启的话,可以用shutdown -c命令取消重启
关机
halt #立刻关机poweroff #立刻关机shutdown -h now #立刻关机(root用户使用)shutdown -h 10 #10分钟后自动关机
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/2012'|awk '{print $1}'|sort|uniq -c|sort -nr|lessnetstat -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 (a in S) print a, S[a]}'
同时在查资料的过程中,拣到一条命令:
netstat -n | awk '/^tcp/ {++S[$NF]} END {for (a in S) print a, S[a]}'
这条语句返回结果如下
LAST_ACK 5SYN_RECV 30ESTABLISHED 1597FIN_WAIT1 51FIN_WAIT2 504TIME_WAIT 1057
其中的SYN_RECV表示正在等待处理的请求数;ESTABLISHED表示正常数据传输状态;TIME_WAIT表示处理完毕,等待超时结束的请求数。 返回的结果非常简洁直接,就是句子有点长 -_-
禁止IP访问
RewriteCond %{HTTP_HOST} !^www.abc.com [NC]RewriteCond %{HTTP_HOST} !^abc.com [NC]RewriteRule (.*) http://127.0.0.1 [R=301,L]
MySQL
启动 /etc/rc.d/init.d/mysqld start
重启 /etc/rc.d/init.d/mysqld restart
停止 /etc/rc.d/init.d/mysqld stop
service mysqld start
netstat -n|grep 'mysql.sock'|wc -l