LoginSignup
1
1

More than 5 years have passed since last update.

【AWS EC2】Apacheのポートを変更できない。80番以外のポートにしたい。

Last updated at Posted at 2017-10-03

はじめに

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