安装
1. 下载NGINX压缩包:
wget http://nginx.org/download/nginx-1.13.7.tar.gz
如果报错:
bash: wget: command not found那么运行:yum install wget
2. 解压NGINX:
执行命令:tar -zxvf nginx-1.13.7.tar.gz
3. 依次执行以下命令:
-
进入nginx执行命令:
cd nginx-1.13.7 -
执行命令:
./configure如果报错:
./configure: error: the HTTP rewrite module requires the PCRE library.:
* 安装pcre-devel解决问题:yum -y install pcre-devel如果再报错:
./configure: error: the HTTP cache module requires md5 functions from OpenSSL library.You can ...
1. 安装openssl解决问题:yum -y install openssl openssl-devel
2. 加参数执行命令:./configure --prefix=/usr/local/nginx -
执行命令:
make -
执行命令:
make install
注意: nginx一般默认安装好的路径为/usr/local/nginx
本文详细介绍了在Linux环境下从源码编译安装NGINX的步骤。首先通过wget下载NGINX压缩包,若wget未安装则需通过yum进行安装。接着解压NGINX并进入目录,使用./configure配置,遇到依赖缺失时分别安装pcre-devel和openssl及openssl-devel。最后执行make和make install完成安装。默认安装路径为/usr/local/nginx。
2146

被折叠的 条评论
为什么被折叠?



