centos79 离线搭建nginx-1201tar
以下是在CentOS 7.9上离线搭建nginx-1.20.1.tar的步骤:
- 下载nginx-1.20.1.tar文件到本地机器上,可以在官网下载或从镜像站下载。例如,可以使用以下命令从官网下载:
wget https://nginx.org/download/nginx-1.20.1.tar.gz
- 将下载的文件复制到CentOS 7.9服务器上,例如,可以使用scp命令从本地机器复制到远程服务器:
scp nginx-1.20.1.tar.gz user@remote_host:/path/to/destination
- 解压文件:
tar -zxvf nginx-1.20.1.tar.gz
- 安装必要的依赖项:
sudo yum install -y gcc pcre-devel openssl-devel
- 进入nginx解压目录:
cd nginx-1.20.1
- 配置nginx:
./configure --prefix=/usr/share/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 --with-http_ssl_module --with-pcre --with-file-aio --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_gunzip_module --with-http_gzip_static_module
- 编译并安装nginx:
make && sudo make install
- 启动nginx:
sudo systemctl start nginx
- 验证nginx是否运行:
systemctl status nginx
以上是在CentOS 7.9上离线搭建nginx-1.20.1.tar的步骤。
原文地址: https://www.cveoy.top/t/topic/JNA 著作权归作者所有。请勿转载和采集!