はじめに
EC2インスタンスで、30080ポートを解放したときに少し詰まったので、メモします。
原因
SElinuxが有効になっていました!!
# getenforce
Enforcing ★これだとだめ!
解決策
SElinuxを無効にします!!
# vi /etc/sysconfig/selinux
●変更前
# 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 ★有効になっています!
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
●変更後
# 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=disabled ★ここを無効に変更
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
●変更が終わったら、サーバーの再起動!
# shutdown -r now
●確認!
# getenforce
Disabled ★これならOK
その他の確認ポイント
- ELBのリスナーポートの転送設定
- ELB経由しているかどうか
- セキュリティグループ(EC2とELB)