Linux能Ping通卻訪問不了網(wǎng)站,但在服務(wù)器里能wget成功

2023-06-11    分類: 網(wǎng)站建設(shè)

今天配置一臺(tái)Linux服務(wù)器,系統(tǒng)是Centos,配置完畢訪問網(wǎng)站時(shí)卻不成功,沒有什么提示,就是網(wǎng)絡(luò)不通,訪問網(wǎng)頁超時(shí)。image.png訪問網(wǎng)頁超時(shí)

不過,我在服務(wù)器里用wget命令訪問網(wǎng)站時(shí),卻是成功的。

 image.png

wget命令訪問網(wǎng)站成功

也即是說,外網(wǎng)訪問不了網(wǎng)站,服務(wù)器里能訪問。

這是什么原因呢?

后來我問了下客服,他叫我關(guān)了防火墻試試,關(guān)閉防火墻的命令是:

iptables stop

我沒有這樣操作,而是清空iptables規(guī)則,使用命令是:

iptables -F && iptables -X && iptables -Z

我之前更改過config安全配置文件,位置在:

/etc/selinux/config

使用代碼是:

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - No SELinux policy is loaded.

# SELINUX=enforcing

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

# targeted - Targeted processes are protected,

# mls - Multi Level Security protection.

SELINUXTYPE=targeted

更改完畢,再訪問網(wǎng)站,真的成功了!原來真是防火墻的問題!

分享標(biāo)題:Linux能Ping通卻訪問不了網(wǎng)站,但在服務(wù)器里能wget成功
本文地址:http://www.muchs.cn/news37/264437.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、電子商務(wù)外貿(mào)建站、外貿(mào)網(wǎng)站建設(shè)、定制網(wǎng)站、企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管