AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 654021
Accepted
Yamen Nassif
Yamen Nassif
Asked: 2014-12-22 03:36:45 +0800 CST2014-12-22 03:36:45 +0800 CST 2014-12-22 03:36:45 +0800 CST

无法使用 nagios 和 nginx 访问 localhost

  • 772

我已经按照这个链接安装了 nagios,我已经启动并运行了 nginx。问题是我不断获取用户名和密码来进行身份验证。

当我删除 时auth_basic_user_file /etc/nagios/htpasswd.users;,我不会再收到该警报。但是这http://localhost/nagios给了我空白页。然后,当我使用 get that line back 时,我无法访问它。我什至尝试在这个线程中chown nagios /etc/nagios/htpasswd.users作为解决方案。

这是我的文件

htpasswd.users

yamen:NFy9PslWPh4Vo

我的网站

   server {
            server_name *********************************;
            access_log /var/log/nginx/access.log;
            error_log /var/log/nginx/error.log;
            auth_basic      "Yamen's Area!";
            auth_basic_user_file  /etc/nagios/htpasswd.users;
            root /home/yamen/repos/autoban-md/;
            index index.php index.html index.htm;
            #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            location / {
                    try_files $uri $uri/ /index.php;
            }
            location /nagios {
                    alias /opt/nagios/nagios/share;
            }
            location ~ ^/nagios/(.*\.php)$ {
                    alias /opt/nagios/nagios/share/$1;
                    include /etc/nginx/fastcgi_params;
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
            }
            location ~ \.cgi$ {
                    root /opt/nagios/nagios/sbin/;
                    rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break;
                    fastcgi_param AUTH_USER $remote_user;
                    fastcgi_param REMOTE_USER $remote_user;
                    include /etc/nginx/fastcgi_params;
                    fastcgi_pass unix:/var/run/fcgiwrap.socket;
            }
            error_page 404 /404.html;
            error_page 500 502 503 504 /50x.html;
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            location ~\.php$ {
                    try_files $uri =404;
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_index  index.php;
                    include fastcgi_params;
            }
            location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
                    add_header "" "";
            }
            location ~ "^/pagespeed_static/" { }
            location ~ "^/ngx_pagespeed_beacon$" { }
    }

nagios.conf不提供任何东西。

我把上面的用户名,一遍遍的通过,什么都没发生

感谢@PaulHaldane,我确实发现了错误,但仍然不知道为什么会发生。这是 nginx 错误日志。

*108 user "yamen": password mismatch, client: 127.0.0.1, server: *************
ubuntu
  • 1 1 个回答
  • 569 Views

1 个回答

  • Voted
  1. Best Answer
    Yamen Nassif
    2014-12-22T04:52:17+08:002014-12-22T04:52:17+08:00

    问题是我手动更改了 htpasswd.users。所以运行后

    htpasswd.py -c -b /etc/nagios/htpasswd.users yamen yamen
    

    问题消失了:)

    • 0

相关问题

  • 无法通过 Ubuntu VPN 访问外部网络

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

  • VirtualBox 上 Ubuntu 的访客优化技巧 [关闭]

  • 外部硬盘上的 virtualbox 虚拟硬盘驱动器(Vista 主机上的 ubuntu 客户机)

  • 如何在 Ubuntu 上挂载 LVM 分区?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve