之前写过:
CentOS 6.5 下 Tengine 安装记录
最近工作办公电脑换了 Mac,刚好有机会实践一下。
安装非常简单:
sudo port install nginx
或者使用:
sudo brew install nginx
使用brew可能还需要:
brew search nginx
port 和 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
配置文件 示例:我改了下端口和默认文档
#user n