Mac 编译安装nginx
curl -O https://nginx.org/download/nginx-1.22.0.tar.gz
sudo tar -zxf nginx-1.22.0.tar.gz
ps:将nginx语法高亮放在vim里面
sudo cp -r contrib/vim/* ~/.vim/
ps: 安装在指定的目录,参数 --prefix=
sudo ./configure --prefix=/usr/local/nginx
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
ps: 需要下载 PCRE
⬇️下载地址
ps-1
ps-2
ps:解压目录我的是在 /usr/local/
sudo tar -zxf pcre2-10.40.tar.gz
ps: 在nginx安装目录,执行该命令~
sudo ./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre2-10.40
ps: 在nginx安装目录,执行该命令~
sudo make
ps-1
ps-2
ps: 会在/usr/local/nginx目录下生成目录
sudo make install
ps-3