1.要安装brew,因为brew就和linux-centos系统中的yum命令一样使用。
以下命令复制到终端中执行
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
若命令执行超时,说明被墙阻断了
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install>>brew.sh
vi brew.sh
BREW_REPO = "https://github.com/Homebrew/brew".freeze
CORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze
修改为:
BREW_REPO = "https://mirrors.ustc.edu.cn/bew.git".freeze
CORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core.git".freeze
保存:
/usr/bin/ruby brew.sh
发现brew 命令可以使用了
2.安装pcre
brew install PCRE
3.下载nginx
nginx官网: http://nginx.org
http://nginx.org/download/nginx-1.13.4.tar.gz
tar -zxvf nginx-1.13.4.tar.gz
cd ngxin-1.13.4
./configure --prefix=/usr/local/nginx
make
sudo make install
完成