一:

/usr/local/etc/nginx/nginx.conf (配置文件路径)
/usr/local/var/www (服务器默认路径)
/usr/local/Cellar/nginx/1.6.2 (貌似是安装路径)

二:

nginx -V 查看nginx版本及安装的本地位置
nginx -v 查看nginx版本(此方法依然可以检测是否安装某一软件,如git,hg等)

三:

/nginx/sbin/nginx  #没有提示表示启动成功
/nginx/sbin/nginx -t  #检查语法
/nginx/sbin/nginx -s reload   #重启

四:
/nginx/conf/nginx.conf文件参数对应意思:

worker_processes 1;  #worker进程数量
  events {  #事件区块开始
  worker_connections 1024;  #每个worker进程支持的最大连接数
  }
  http {  #http区块开始
  include mime.types;  #Nginx支持的媒体类型库文件包含
  default_type application/octet-stream;  #默认的媒体类型
  sendfile on;  #开启高效传输模式
  keepalive_timeout 65;  #连接超时
  server {  #server区块开始,表示一个独立的主机站点
  listen 80;  #提供服务的端口,默认80
  server_name www.toyixin.cn;  #提供服务的域名主机号
  location / {  #第一个location区块开始
  root html/www;  #站点根目录,相对于nginx安装目录
  index index.html index.html;  #默认的首页文件多个用空格分开
  }

error_page 500 502 503 504 /50x.html;  #出现对应的http状态码时,使用50x.html回应客户

location = /50x.html {  #location区块开始,访问50x.html
  root html;  #指定对应的站点目录位html
  }

}

}

标签: none

添加新评论