Nginx 记录

在mac上安装了 brew  然后使用 brew install nginx 安装的  还有 brew install mysql

nginx 默认目录给放到了 /usr/local/sbin

启动nginx 的时候发现Address already in use

用lsof -i :8080  查看这个端口 

ebProces   464 liu1695347_apple   25u  IPv4 0xffffff801eb46a40      0t0  TCP localhost:53686->bt-199-037.bta.net.cn:http-alt (CLOSE_WAIT)
nginx     15508             root    6u  IPv4 0xffffff800fd50a40      0t0  TCP *:http-alt (LISTEN)
nginx     15509           nobody    6u  IPv4 0xffffff800fd50a40      0t0  TCP *:http-alt (LISTEN)

查出这样的东西

然后 kill -9 15508   kill -9 15509 就行了 然后再重新启动一下  OK

然后 http://127.0.0.1:8080 好了


修改配置文件后 启动 nginx  出现   invalid event type "epoll" in /usr/local/etc/nginx/nginx.conf:16   

use epoll;  使用epool   仅用于linux2.6以上内核,可以大大提高nginx的性能  貌似mac用不了功能啊  先去掉吧


修改nginx 配置文件的时候 先 nginx -t 检查一下 

nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful

然后在启动 或 nginx -s reload

kill  pid文件的进程主id


启动服务的时候 setrlimit(RLIMIT_NOFILE, 65535) failed (22: Invalid argument) 

一直有这个错误 然后修改worker_rlimit_nofile 这个参数linux 2.6内核下开启文件打开数为65535

关闭nginx  ./nginx -s stop  或 kill -9 所有的进程(lsof -i :80端口)   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值