centoos7下nginx安装

1.下载地址 http://nginx.org/en/download.html
2.选择下载Stable version
3.上传到服务器
4.解压到安装目录并删除压缩包
5.尝试编译nginx,先进入到ngixn目录

cd /opt/nginx1.61
./configure --prefix=/opt/nginx

6.编译肯定不通过,需要安装相关的依赖,安装依赖(centos7.6)

==./configure: error: the HTTP rewrite module requires the PCRE library.==

yum install -y pcre pcre-devel 

==./configure: error: the HTTP gzip module requires the zlib library.==

yum install -y zlib zlib-devel 

建议再安装下ssl的库依赖

yum install -y openssl openssl-devel

总的来说就是

yum install -y pcre  pcre-devel zlib zlib-devel openssl openssl-devel

在当前文件夹下会生成一个Makefile文件
7.编译

make

8.安装

make install

猜你喜欢

转载自www.cnblogs.com/jenkins/p/12228550.html
今日推荐