zoukankan      html  css  js  c++  java
  • nginx用yum安装做443加密网站

    1.前期准备

    关闭防火墙和selinux

    [root@vip ~]# iptables -F && setenforce 0 && systemctl stop firewalld

    2.安装依赖包

    [root@vip ~]# yum -y install gcc pcre-devel openssl-devel

    [root@vip ~]# yum -y install epel-release

    安装nginx

    [root@vip ~]# yum -y install nginx

    设置nginx开机自启

    [root@vip ~]# systemctl enable nginx

    知识扩展:

    nginx常用命令

    [root@vip ~]# systemctl start nginx.service                 #启动nginx

    [root@vip ~]# systemctl stop nginx             #停止nginx

    [root@vip ~]# systemctl enable nginx        #开机自启

    [root@vip ~]# systemctl restart nginx.service         #重启nginx

    配置路径:/etc/nginx/

    日志路径:/var/log/nginx

    3.打开配置文件

    [root@vip ~]# vim /etc/nginx/nginx.conf

        server {
            listen       443;
            server_name  localhost;
            ssl on;
            root         /usr/share/nginx/html;

            ssl_certificate "/root/3309085_cszc.top.pem";
            ssl_certificate_key "/root/3309085_cszc.top.key";
            ssl_session_cache shared:SSL:1m;
            ssl_session_timeout  10m;
            ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_prefer_server_ciphers on;

            # Load configuration files for the default server block.
            include /etc/nginx/default.d/*.conf;

            location / {
                    proxy_buffer_size  128k;
                    proxy_buffers   32 32k;
                    proxy_busy_buffers_size 128k;
            }

        }
    }

    4.然后启动nginx

    [root@vip ~]# systemctl start nginx.service

    启动成功之后打开浏览器输入:https://192.168.175.200/

    总结:。。。。。。。。。。此处省略一万字

  • 相关阅读:
    【BZOJ2434】[NOI2011]阿狸的打字机 AC自动机+DFS序+树状数组
    【BZOJ1030】[JSOI2007]文本生成器 AC自动机+动态规划
    【BZOJ3943】[Usaco2015 Feb]SuperBull 最大生成树
    【BZOJ3940】【BZOJ3942】[Usaco2015 Feb]Censoring AC自动机/KMP/hash+栈
    【BZOJ3172】[Tjoi2013]单词 AC自动机
    【HDU2896】病毒侵袭 AC自动机
    【HDU2222】Keywords Search AC自动机
    【BZOJ1662】[Usaco2006 Nov]Round Numbers 圆环数 数位DP
    结婚晚了
    无毒食品
  • 原文地址:https://www.cnblogs.com/zgqbky/p/12197027.html
Copyright © 2011-2022 走看看