Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.