centos7 从源码安装nginx

1.下载源码

建立目录下载源码并解压

mkdir nginx_src

cd nginx_src

wget http://nginx.org/download/nginx-1.17.0.tar.gz

 tar -xf nginx-1.17.0.tar.gz

因要开启ssl支持,邮件服务器功能,需要提前安装OpenSSL库

2.配置指定/nginx安装目录及开启ssl,邮件模块 生成Makefile,编译 安装

cd nginx-1.17.0/

./configure --prefix=/nginx --with-http_ssl_module --with-mail --with-mail_ssl_module

make

make install

3检查安装/nginx

[root@localhost nginx]# ./sbin/nginx -V
nginx version: nginx/1.17.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/nginx --with-http_ssl_module --with-mail --with-mail_ssl_module

4根据需要配置/nginx/conf/nginx.conf启动

./sbin/nginx

猜你喜欢

转载自www.cnblogs.com/venje/p/10993563.html