关于nginx:mac安装nginx

一、先装置brew
国内疾速装置homebrew参考这篇文章
https://zhuanlan.zhihu.com/p/…
二、装置nginx
应用命令brew install nginx装置最新版本的nginx
三、保留nginx的装置信息

==> nginx
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx now and restart at login:
  brew services start nginx
Or, if you don't want/need a background service you can just run:
  nginx

如果想开机后盾运行:brew services start nginx
不想开机运行:nginx
四、常用命令

启动 nginx #浏览器拜访 127.0.0.1 测试是否胜利启动 
重启 nginx -s reload 
进行 nginx -s stop
查看版本 nginx -v

【腾讯云】轻量 2核2G4M,首年65元

阿里云限时活动-云数据库 RDS MySQL  1核2G配置 1.88/月 速抢

本文由乐趣区整理发布,转载请注明出处,谢谢。

您可能还喜欢...

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据