centos7下编译安装nginx-1.16.0
一、下载nginx源码
http://nginx.org/en/download.html
如:nginx-1.16.0.tar.gz
二、创建用户和组,并解压
groupadd www
useradd -g www www
tar xf nginx-1.16.0.tar.gz
三、下载openssl,编译高版本openssl
https://www.openssl.org/source/
如:openssl-1.0.2r.tar.gz
tar xf openssl-1.0.2r.tar.gz
四、编译安装nginx
cd nginx-1.16.0 ./configure --prefix=/data/nmp/nginx \
--user=www \
--group=www \
--with-pcre \
--with-openssl=/data/openssl-1.0.2r \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-http_image_filter_module \
--with-http_slice_module \
--with-mail \
--with-threads \
--with-file-aio \
--with-stream \
--with-mail_ssl_module \
--with-stream_ssl_module \
--with-openssl 的路径设置为第3步中openssl源码解压路径。
上面的有些模块大家可以按需安装。
make -j8 && make install
五、配置systemd服务
创建 nginx.service 文件
vi /usr/lib/systemd/system/nginx.service [Unit]
Description=The nginx HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target [Service]
Type=forking
ExecStartPre=/data/nmp/nginx/sbin/nginx -t
ExecStart=/data/nmp/nginx/sbin/nginx -c /data/nmp/nginx/conf/nginx.conf
ExecReload=/data/nmp/nginx/sbin/nginx -s reload
ExecStop=/data/nmp/nginx/sbin/nginx -s stop
PrivateTmp=true [Install]
WantedBy=multi-user.target
启用 nginx.service
systemctl enable nginx.service
启动 nginx
systemctl start nginx.service
六、设置firewalld防火墙,开放80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
centos7下编译安装nginx-1.16.0的更多相关文章
- CentOS 6.5 下编译安装 Nginx 1.8.0
转自:https://i.cnblogs.com/EditPosts.aspx?postid=8303227&update=1 安装编译依赖的包 yum -y install gcc gcc- ...
- Centos7下编译安装php扩展redis5.0.2
安装环境:centos7 + php 7.2.191. 下载地址:http://pecl.php.net/get/redis-5.0.2.tgz .tgz http://pecl.php.net/ge ...
- centos7下编译安装php-7.0.15(PHP-FPM)
centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...
- CentOS7下编译安装redis-5.0.9
CentOS7下编译安装redis-5.0.9 本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权 下载redis #code start wget https ...
- ubuntu14.04下编译安装ambari-2.4.2.0
ubuntu14.04下编译安装ambari-2.4.2.0 编译前的准备工作 准备工作有: 系统参数 系统依赖(编译环境) 离线安装包 java环境 maven环境 Nodejs环境 git环境 a ...
- Ubuntu 16.04源码编译安装nginx 1.10.0
一.下载相关的依赖库 pcre 下载地址 http://120.52.73.43/jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.t ...
- 在CentOS 7下编译安装Nginx+PHP+MySQL环境
本文转载自:http://www.softeng.cn/?p=156,本文已获得作者授权,未经作者同意,不可转载. 1.前言 本文适合于已经对Linux操作系统具有基本操作经验,并且能够在Linux或 ...
- linux下编译安装nginx
1.首先下载稳定版nginx1.10.2 使用wget命令下载 wget http://nginx.org/download/nginx-1.10.2.tar.gz 2.然后解压 tar -zxvf ...
- centos7 下 yum 安装Nginx
centos7 下 yum 安装和配置 Nginx 添加yum源 Nginx不在默认的yum源中,可以使用epel或者官网的yum源,这里使用官网的yum源 rpm -ivh http://nginx ...
随机推荐
- Python课程第四天作业
1.定义一个函数,该函数可以实现控制台输入,最终返回一个int类型的正整数 def chr_to_int(): user_input = input('请输您要转换的字符串:') if user_in ...
- CentOS7下安装Redis5.0.2
1.下载redis 地址 http://download.redis.io/releases/redis-5.0.2.tar.gz 2.解压tar -zxf redis-5.0.2.tar.gz 3. ...
- (Python基础)字典的使用
以下代码是字典的查,增,改,删的基本使用方法. #-*-coding:utf-8-*- _author_: Keep #字典是无序的 info = { ':'张飞', ':'刘备', ':'关羽' ...
- DLC 格雷码
格雷码特点 每相邻两个数,只会有一位发生变(二进制数) 异或运算 若两个运算数相同,结果为 0 若两个运算数不相同, 结果为 1
- 安装FrameWork后重新注册IIS
IIS和.netfw4.0安装顺序是从前到后,如果不小心颠倒了,无所谓. 打开程序-运行-cmd:输入一下命令重新注册IIS C:\WINDOWS\Microsoft.NET\Framework\v4 ...
- spring boot 入门(一)
转自构建微服务:Spring boot 入门篇 什么是spring boot Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程. ...
- centos7安装svn
摘抄自http://blog.csdn.net/junehappylove/article/details/65963025 1.安装 sudo yum install subversion 查看安装 ...
- HTML5 动画用 animation transform transition 做的两个例子
1,左右移动,自我翻转的圆 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- Linux命令:let
语法 let expr [expr ...] 说明 计算c的算术表达式.详细说明请参考<Bash参考指南-6.5 shell算术运算>
- node.js异步编程的几种模式
Node.js异步编程的几种模式 以读取文件为例: 1.callback function const fs = require('fs'); //callback function fs.readF ...