首页 > 其他 > 详细

阿里云轻量级服务器的日常操作

时间:2021-03-09 09:25:16      阅读:25      评论:0      收藏:0      [点我收藏+]

1、使配置文件生效: source /etc/profile

2、查看配置环境path: echo $PATH

3、查看端口号: netstat -ano

  查看当前运行程序的端口:netstat -anpl | grep LISTEN

4、启动防火墙:systemctl start firewalld     关闭防火墙:systemctl stop firewalld    重启防火墙:systemctl restart firewalld

5、禁止开机启动防火墙:systemctl disable firewalld    设置开机自动启动防火墙:systemctl enable firewalld.service

6、查看防火墙状态:firewall-cmd --state    重新刷新防火墙:firewall-cmd --reload

7、查看防火墙开通的端口:

  firewall-cmd --permanent --list-ports

  firewall-cmd --zone=public --list-ports

  firewall-cmd --list-all

  查看是否开通3306端口:firewall-cmd --query-port=3306/tcp

8、开放8080端口:firewall-cmd --zone=public --permanent --add-port=8080/tcp

9、开放3306端口:firewall-cmd --zone=public --add-port=3306/tcp --permanent

  (注意:开放端口其实方法都可以,只要把端口号改了就可以)

10、移除8080端口:firewall-cmd --permanent --remove-port=8080/tcp

参考:https://blog.csdn.net/wbyzl1/article/details/105789522

  

阿里云轻量级服务器的日常操作

原文:https://www.cnblogs.com/XiaXiaHaHa/p/14503293.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!