Unbuntu nginx 安裝

落逸尘發表於2024-10-10

1. 下載原始碼
下載頁面:https://nginx.org/en/download.html
下載地址:https://nginx.org/download/nginx-1.27.2.tar.gz
curl -O https://nginx.org/download/nginx-1.27.2.tar.gz
2. 依賴配置
sudo apt install gcc make libpcre3-dev zlib1g-dev openssl libssl-dev

3. 編譯
解壓原始碼:
tar -zxvf nginx-1.27.2.tar.gz
生成編譯指令碼:
cd nginx-1.27.2/ ./configure --prefix=/usr/local/nginx --with-http_ssl_module
編譯:
make
編譯完成:

安裝
make install
檢視驗證:
ls /usr/local/nginx ls /usr/local/nginx/sbin/ sudo /usr/local/nginx/sbin/nginx -t

相關文章