➜ ~ brew cask help Homebrew Cask provides a friendly CLI workflow for the administration of macOS applications distributed as binaries.
Commands:
audit verifies installability of Casks cat dump raw source of the given Cask to the standard output create creates the given Cask and opens it in an editor doctor checks for configuration issues edit edits the given Cask fetch downloads remote application files to local cache home opens the homepage of the given Cask info displays information about the given Cask install installs the given Cask list with no args, lists installed Casks; given installed Casks, lists staged files outdated list the outdated installed Casks reinstall reinstalls the given Cask style checks Cask style using RuboCop uninstall uninstalls the given Cask upgrade upgrades all outdated casks zap zaps all files associated with the given Cask
# 更新软件列表 ➜ ~ brew update Already up-to-date. # 搜索nginx相关的软件 ➜ ~ brew search nginx ==> Formulae nginx ✔ # 查看nginx相关的信息 ➜ ~ brew info nginx nginx: stable 1.15.3 (bottled), HEAD HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server https://nginx.org/ /usr/local/Cellar/nginx/1.15.3 (23 files, 1.4MB) * Poured from bottle on 2018-09-12 at 15:32:54 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/nginx.rb ==> Dependencies # 依赖相关,安装时会自动安装上 Required: openssl ✘, pcre ✘ Optional: passenger ✘ ==> Options --with-passenger Compile with support for Phusion Passenger module --HEAD Install HEAD version ==> Caveats Docroot is: /usr/local/var/www # 文档位置 # 这里解释了为什么会监听8080端口的原因,这样就可以不用sudo也能启动nginx # 这里可以注意一下nginx.conf的位置 The default port has been setin /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 #启动nginx的方式之一 Or, if you do not want/need a background service you can just run: nginx #启动nginx的方式之二,感觉我一般会倾向于用这个,毕竟mac不会一直用来当服务器。 ==> Analytics install: 35395 (30d), 114392 (90d), 354080 (365d) install_on_request: 32185 (30d), 99518 (90d), 300056 (365d) build_error: 103 (30d) ➜ ~ brew install nginx # 这里已经安装过了,输出请忽略 Warning: nginx 1.15.3 is already installed and up-to-date To reinstall 1.15.3, run `brew reinstall nginx`