摘要:总结一些常用的东西
pwd
cd ..是回到上一级目录
cd . 是当前目录
cd / 是回到根目录
cd ~ 回到用户主目录
lsb_release -a (需要安装redhat-lsb yum install redhat-lsb)
service --status0all
chkconfig --list
netstat -lntp
https://lnmp.org/install.html
https://lnmp.org/faq/lnmp-status-manager.html
rm -f lnmp1.5.tar.gz
free
free -m
exit
mysql -uroot -p
clear
sudo -i (一般是需要输入密码,但是不需要的化说明已经设置过了不需要密码,aws可以直接这样不用写root 直接就登陆进去了)
ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 (创建软连接 https://blog.csdn.net/dumeifang/article/details/2963223)
先去看看端口是不是没开
ftp——服务器发回了不可路由的地址。使用服务器地址代替。
选中某一连接项
高级——加密——只使用普通ftp
传输设置——传输模式——主动
重新连接
ifconfig
更改安全组规则 添加ICMP (其他的无法ping通也可以这样加)
whereis aaa
df -h
free -m
top
https://www.linode.com/docs/troubleshooting/troubleshooting/
systemctl stop firewalld.service
systemctl start firewalld.service
systemctl disable firewalld.service (关闭开机启动)
systemctl enable firewalld.service (开启开机启动)
防火墙下开启80和443端口
[root@li883-222 /]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
[root@li883-222 /]# firewall-cmd --zone=public --add-port=443/tcp --permanent
success
[root@li883-222 /]# firewall-cmd --reload
success
参考https://my.oschina.net/macleo/blog/1816346
php test.php
将apk改为zip结尾的然后解压
在META-INF 中有个xxx.RSA的就是需要的东西
把rsa放到服务器
linux进行操作[root@ip-172-31-11-213 linux.oceania-inc.com]# keytool -printcert -file __.RSA 即可得到需要
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
利用free -m 查看内存
find / -name SendGmailAtts.php
yum install lrzsz
cat /etc/redhat-release
启动firewall:systemctl start firewalld.service
停止firewall:systemctl stop firewalld.service
禁止firewall开机启动:systemctl disable firewalld.service
curl www.guosx.com
traceroute www.guosx.com (Linux)
tracert www.guosx.com (Windows)
作用一样
ps -ef|grep nginx
kill 进程号
last -f /var/log/wtmp
cat /var/log/secure
cd /var/log 然后执行history
chmod -R 777 /html
-R 递归修改
firewall-cmd --state #查看防火墙状态 或者systemctl status firewall
## zone -- 作用域
## add-port=80/tcp -- 添加端口,格式为:端口/通讯协议
## permanent -- 永久生效,没有此参数重启后失效
firewall-cmd --zone=public --add-port=3306/tcp --permanent
## 开启3306端口后,workbench或naivcat 就能连接到MySQL数据库了
firewall-cmd --reload # 重新载入
##查询端口号80 是否开启
firewall-cmd --query-port=3306/tcp # 查看防火墙是否启用
du -sh *
telnet ip port
eg telent 127.0.0.1 80
windows server2012开通协议
http://www.elmajdal.net/WindowsServer/How_To_Enable_Telnet_in_Windows_Server_2012.aspx
创建/var/test 引向/var/www/test 文件夹
(link)
ln –s /var/www/test /var/test
CustomLog "|/www/server/apache/bin/rotatelogs /www/wwwroot/statistics.oceania-sh.com/logs/access-%Y-%m-%d.log 86400" common
Win下
CustomLog "|bin/rotatelogs.exe D:/phpstudy/WWW/test/access%Y-%m-%d.log 86400" common
rotatelogs 需要设置执行目录,否则会出现文件名是后面百分号的问题
date -R
find / -name httpd.conf
登录 redis-cli.exe -h 127.0.0.1 -p 6379
查看密码 config get requirepass
修改密码 config set requirepass xxxxxx
账户密码登录 redis-cli.exte-p 6379 -a xxxxxx
redis.windows-service.conf
# bind 127.0.0.1
protected-mode no
redis-server.exe --service-strp
redis-server.exe --service-start
dhclient -v
https://www.cnblogs.com/qq1207501666/p/9036880.html(参考,有问题,解决方案如下)
修改网卡配置文件(操作前先备份一下该文件),打开/etc/sysconfig/network-secripts/文件夹,找到ifcfg-eno1网卡文件(每个机器的网卡文件名称不一样)
BOOTPROTO=static(静态ip)
IPADDR=192.168.1.20(IP地址)
NETMASK=255.255.255.0(子网掩码)
NETWORK=192.168.1.1(默认网关)
DNS1=192.168.1.1(DNS服务器)
ONBOOT=yes(是否激活网卡)