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 ...
随机推荐
- Verilog语言
for循环应用 1.复位寄存器组 例如有32个寄存器,需要异步复位 always@(posedge clk or negedge rst_n) begin if (rst_n == 1'b0) beg ...
- java 英文单词拼写纠正框架(Word Checker)
Word Checker 本项目用于单词拼写检查. 项目简介 word checker 用于单词拼写检查. Github 地址 特性说明 支持 i18n 错误提示支持 i18N 支持英文的单词纠错 可 ...
- Android 开发 View的API 转载
转载地址:https://blog.csdn.net/lemonrabbit1987/article/details/47704679 View类代表用户界面组件的基本构建块.一个View占据屏幕上的 ...
- javascript 数组的简单应用
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- python———day03
一.字符串格式化输出: 占位符 %s(字符串) %d(整数) %f(浮点数,约等于小数) name = input("Name:") age = input("Ag ...
- json jmespath的使用
在接口测试的过程中,我们经常会接触到json格式respones,我们会经常去做取JSON中某个值的操作,可以用jmespath分析.转换和选择性的提取JSON数据进行操作,功能非常强大,易读. 一. ...
- frist Django app — 五、Test
Test——很重要但是没有被重视起来的一个环节,至少是我自己,其实自己之前在做java web的时候就去尝试过怎么做REST接口的测试,一直没有找到一种合适方式,而且因为时间紧没有进一步深究,但是造成 ...
- 搭建rancher节点
1.centos 7.5 64 2.安装docker systemctl restart docker.service 注意:重启后才有 /etc/docker/文件夹 切换到这文件夹下再增加对应的d ...
- Excle批量导入到mysql调查
1.使用navicat Premium 导入时候提示打不开.问题的链接如下: https://blog.csdn.net/wsyzxss/article/details/77864313 2.只能使用 ...
- MySql:SELECT 语句(六) CONCAT() 函数的使用
一.计算字段 为什么要用计算字段? 1)想要在一个字段中既显示公司地址,又显示公司名称,但是往往这两个都不在一个字段中 2)列数据是大小写混合的,但是报表程序需要把他们全部按大写形式展示出来 3)需要 ...