CentOS 6下安装nginx

1.root登陆后安装

wget https://down.boluo.link/linux/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm 
yum install nginx

2.nginx的几个默认目录

whereis nginx nginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx 

a.配置所在目录:/etc/nginx/ 

b.PID目录:/var/run/nginx.pid 

c.错误日志:/var/log/nginx/error.log 

d.访问日志:/var/log/nginx/access.log 

e.默认站点目录:/usr/share/nginx/html

3.常用命令

启动nginx:nginx 

重启nginx:killall -HUP nginx 

测试nginx配置:nginx -t

评论