ngnix的基本安装及配置 centos7

1.centos7  挂载ngnix的源

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

2.安装ngnix 

yum install nginx   

3.常用命令

a . 启动:service nginx start

b. 停止 : nginx -s stop

c. 启动 : nginx -c /etc/nginx/nginx.conf

4.常见问题解决  403一种解决方式

vim /etc/nginx/nginx.conf  
# user 用户名 用户组  ; 设置的用户名和组就是静态文件的
user dongshanxia  dongshanxia ;


 
原文地址:https://www.cnblogs.com/dongshanxia/p/10513456.html