使用brew安装nginx
$ brew install nginx

启动nginx

sudo nginx

访问localhost:8080 发现已出现nginx的欢迎页面了。

为方便期间,做个软连接:

sudo ln -s /usr/local/bin/nginx /usr/bin/nginx #我的mac没有成功,提示没有权限

常用的指令有:

nginx -V 查看版本,以及配置文件地址
nginx -v 查看版本
nginx -c filename 指定配置文件
nginx -h 帮助 打开 nginx
sudo nginx nginx 重新加载配置|重启|停止|退出
nginx -s reload|reopen|stop|quit 测试配置是否有语法错误
nginx -t

例子:

MacBookPro:superlists apple$ ln -s /usr/local/bin/nginx /usr/bin/nginx

ln: /usr/bin/nginx: Operation not permitted
MacBookPro:superlists apple$ sudo nginx
Password:
MacBookPro:superlists apple$ nginx -v nginx version: nginx/1.10.
MacBookPro:superlists apple$ nginx -V nginx version: nginx/1.10.
built by clang 8.0. (clang-800.0.42.1)
built with OpenSSL 1.1.0c Nov
TLS SNI support enabled
configure arguments: --prefix=/usr/local/Cellar/nginx/1.10.2_1 --with-http_ssl_module --with-pcre --sbin-path=/usr/local/Cellar/nginx/1.10.2_1/bin/nginx --with-cc-opt='-I/usr/local/opt/pcre/include -I/usr/local/opt/openssl@1.1/include' --with-ld-opt='-L/usr/local/opt/pcre/lib -L/usr/local/opt/openssl@1.1/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock --http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-http_gzip_static_module --with-ipv6
 

Nginx安装日志如下:

 MacBookPro:superlists apple$ brew install nginx
Updating Homebrew...
==> Auto-updated Homebrew!
Updated tap (homebrew/core).
==> New Formulae
cnats mingw-w64-binutils opencoarrays
imagemagick@ molecule watchexec
==> Updated Formulae
abcde gitup mongoose
afl-fuzz gnupg-pkcs11-scd openshift-cli
ansible godep orientdb
aria2 groonga pius
arping gtk+ pngcrush
aws-sdk-cpp h2o pyenv
awscli htmlcleaner rocksdb
certbot httrack speedtest_cli
deis hyperscan sshguard
deisctl ios-webkit-debug-proxy swaks
docker-compose iso-codes swiftformat
docker-machine kobalt tcpkali
docker-machine-nfs libgcrypt tomcat
dpkg libgtop vim
eiffelstudio libtasn1 xz
fabio libxc yank
flow lighttpd yash
fossil logentries youtube-dl
fwup makeself ==> Installing dependencies for nginx: pcre, openssl@1.1
==> Installing nginx dependency: pcre
==> Downloading https://homebrew.bintray.com/bottles/pcre-8.39.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pcre-8.39.sierra.bottle.tar.gz

Mac上使用brew安装Nginx服务器的更多相关文章

  1. Mac下用brew安装nginx

    1. nginx nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TC ...

  2. Mac OS使用brew安装Nginx、MySQL、PHP-FPM的LAMP开发环境

    准备工作 新版的 Mac OS 内置了Apache 和 PHP,我的系统版本是OS X 10.9.3,可以通过以下命令查看Apache和PHP的版本号: httpd -v Server version ...

  3. 【mac】mac上使用brew 安装速度慢/每次使用brew 都会卡在updating homebrew不动/更换homebrew的镜像源

    有没有出现一下这样的情况: 如果有,请继续往下走 1.打开mac的命令窗口,键入如下命令 cd /usr/local/Homebrew 2.更换homebrew的默认源[更换为中科大的镜像源] git ...

  4. Mac上使用brew安装nvm来支持多版本的Nodejs

    brew方式 如果机器没有安装过node,那么首先brew install nvm安装nvm. 其次需要在shell的配置文件(~/.bashrc, ~/.profile, or ~/.zshrc)中 ...

  5. 在CentOS 7上安装Nginx服务器

    下面我就我在CentOS上安装Nginx经验做简单的记录,以备后查. 1.下载nginx-release包 以CentOS 7为例,下载nginx软件包:http://nginx.org/packag ...

  6. 在Linux和Windows系统上安装Nginx服务器的教程

    在Linux和Windows系统上安装Nginx服务器的教程  1.在CentOS系统上安装Nginx 在 CentOS6 版本的 EPEL 源中,已经加入了 nginx 的 rpm 包,不过此 RP ...

  7. mac中使用brew安装软件,下载太慢怎么办?

    mac中使用brew安装软件,下载太慢怎么办? 本文所说的软件是指较大的软件,如果软件较小,例如软件只有几M,那么使用此方法后,提升会非常小. 了解brew原理: 1: 从网络下载安装包 2: 执行一 ...

  8. mac 下用 brew 安装mongodb

    转自:mac 下用 brew 安装mongodb 经过这位仁兄的文章指导,终于连上了mongodb. 启动mongo数据库,就是打开一个终端sudo mongod,然后打开另一个终端sudo mong ...

  9. Mac上tesseract-OCR的安装配置

    Mac上tesseract-OCR的安装配置 tesseract简介 OCR(Optical Character Recognition)即光学字符识别技术,专门用于对图片文字进行识别,并获取文本. ...

随机推荐

  1. ubuntu18.10 修改MySQL编码为utf-8

    首先登陆mysql的交互shell,输入下面的命令查看当前数据库的编码方式 show variables like '%character%'; 从上面可以看出,mysql数据库装上之后初始并不均是u ...

  2. 使用Wifi pineapple(菠萝派)进行Wi-Fi钓鱼攻击

    简介: WiFi Pineapple 是由国外无线安全审计公司Hak5开发并售卖的一款无线安全测试神器. 特性: 用作 Wi-Fi 中间人攻击测试平台 一整套的针对 AP 的渗透测试套件 基于 WEB ...

  3. MaskRCNN 奔跑自己的数据

    import os import sys import random import math import re import time import numpy as np import cv2 i ...

  4. [转帖]单集群10万节点 走进腾讯云分布式调度系统VStation

    单集群10万节点 走进腾讯云分布式调度系统VStation https://www.sohu.com/a/227223696_355140 2018-04-04 08:18 云计算并非无中生有的概念, ...

  5. 记一次EFCore类型转换错误及解决方案

    一  背景 今天在使用EntityFrameworkCore 查询的时候在调试的时候总是提示如下错误:Unable to cast object of type 'System.Data.SqlTyp ...

  6. Visual Studio 2019 离线安装方法

    1. 网址 1.1 阅读官方离线安装教程 离线安装官网 仔细阅读离线安装官网,差不多就能学会如何下载. 1.2 工作负荷和组件 ID 进入这个网址,Visual Studio 工作负荷和组件 ID,单 ...

  7. QT release版QAudioDeviceInfo获取不到音频设备,而debug版可以获取到

    新添加了两个模块:QCharts和Multimedia 但自己没有重新打包更新里面的库文件什么的... 坑爹... 害我找了这么久... 解决办法: 方法一: 将Qt安装目录下的plugins文件夹中 ...

  8. WUSTOJ 1317: cms的苦恼(Java)快速幂

    题目链接:

  9. 【HC89S003F4开发板】 8c转义成汇编工程

    HC89S003F4开发板建立汇编工程 选择编译文件 @选用开发板闪灯例程,将例程删除多余的注释,后面生成的文件会更直观. #define ALLOCATE_EXTERN #include " ...

  10. windows Git Bash 无法运行python文件的解决方法(转)

    https://blog.csdn.net/xie_0723/article/details/51958243