安装
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