02.nginx安装

  1. 下载地址 http://nginx.org/en/download.html
  2. 选择下载Stable version
  3. 上传到服务器
  4. 解压到安装目录并删除压缩包
  5. 尝试编译nginx,先进入到ngixn目录
cd /opt/nginx1.61
./configure --prefix=/opt/nginx
  1. 编译肯定不通过,需要安装相关的依赖,安装依赖(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
  1. 安装
make install
发布了38 篇原创文章 · 获赞 14 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/qq_32257215/article/details/104059316
今日推荐