雲服務器開啓了安全組8080、3306等端口仍然不能訪問Tomcat、Mysql等服務

1、端口測試

netstat -tunlp |grep 8080
netstat -tunlp |grep 3306
netstat -tunlp |grep 22

2、防火牆操作

1、查看firewall服務狀態
systemctl status firewalld
2、查看firewall的狀態
firewall-cmd --state
# 開啓
service firewalld start
# 重啓
service firewalld restart
# 關閉
service firewalld stop

3、mysql配置外網訪問

netstat -an|grep 3306

若出現下圖,表示只允許本地
在這裏插入圖片描述

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

註釋掉下面這個bind-address = 127.0.0.1
在這裏插入圖片描述
重啓服務器

reboot
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章