使用 CentOS 安装 nginx

CentOS 上安装 nginx 的备忘录。

cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)

添加仓库

[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サイトの公開ディレクトリ
广告
将在 10 秒后关闭
bannerAds