• 欢迎光临~

centos7安装nginx

开发技术 开发技术 2022-08-19 次浏览

1、解压

tar -zxvf nginx.tar.gz

2、进入解压后的文件

cd nginx

3、执行configure文件./configure

可能会有报错:

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=path option.

yum安装依赖yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel

4、执行make命令

5、执行make install命令

make PREFIX=[路径] install 可以指定安装位置

6、执行whereis nginx命令

程序员灯塔
转载请注明原文链接:centos7安装nginx
喜欢 (0)