之前写过:
CentOS 6.5 下 Tengine 安装记录
最近工作办公电脑换了 Mac,刚好有机会实践一下。
安装非常简单:
sudo port install nginx或者使用:
sudo brew install nginx使用brew可能还需要:
brew search nginxport 和 brew 是 Mac 下两大包管理工具,使用它们安装软件非常的方便,类似 CentOS下的 yum ,Ubuntu 下的 apt-get 。
安装完成会输出以下提示:我是使用 port 安装的:
nginx has the following notes:
A set of sample configuration files has been installed in /opt/local/share/nginx/examples.
Additionally, the files nginx.conf, mime.types, fastcgi.conf have been copied to /opt/local/etc/nginx if they didn't
exist yet.
Adjust these files to your needs before starting nginx.查看可执行文件 目录:
which nginx
/opt/local/sbin/nginx
/opt/local/share/nginx/examples 目录下是配置示例文件;
/opt/local/etc/nginx 实际使用的配置文件 在这个目录下;
编辑配置&重新加载配置:
sudo vi nginx.conf
sudo nginx -s reload配置文件 示例:我改了下端口和默认文档

本文记录了在MacOS上通过port安装Nginx的过程,包括安装步骤、配置文件位置以及Nginx的常用命令,如启动、停止、重新加载配置等。同时,解释了nginx -s quit和nginx -s stop的区别,强调了quit的优雅退出方式。
最低0.47元/天 解锁文章
360

被折叠的 条评论
为什么被折叠?



