nginx源码包:http://nginx.org/en/download.html

1.安装gcc gcc是用来编译下载下来的nginx源码

yum install gcc-c++

2、安装pcre和pcre-devel

PCRE(Perl Compatible Regular Expressions) 是一个Perl库,包括 perl 兼容的正则表达式库。
    nginx 的 http 模块使用 pcre 来解析正则表达式,pcre-devel 是使用 pcre 开发的一个二次开发库。

yum install -y pcre pcre-devel

3、安装zlib zlib提供了很多压缩和解方式,nginx需要zlib对http进行gzip

yum install -y zlib zlib-devel

4、安装openssl openssl是一个安全套接字层密码库,nginx要支持https,需要使用openssl

yum install -y openssl openssl-devel

5. 下载nginx

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

6.解压

tar -zxvf nginx-1.14.0.tar.gz -C  /usr/local

7. cd到文件路劲

cd /usr/local/nginx-1.14.0

8.编译

./configure --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/tem/nginx/client --http-proxy-temp-path=/var/tem/nginx/proxy --http-fastcgi-temp-path=/var/tem/nginx/fcgi --with-http_stub_status_module

9.安装

make && make install

10.启动

nginx -c /etc/nginx/nginx.conf

11. 如果出现[emerg] getpwnam("nginx") failed 错误 执行

useradd -s /sbin/nologin -M nginx
id nginx

12.如果出现 [emerg] mkdir() "/var/temp/nginx/client" failed (2: No such file or directory) 错误 执行

sudo mkdir -p /var/tem/nginx/client

13.如果您正在运行防火墙,请运行以下命令以允许HTTP和HTTPS通信:

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

14.nginx 重启

方法一:进入nginx可执行目录sbin下,输入命令./nginx -s reload 即可

whereis nginx #查找nginx文件目录
cd /usr/sbin/
./nginx -s reload

方法二:查找当前nginx进程号,然后输入命令:kill -HUP 进程号 实现重启nginx服务

ps -ef|grep nginx
kill -9 进程ID

15.nginx 配置文件检测

nginx -t -c /etc/nginx/nginx.conf

启动

cd /usr/sbin
./nginx -s stop
ps -ef|grep nginx
nginx -c /etc/nginx/nginx.conf

CentOS7 安装nginx-1.14.0的更多相关文章

  1. CentOS 7.4安装Nginx 1.14.0

    一.安装所需环境   1.gcc 安装         yum install gcc-c++    

  2. CentOS7 安装Nginx 1.14:

      nginx-1.14.2.tar.gz:下载:wget http://nginx.org/download/nginx-1.14.2.tar.gz 安装nginx:   yum  install  ...

  3. linux(centos7) 安装nginx

    linux(centos7) 安装nginx 1.14(stable) 版本 Nginx配置文件常见结构的从外到内依次是「http」「server」「location」等等,缺省的继承关系是从外到内, ...

  4. 【Nginx安装】CentOS7安装Nginx及配置

    [Nginx安装]CentOS7安装Nginx及配置 2018年03月05日 11:07:21 阅读数:7073 Nginx是一款轻量级的网页服务器.反向代理服务器.相较于Apache.lighttp ...

  5. centos7安装nginx(基础篇)

    安装所需环境 Nginx 是 C语言 开发,建议在 Linux 上运行,当然,也可以安装 Windows 版本,本篇则使用 CentOS 7 作为安装环境. 一. gcc 安装安装 nginx 需要先 ...

  6. 编译安装 nginx -1.14.2

    编译安装 nginx -1.14.2 1 ) 下载nginx-1.14.2 源码包: wget http://nginx.org/download/nginx-1.14.2.tar.gz 2 ) 编译 ...

  7. VMware虚拟机中的CentOS7安装Nginx后本机无法访问的解决办法

    VMware虚拟机中的CentOS7安装Nginx后本机无法访问的解决办法 在linux上安装nginx 请参考:Linux Centos7 安装 nginx 在虚拟机centos7上安装nginx之 ...

  8. Centos7 编译安装 Nginx Mariadb Asp.net Core2 (实测 笔记 Centos 7.3 + Openssl 1.1.0h + Mariadb 10.3.7 + Nginx 1.14.0 + Asp.net. Core 2 )

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...

  9. CentOS7.0安装Nginx 1.10.0

    首先由于nginx的一些模块依赖一些lib库,所以在安装nginx之前,必须先安装这些lib库,这些依赖库主要有g++.gcc.openssl-devel.pcre-devel和zlib-devel ...

  10. Centos7安装Nginx+PHP+MySQL

    之前曾经在服务器上从头到尾搭过一次环境,但那时新手一枚,很多地方搞不定,是前辈帮忙解决的.这次独自一人在服务器上撘环境,感慨上次没有做好相关笔记,所以事后整理一下,下次再搭环境时可以轻车熟路. 一.准 ...

随机推荐

  1. sed 常用命令 网址

    https://wangchujiang.com/linux-command/c/sed.html https://linux.cn/article-11367-1.html https://juej ...

  2. Transformer模型---encoder

    一.简介 论文链接:<Attention is all you need> 由google团队在2017年发表于NIPS,Transformer 是一种新的.基于 attention 机制 ...

  3. 201871010126 王亚涛《面向对象程序设计(Java)》第十二周学习总结

      内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p/ ...

  4. 【视频技术】EasyDarwin

  5. 03-numpy-笔记-expand_dims

    >>> x = np.array([[1,2,3],[4,5,6]]) >>> x.shape (2, 3) >>> np.expand_dims ...

  6. Spring Boot中以代码方式配置Tomcat

    在Spring Boot2.0以上配置嵌入式Servlet容器时EmbeddedServletContainerCustomizer类不存在,经网络查询发现被WebServerFactoryCusto ...

  7. 每天一道Rust-LeetCode(2019-06-10)

    每天一道Rust-LeetCode(2019-06-02) Z 字形变换 坚持每天一道题,刷题学习Rust. 题目描述 https://leetcode-cn.com/problems/simplif ...

  8. 9.第一个vue-cli项目

    1.什么是vue-cli vue-cli 官方提供的一个脚手架,用于快速生成一个 vue 的项目模板; 预先定义好的目录结构及基础代码,就好比咱们在创建 Maven 项目时可以选择创建一个骨架项目,这 ...

  9. 11/4 <LinkedList>

    82. Remove Duplicates from Sorted List II 跳过重复节点,返回head. class Solution { public ListNode deleteDupl ...

  10. 8.9 NOIP模拟测试15 建设城市(city)+轰炸行动(bomb)+石头剪刀布(rps)

    鉴于T3的惨烈程度,我决定先来颓篇题解. T1 建设城市(city) 挡板法+容斥 m个建设队分成n组,每组必须有一个,先不考虑上限,共有 C(m-1,n-1)种方案. 有i个组是超过k个的,容斥掉 ...