0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

OCIでUbuntuイメージのwebサーバを作る時のファイアウォールの設定で手抜きをしたら失敗した話

Posted at

といっても、ただ単に、ufwじゃなくてiptablesを使おうという話です。

コンピュートインスタンスでのwebサーバの作成

OCIのヘルプセンター記事

手順通りに進めていきますが、ここに記載されている例はOracle Linuxの場合の手順です。
大まかにはUbuntuの場合も同じですので、適宜読み替えて進めていきます。

手抜きをして失敗した箇所

ファイアウォール・ルールの設定で次の指示があります。

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --reload

Ubuntuイメージにはfirewalldがインストールされていないため、firewall-cmdコマンドを使うことができません。
で、手抜きでufwでいいかと思って80番ポートの開放設定をしてもブラウザからアクセスすることができません。

OCI用のルールがufwではなくiptablesで設定されているので、手抜きをせずに正直にそちらを使わないとうまくいかないようです。

で、

sudo apt install firewalld

でfirewalldをインストールして、指示通り設定をすれば、普通にブラウザからアクセスできてしまうのでした。。

楽をしようとして手抜きした結果、回り道になっちゃいました…

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?