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/

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

  • 相关阅读:
    Android 拍照 代码实例
    利用Android手机里的摄像头进行拍照
    看视频时,类加载器没太理解,现在再整理下几个要点
    关于java设计模式与极品飞车游戏的思考
    【Mood-3】心声
    源自梦想 eclipse快捷键整理
    2020重新出发,JAVA语言,JAVA的诞生和发展史
    2020重新出发,序章: 语言的诞生
    2020重新出发,JAVA学前了解,DOS常用命令
    2020重新出发,JAVA学前了解,Windosws常用快捷键
  • 原文地址:https://www.cnblogs.com/zgqbky/p/12197027.html
Copyright © 2011-2022 走看看