CentOS に nginx をインストールする、メモ。
cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
リポジトリ追加
/etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
ls -l /etc/yum.repos.d/
-rw-r--r--. 1 root root 100 Dec 24 01:53 nginx.repo
インストール
yum info nginx
yum install nginx
起動設定と開始
systemctl enable nginx
systemctl start nginx
systemctl status nginx
ファイアウォール ← ここ忘れる。
firewall-cmd --add-service=http --zone=public --permanent
firewall-cmd --reload
場所 | 説明 |
---|---|
/etc/nginx/ | Nginx の設定ファイルが保存されているディレクトリ |
/etc/nginx/nginx.conf | メインとなる設定ファイル |
/var/log/nignx/ | Nginx のログが保存されるディレクトリ |
/usr/share/nginx/html/ | WEBサイトの公開ディレクトリ |