编译安装nginx1.22.1
时间: 2023-10-22 13:04:39 浏览: 214
编译安装Nginx 1.22.1的步骤如下:
1. 下载Nginx的安装包:`wget http://nginx.org/download/nginx-1.22.1.tar.gz`
2. 解压安装包到`/usr/local`目录下:`tar -zxvf nginx-1.22.1.tar.gz -C /usr/local`
3. 配置环境变量:`export PATH=/usr/local/nginx/sbin:$PATH`
4. 进入解压后的Nginx目录:`cd /usr/local/nginx-1.22.1`
5. 运行配置命令:`./configure --prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/`
6. 编译Nginx:`make`
7. 安装Nginx:`make install`
阅读全文