LoginSignup
0
0

More than 1 year has passed since last update.

ConoHa VPSで借りたサーバーにブラウザでアクセスして"ERR_CONNECTION_REFUSED"と出たら…

Last updated at Posted at 2022-08-01

ファイアーウォールの設定を確認してください。
http接続用ポート(80)とhttps接続用ポート(443)が開いておらず、そのせいでアクセスが拒否されている可能性があります。

環境
Ubuntu 22.04 LTS

手順①既に開いているポートの確認

#コマンド
sudo ufw status

#結果
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)

手順②アクセスを許可するポートの追加

#コマンド
sudo ufw allow http

#結果
Status: active

To                         Action      From
--                         ------      ----
22/tcp (OpenSSH)           ALLOW IN    Anywhere
80/tcp                     ALLOW IN    Anywhere
22/tcp (OpenSSH (v6))      ALLOW IN    Anywhere (v6)
80/tcp (v6)                ALLOW IN    Anywhere (v6)

同じようにsudo ufw allow httpsを実行してあげると443/tcpも追加されます。

ちなみに、設定を書き換えたらsudo reboot nowなどでサーバーを再起動しないと変更が反映されないかも。私はそうでした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0