Skip to content

Instantly share code, notes, and snippets.

@kenzo0107
Last active June 20, 2017 02:05
Show Gist options
  • Save kenzo0107/f779db05456c5b9f3d98 to your computer and use it in GitHub Desktop.
Save kenzo0107/f779db05456c5b9f3d98 to your computer and use it in GitHub Desktop.
# rootユーザへ変更
sudo su -
# nginxリポジトリ設定
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum clean all
yum update
# nginxインストール
yum install -y nginx
# nginx バージョン確認
/usr/sbin/nginx -V
# nginx起動&サービス登録
/bin/systemctl start nginx.service
/bin/systemctl enable nginx
# nginxステータス表示
systemctl status nginx
# http://(ipアドレス)アクセスした際に以下のようなエラー文が表示される場合
# 「Gateway Timeout: can't connect to remote host」
# http通信を許可
firewall-cmd --add-service=http --zone=public --permanent
systemctl restart firewalld
# http://(ipアドレス)にアクセスして以下が表示されれば成功
# 「Welcome to nginx!」
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment