0
1

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 5 years have passed since last update.

CentOS7 ローカルネットワークからのhttp/httpsアクセスを許可する

Posted at

CentOS7上で動作しているhttp/httpsサービスについて、ローカルネットワーク内の他のPCからのアクセスを許可する方法。
firewalldを使う。下記に示すコマンドをRoot権限で実行すればOK。
(手早くできればいい人向け)

firewalldを起動させる

# firewalldを起動
systemctl start firewalld.service
# firewalldを次回から自動で起動させる
systemctl enable firewalld.service

http/httpsへのアクセスを許可

firewall-cmd --permanent --new-zone=ci
firewall-cmd --permanent --zone=ci --set-target=ACCEPT
# アクセス元がローカルネットワーク内のマシンなら許可。適宜変更すること
firewall-cmd --permanent --zone=ci --add-source=192.168.0.0/24
firewall-cmd --permanent --zone=ci --add-service=http
firewall-cmd --permanent --zone=ci --add-service=https
firewall-cmd --reload

ここでは"ci"という名前のzoneを作成し、それに対してhttp/httpsサービスへのアクセスを許可するように設定している。
("ci"という名前に特別な意味はないので変更可)

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?