zoukankan      html  css  js  c++  java
  • 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

    5.开启防火墙80端口

    # 开放80端口

    firewall-cmd --permanent --add-port=80/tcp

     防火墙配置命令

    # 查询端口是否开放
    firewall-cmd --query-port=8080/tcp
    # 开放80端口
    firewall-cmd --permanent --add-port=80/tcp
    # 移除端口
    firewall-cmd --permanent --remove-port=8080/tcp
    #重启防火墙(修改配置后要重启防火墙)
    firewall-cmd --reload
    # 参数解释 1、firewall-cmd:是Linux提供的操作firewall的一个工具; 2、--permanent:表示设置为持久; 3、--add-port:标识添加的端口;

     防火墙配置引用链接 https://www.cnblogs.com/xxoome/p/7115614.html

    1、查看firewall服务状态

    systemctl status firewalld

    2、查看firewall的状态

    firewall-cmd --state

    3、开启、重启、关闭、firewalld.service服务

    # 开启
    service firewalld start
    # 重启
    service firewalld restart
    # 关闭
    service firewalld stop

    4、查看防火墙规则

    firewall-cmd --list-all
  • 相关阅读:
    es之零停机重新索引数据
    es之索引的别名操作
    es索引基本操作(2)之 索引映射(mappings)管理和索引库配置管理(settings)
    进程管理(八)-进程控制
    进程管理(七)-进程状态与转换
    进程管理(六)-进程的描述
    numpy数组转置与轴变换
    numpy数组的索引和切片
    numpy数组的运算
    numpy库中数组的数据类型
  • 原文地址:https://www.cnblogs.com/venje/p/10993563.html
Copyright © 2011-2022 走看看