Linux下源码编译安装Nginx

操作系统:Centos

下载源码包

http://nginx.org/en/download.html

解压

# tar -zxvf nginx-1.12.2.tar.gz 

编译安装

# cd nginx-1.12.2

指定安装路径及添加SSL模块功能

# ./configure --prefix=/usr/local/nginx --with-http_ssl_module

可能出现的问题:

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

    安装pcre-devel

 # yum install pcre-devel

    ./configure: error: SSL modules require the OpenSSL library.

    安装openssl-devel

# yum install openssl-devel

编译安装

# make && make install  


posted @ 2018-04-17 16:40  还是搬砖踏实  阅读(255)  评论(0编辑  收藏  举报