zoukankan      html  css  js  c++  java
  • nginx安装

    1、yum install gcc gcc-c++

    2、tar -jxvf jemalloc-5.2.1.tar.bz2

    3、cd jemalloc-5.2.1

    4、./configure --prefix=/usr/local/jemalloc

    make

    make install

    5、yum install openssl openssl-devel -y

    6、./configure --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --prefix=/usr/local/nginx --with-jemalloc=/usr/local/jemalloc-5.2.1 --with-stream --add-module=./modules/ngx_http_upstream_check_module/  --without-http_rewrite_module

    7、

    make

    make install

    8、

    vim /usr/local/nginx/conf/nginx.conf

    添加下方配置

      upstream mspp {

            server 192.168.10.253:8080;

            server 192.168.10.252:8080;

            server 192.168.10.133:8080;

            check interval=3000 rise=2 fall=5 timeout=1000 type=http;

            check_http_send "HEAD / HTTP/1.0 ";

            check_http_expect_alive http_2xx http_3xx;

        }

        server {

            listen       80;

            server_name  localhost

             location / {

                proxy_pass http://mspp;

            }

              location /status {

                check_status;

                access_log   off;

                #allow SOME.IP.ADD.RESS;

                #deny all;

            }

    error_page   500 503 504  /50x.html;

    location = /50x.html {

                root   html;

            }

            error_page 502 /502;

            location = /502 {

                default_type application/json;

                    add_header Content-Type 'text/html; charset=utf-8';

                    return 200 '{"code":"6666,"msg":"服务正在维护中,请稍后再试!"}';

            }

     }

    启动服务

    sbin/nginx -c conf/nginx.conf

  • 相关阅读:
    forever让nodejs应用后台执行
    CentOS 程序开机自启动方法总结
    Centos7下配置Redis开机自启动
    Centos 关闭后台进程 .sh 等
    unity htc vive使用
    Linux登录验证机制、SSH Bruteforce Login学习
    Aho-Corasick算法、多模正则匹配、Snort入门学习
    The Honeynet ProjectThe Honeynet Project
    DEDECMS数据库执行原理、CMS代码层SQL注入防御思路
    PHP内核源代码、PHP Zend扩展、API Hook学习笔记
  • 原文地址:https://www.cnblogs.com/bzdmz/p/11526028.html
Copyright © 2011-2022 走看看