您的位置:首页 > 运维架构 > Nginx

nginx+ apache htpassword实现kibana的密码登录验证

2016-06-30 20:07 579 查看
1.1.安装pcre
1.         获取pcre编译安装包,在http://www.pcre.org/上可以获取当前最新的版本
2.         解压缩pcre-xx.tar.gz包。
3.         进入解压缩目录,执行./configure。
4.         make & make install
5、yum installpcre-devel
注意如果系统没装GCC插件的时候回报错:no acceptable C compiler found in $PATH
yum install gcc
yum install -y gccgcc-c++
请使用 prce8.38最新版本报错 
是个坑
1.2.安装openssl
1.         获取openssl编译安装包,在http://www.openssl.org/source/上可以获取当前最新的版本。
2.         解压缩openssl-xx.tar.gz包。
3.         进入解压缩目录,执行./config。
4.         make & make install
5、yum install pcre-devel

 
1.3.安装zlib
1.         获取zlib编译安装包,在http://www.zlib.net/上可以获取当前最新的版本。
2.         解压缩openssl-xx.tar.gz包。
3.         进入解压缩目录,执行./configure。
4.         make & make install

1.4.安装nginx

1.         获取nginx,在http://nginx.org/en/download.html上可以获取当前最新的版本。

2.         解压缩nginx-xx.tar.gz包。

3.         进入解压缩目录,执行./configure --with-pcre=/usr/local/nginx/pcre2-10.20--with-zlib=/usr/local/nginx/zlib-1.2.8--with-openssl=/usr/local/nginx/openssl-1.0.2h--with-http_stub_status_module --with-http_ssl_module

4.         make &make install

5、启动sbin/nginx-c conf/mynginx.conf

 

 

1.5.apache anth模块安装

1、yuminstall httpd

2、htpasswd-c /usr/local/nginx/db/passwd.db thunder

3、修改ngnix.conf文件:

server {

        listen       80;

        server_name  10.10.45.60;

        location / {

                auth_basic "secret";

                auth_basic_user_file/usr/local/nginx/db/passwd.db;

                proxy_pass http://10.10.45.60:5601;
                proxy_set_header Host$host:5601;

                proxy_set_header X-Real-IP$remote_addr;

                proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_set_header Via"nginx";

        }

    }

4、启动sbin/nginx-c conf/mynginx.conf

5、停止ngnix:pkill -9 nginx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: