创建源配置文件:

cd /etc/yum.repos.d/
sudo vim nginx.repo

填写内容:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

安装 Nginx:

sudo yum install nginx -y

启动 Nginx:

sudo /etc/init.d/nginx start
# or
sudo nginx

重启 Nginx:

sudo /etc/init.d/nginx restart
# or
sudo nginx -s reopen

配置文件路径:

sudo vim /etc/nginx/nginx.conf
sudo vim /etc/nginx/conf.d/default.conf

sudo nginx -s reload

参考连接:

Comments
Write a Comment