nginx 在 mac 電腦下安裝 nginx

mac 上安裝 nginx 需要借助 HomeBrew

1、安裝 HomeBrew

  1. 命令行運(yùn)行
    由于官網(wǎng)的安裝路徑總是安裝失敗,所以推薦選擇清華大學(xué)或者其他鏡像,按照提示操作
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  1. 重啟終端并運(yùn)行
source /Users/macbookpro/.zprofile
  1. 測(cè)試是否安裝成功
brew -v

2、安裝 nginx

  1. 命令行運(yùn)行
brew install nginx
  1. 查看是否安裝成功
nginx -t
  1. nginx 相關(guān)文件所在目錄,通過(guò) nginx -V 查看,結(jié)果如下
configure arguments:

# 靜態(tài)資源
--prefix=/usr/local/Cellar/nginx/1.27.2 

# 腳本命令
--sbin-path=/usr/local/Cellar/nginx/1.27.2/bin/nginx 
--with-cc-opt='-I/usr/local/opt/pcre2/include -I/usr/local/opt/openssl@3/include' 
--with-ld-opt='-L/usr/local/opt/pcre2/lib -L/usr/local/opt/openssl@3/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-compat --with-debug --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module 
--with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module 
--with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_v3_module --with-ipv6 --with-mail 
--with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容