博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux常用命令 (包含Apache, MySQL)
阅读量:6947 次
发布时间:2019-06-27

本文共 1522 字,大约阅读时间需要 5 分钟。

 修改密码

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

 

 

 

转载地址:http://hshnl.baihongyu.com/

你可能感兴趣的文章
了解大数据的特点、来源与数据呈现方式
查看>>
spring 组件扫描配置说明component-scan
查看>>
Clarke and five-pointed star
查看>>
设计模式系列2-----C++实现责任链模式(Chain of Responsibility)
查看>>
20189312任方园《网络攻防》第六次作业
查看>>
php
查看>>
职场人的“存在主义”哲学
查看>>
在路上【我与51CTO的故事】
查看>>
演示:外部全局地址与外部局部地址的使用案例
查看>>
Exchange Server 2013 公网发布疑难解答
查看>>
Oracle 12c dataguard云上挖坑记--为某机场贵宾业务部署oracle 12c到云端
查看>>
前端开发在不久的将来定会成为主导
查看>>
jQuery内ready与load事件的区别
查看>>
[笔记].关于Stratix III使用非易失加密后,无法正常配置启动的问题探讨
查看>>
一个通用的单元测试框架的思考和设计03-实现篇-核心类源码
查看>>
载入史册 改变IT安全历程的十大里程碑
查看>>
UVA 624 CD
查看>>
Windows phone 7: DataBinding and UI Refresh系列教程
查看>>
矩阵快速幂 学习笔记
查看>>
linux iconv 批量转码
查看>>