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 / 问题

问题[http-status-code-403](server)

Martin Hope
Nate Levin
Asked: 2023-12-19 07:39:22 +0800 CST

从所有 Google 端点获取 403

  • 5

我运行一个网站,让用户通过谷歌登录他们的帐户。一年多以来,一切都运行良好 - 直到几天前,当服务器尝试访问任何 OAuth 证书列表 API 端点时,Google 开始抛出 403 错误。

例如:

$ curl 'https://www.googleapis.com/oauth2/v1/certs'
...
<p><b>403.</b> <ins>That’s an error.</ins>
  <p>Your client does not have permission to get URL <code>/oauth2/v3/certs</code> from this server.  <ins>That’s all we know.</ins>
...

这个请求在我尝试过的所有其他服务器上都运行良好,并且运行了很多年。我不知道为什么会突然发生这种情况。

该服务器拥有自己的 IP,但托管在一家小型的、无名的 VPS 提供商上。我最初的想法是限制速率,但我添加了日志,但没有看到发出很多请求。我唯一能想到的另一件事是 IP 地址声誉问题,因为地址与滥用者很接近?不确定如何/是否可以解决。

关于如何修复/调试这个问题有什么想法吗?任何帮助将不胜感激!

http-status-code-403
  • 1 个回答
  • 90 Views
Martin Hope
Laughing Laugh wwwwwww
Asked: 2021-12-08 01:52:38 +0800 CST

无法访问我的网站

  • 0

每个人!我是 linux 爱好者,我对 debian VPS 上的 nginx 有疑问。直到最近我可以访问我的静态网站,但现在我不能。

这是我的用户名sites-available/example在哪里example:

server {
        listen 80 ;
        listen [::]:80 ;
        server_name example.com ;
        root /var/www/example ;
        index index.html index.htm index.nginx-debian.html ;
        location / {
                try_files $uri $uri/ =404 ;
        }
}

sites-available/example有符号链接sites-enabled

我的nginx/error.log:

2021/12/07 08:57:02 [notice] 7383#7383: signal process started
2021/12/07 09:22:00 [notice] 2195#2195: signal process started

在signal process started我遇到 403 或 404 错误之前:

2021/12/05 17:53:05 [emerg] 12400#12400: open() "/etc/nginx/sites-enabled/mail" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
2021/12/05 17:55:01 [emerg] 12415#12415: open() "/etc/nginx/sites-enabled/mail" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
2021/12/05 18:02:33 [emerg] 12468#12468: open() "/etc/nginx/sites-enabled/mail" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
2021/12/05 18:05:15 [error] 12522#12522: *1 directory index of "/var/www/mail/" is forbidden, client: 212.16.10.194, server: mail.example.com, request: "GET / HTTP/1.1", host: "example.com"
2021/12/05 18:07:45 [error] 12562#12562: *1 directory index of "/var/www/mail/" is forbidden, client: 212.16.10.194, server: mail.example.com, request: "GET / HTTP/1.1", host: "example.com"

我什至重新安装了 nginx,但我仍然无法访问我的网站。我应该怎么做或在哪里搜索信息来解决这个问题?

sudo ss -tnlp|grep :80显示了这一点:

LISTEN 0 128 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=2524,fd=6),("nginx",pid=2522,fd=6))

LISTEN 0 128 [::]:80 [::]:* users:(("nginx",pid=2524,fd=7),("nginx",pid=2522,fd=7))

debian nginx http-status-code-404 http-status-code-403
  • 1 个回答
  • 188 Views
Martin Hope
Raul Chiarella
Asked: 2021-10-14 06:02:12 +0800 CST

访问 Apache 上的服务器状态时被禁止(403)[重复]

  • 0
这个问题在这里已经有了答案:
禁止(403),在访问 apache 2.2.22 上的服务器状态时 (3 个答案)
10 个月前关闭。

我正在尝试访问 Apache server-status?auto 但它给了我 Forbidden 403 消息

我检查了 apache2.conf 并且在 html 目录下有这个选项:

<Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

有没有人遇到过这个问题并且能够解决它?提前致谢。如果您需要更多信息,请与我们联系...

PS:我已经尝试过 Shahar Galukman 提出的建议问题的解决方案,但那里的答案对我没有帮助,或者我不够聪明,无法理解。

谢谢你的耐心

apache-2.2 virtualhost http-status-code-403
  • 1 个回答
  • 653 Views
Martin Hope
ihorc
Asked: 2021-08-28 23:43:05 +0800 CST

Nginx 将错误日志条目写入 access.log

  • 2

我正在尝试为来自 Nginx 的 403 错误配置 fail2ban。但由于某种原因,我的 error.log 文件为空,所有 403(以及所有 4XX、5XX)错误都将进入 access.log。但是,我检查了我的配置,它看起来不错。

server {
    listen 80;
    server_name example.com;

    return 301 https://$host$request_uri;
}

server {
    listen 443;
    server_name example.com;

    access_log  /var/log/nginx/example.com/access.log;
    error_log   /var/log/nginx/example.com/error.log;

    ssl on;
    include /etc/nginx/conf.d/letsencrypt;
    include /etc/nginx/conf.d/verify-client;

    location / {
        include /etc/nginx/conf.d/403-if-not-verified;

        proxy_pass http://...;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;

        proxy_redirect off;
    }

    location ^~ /.well-known {
        root /usr/share/nginx/html/;
        allow all;
    }
}

结果:

root@raspberrypi:/var/log/nginx/example.com# ls -la
total 12
drwxr-xr-x  2 www-data adm 4096 Aug 28 09:55 .
drwxr-xr-x 12 www-data adm 4096 Aug 28 08:53 ..
-rw-r--r--  1 www-data adm 1417 Aug 28 09:55 access.log
-rw-r--r--  1 www-data adm    0 Aug 28 09:55 error.log

访问日志:

192.168.1.1 - - [28/Aug/2021:09:46:29 +0300] "GET / HTTP/1.1" 403 135 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"
192.168.1.1 - - [28/Aug/2021:09:49:53 +0300] "GET / HTTP/1.1" 403 135 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"
192.168.1.1 - - [28/Aug/2021:09:50:53 +0300] "GET / HTTP/1.1" 403 135 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"
192.168.1.1 - - [28/Aug/2021:09:52:02 +0300] "GET / HTTP/1.1" 403 135 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"
192.168.1.1 - - [28/Aug/2021:09:52:30 +0300] "GET / HTTP/1.1" 403 135 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"

所有包含配置只包含与证书相关的内容,与日志记录无关。

更新。另外,我尝试将error_log指令放在/位置内,但没有任何改变。

更新2。尝试将日志级别更改为调试,得到了这个:

2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL ALPN supported by client: h2
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL ALPN supported by client: http/1.1
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL ALPN selected: http/1.1
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL_do_handshake: -1
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL_get_error: 2
2021/08/28 11:07:32 [debug] 10257#10257: *134281 reusable connection: 0
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL handshake handler: 0
2021/08/28 11:07:32 [debug] 10257#10257: *134281 ssl new session: 95794EF3:32:165
2021/08/28 11:07:32 [debug] 10257#10257: *134281 ssl new session: 05E7BF5A:32:166
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL_do_handshake: 1
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL: TLSv1.3, cipher: "TLS_AES_128_GCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESGCM(128) Mac=AEAD"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 reusable connection: 1
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http wait request handler
2021/08/28 11:07:32 [debug] 10257#10257: *134281 posix_memalign: 01341900:256 @16
2021/08/28 11:07:32 [debug] 10257#10257: *134281 malloc: 012C1660:1024
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL_read: 464
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL_read: -1
2021/08/28 11:07:32 [debug] 10257#10257: *134281 SSL_get_error: 2
2021/08/28 11:07:32 [debug] 10257#10257: *134281 reusable connection: 0
2021/08/28 11:07:32 [debug] 10257#10257: *134281 posix_memalign: 013043B0:4096 @16
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http process request line
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http request line: "GET / HTTP/1.1"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http uri: "/"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http args: ""
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http exten: ""
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http process request header line
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Host: example.com"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Accept-Language: en-US,en;q=0.5"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Accept-Encoding: gzip, deflate, br"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Connection: keep-alive"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Upgrade-Insecure-Requests: 1"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Sec-Fetch-Dest: document"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Sec-Fetch-Mode: navigate"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Sec-Fetch-Site: none"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Sec-Fetch-User: ?1"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header: "Cache-Control: max-age=0"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 http header done
2021/08/28 11:07:32 [debug] 10257#10257: *134281 event timer del: 3: 215143200
2021/08/28 11:07:32 [debug] 10257#10257: *134281 generic phase: 0
2021/08/28 11:07:32 [debug] 10257#10257: *134281 rewrite phase: 1
2021/08/28 11:07:32 [debug] 10257#10257: *134281 test location: "/"
2021/08/28 11:07:32 [debug] 10257#10257: *134281 using configuration "/"

更新3。两个日志文件的权限是相同的,所以就可以了。

logging nginx http-status-code-403
  • 1 个回答
  • 644 Views
Martin Hope
Johnnii360
Asked: 2021-04-16 01:18:39 +0800 CST

fail2ban 奇怪的禁令行为禁止不正确的 IP

  • 1

我试图通过fail2ban 禁止所有可疑的403 错误。

所以我创造了这个监狱

# block 403 errors
[apache-403]
enabled = true
filter = apache-403
port = http,https
logpath = /var/log/apache2/other_vhosts_access.log
bantime = 3600
maxretry = 5
ignoreip = 127.0.0.1/8 37.4.226.100

使用此过滤器规则

failregex = <HOST> .* "(GET|POST|HEAD) .* HTTP/1\.[01]" 403 .*

现在我检查fail2ban-client status apache-403了监狱并得到了这个

Status for the jail: apache-403
|- Filter
|  |- Currently failed: 0
|  |- Total failed: 51
|  `- File list:    /var/log/apache2/other_vhosts_access.log
`- Actions
   |- Currently banned: 1
   |- Total banned: 1
   `- Banned IP list:   de:443

但是 de:443 不是 IP……那么问题出在哪里?

特定的日志行如下所示:

jotoma.de:443 45.133.192.140 - - [15/Apr/2021:01:42:42 +0200] "POST /wp-login.php HTTP/1.1" 403 10297 "-" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G610M Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36 Instagram 41.0.0.13.92 Android (23/6.0.1; 480dpi; 1080x1920; samsung; SM-G610M; on7xelte; samsungexynos7870; pt_BR; 103516666)"

我现在必须做什么来纠正它?在让这个过滤规则起作用之前我遇到了一个大问题,但现在它起作用了,但似乎是错误的。

linux debian apache-2.2 fail2ban http-status-code-403
  • 2 个回答
  • 104 Views
Martin Hope
Louis Sayers
Asked: 2020-12-02 20:29:54 +0800 CST

在使用 GCP 负载均衡器配置 IAP 的情况下,如何从 HTTP 重定向到 HTTPS?

  • 1

我目前有一个托管在 Google Compute Engine 上的网站,该网站通过位于负载均衡器后面的 Identity-Aware-Proxy 进行了身份验证。这一切都适用于 https,但我想确保 http 重定向到 https,因为它目前只响应 404。

因此,我遵循了https://cloud.google.com/load-balancing/docs/https/setting-up-http-https-redirect,它告诉您设置第二个负载均衡器以将 http 流量重定向到 https。

但是,问题是,按照这些说明操作后,当我浏览到http://my-website.com时,我收到以下错误:

错误 403(禁止)!!1

  1. 那是一个错误。

您的客户端无权从此服务器获取 URL /。我们知道的就这些。

尽管 http 负载均衡器设置了 301 - 永久移动完整路径重定向,但在浏览器开发人员工具网络选项卡中没有发生重定向。它只是立即以 403 响应。URL 也使用 http:// 方案。


总而言之,我的设置如下所示:

外部 HTTPS 负载均衡器

  • 前端 - HTTPS、静态 IP、仅限 HTTPS
  • 后端 - Identity-Aware-Proxy(通过 Identity Platform 进行电子邮件身份验证)-> Compute Engine 实例组

外部 HTTP 负载均衡器

  • 前端 - HTTP,静态 IP(与上面的 HTTPS 负载均衡器相同)
  • 后端 - 无
  • 主机和路径规则:
    • 模式:高级主机和路径规则(URL 重定向、URL 重写)
    • 行动:将客户端重定向到不同的主机/路径
    • 主机重定向: https ://my-website.com
    • 路径值: *
    • 重定向响应代码: 301 - 永久移动
    • HTTPS 重定向:已启用

任何想法如何解决这个问题,而不是得到 403 将不胜感激!

http https http-status-code-403 google-cloud-http-load-balancer
  • 1 个回答
  • 982 Views
Martin Hope
pigeonburger
Asked: 2020-10-09 19:56:38 +0800 CST

为什么我的网络服务器在尝试使用 HTTPS 时会抛出 403 Forbidden?

  • 1

我希望安全地为我的 Web 服务器上的流量提供服务。我正在运行 Ubuntu 服务器 20.04 ,它具有对使用证书Abyss Web Server的本机支持。Let's Encrypt

我完全按照他们网站上的所有说明进行操作,但是之后尝试访问它时,它只会给出 403 错误。切换回 http 时,没有任何问题 - 我可以完美地访问该站点。当从 https 切换到 http 时,我唯一要更改的是下拉框,上面写着protocol(见下图)然后重新启动服务器。

443 显然在我的计算机和路由器上打开(否则我只会收到超时响应)

生成 LE 证书时没有遇到任何问题。控制台显示一切都很好,但实际上并非如此。

我所有的网络流量在到达我之前都经过 Cloudflare - 这可能是导致问题的原因吗?如果是这样,我会坚持使用 Cloudflare 的 http,因为它们提供了额外的安全性,但这听起来像是我的电脑出了问题 - 有些东西不允许 https 请求实际访问该网站。


Cloudflare 自己提供了一些加密,但这只是在用户代理和 Cloudflare 服务器之间 - Cloudflare 和原始服务器之间没有。我想要端到端加密。

所以当你访问我的网站时,它会说https,但这只是用户和 Cloudflare 之间的 - 我的服务器和 Cloudflare 之间的流量仍然是端口 80 上的普通 http。


为了证明我正确地遵循了说明,以下是我的网站在主控制台中的主要设置(使用我的主机名):

在此处输入图像描述

可能是我不知道的计算机上的某些规则吗?我认为这是一个服务器端问题,与 cloudflare 无关。文档路径htdocs/从未更改,并且不在需要提升权限才能访问我的计算机的位置。就像我之前说的 - 当我在端口 80 上切换回 http 时,一切正常。我没有改变其他任何东西。

目前,我刚刚将我的网站切换回 http 以便可以访问,直到(希望)这个问题能够得到解决。

更新:

绕过 Cloudflare 的代理带来了相同的结果 - 403 禁止。

为了提供一些可能有帮助的额外信息,这里是我的 DNS 记录(敏感信息被划掉):

在此处输入图像描述

我的Let's Encrypt证书现在也已经过完全验证,所以它一定是权限或主机名问题。

linux ubuntu networking ssl http-status-code-403
  • 1 个回答
  • 979 Views
Martin Hope
Kaspacainoombro
Asked: 2020-06-21 22:19:23 +0800 CST

ModSecurity 阻止合法的客户端请求

  • 1

随机地,modsecurity 会阻止合法客户端请求,给出错误 403。这是 modsec_audit.log 的段落:

    ---d6e99f36-A--
[21/Jun/2020:07:14:45 +0100] Xu761X8AAAEAADI1YrAAAABQ xxx.xxx.xxx.xxx 60036 xxx.xxx.xxx.xxx 443
--d6e99f36-B--
GET /s/p.json?eyJ0IjoyLjksImYiOnsiZmxpX3BsIjoiYXNwZXJzb3IiLCJmbGlfZyI6LTEsImZsaV9jIjotMSwiZmxpX20iOjAsImZsaV9hIjoyMDE1fSwiY3NyZiI6ImE5MDMwMDkxLTBlZjg$
Host: fneon.eu
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0
Accept: */*
Accept-Language: pt-PT,pt;q=0.8,en;q=0.5,en-US;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://example.com/
Content-Type: application/json,charset=UTF-8
DNT: 1
Connection: keep-alive
Cookie: jwt=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyYzMwOGQwYTc5NGEyZWU2MjMxYzI2M2EyYWMzNjkwMCIsImV4cCI6MTU5MzY0NDQwMCwiaWF0IjoxNTkyNzE5ODg1$
Pragma: no-cache
Cache-Control: no-cache

--d6e99f36-F--
HTTP/1.1 403 Forbidden
X-FRAME-OPTIONS: DENY
X-Content-Type-Options: nosniff
Content-Length: 199
Keep-Alive: timeout=5, max=89
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1

--d6e99f36-E--
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
</body></html>

--d6e99f36-H--
Apache-Error: [file "mod_evasive20.c"] [line 259] [level 3] client denied by server configuration: %s
Apache-Handler: proxy-server
Stopwatch: 1592720085355364 815 (- - -)
Stopwatch2: 1592720085355364 815; combined=42, p1=35, p2=0, p3=1, p4=0, p5=5, sr=0, sw=1, l=0, gc=0
Response-Body-Transformed: Dechunked
Producer: ModSecurity for Apache/2.9.0 (http://www.modsecurity.org/).
Server: Apache
Engine-Mode: "ENABLED"

--d6e99f36-Z--

这是我的配置(仅更改):

/etc/modsecurity/modsecurity.conf

SecRuleEngine On 
SecResponseBodyAccess Off 
SecRequestBodyLimit 5242880 (15Mb)

/etc/apache2/mods-enabled/evasive.conf
<IfModule mod_evasive20.c>
    DOSHashTableSize    3097
    DOSPageCount        10
    DOSSiteCount        75
    DOSPageInterval     5
    DOSSiteInterval     1
    DOSBlockingPeriod   3000
    DOSWhitelist 127.0.0.1 
    DOSWhitelist xxx.xxx.xxx.xxx 
    DOSWhitelist  xxx.xxx.xxx.xxx 
    DOSWhitelist xxx.xxx.xxx.xxx
    DOSLogDir           "/var/log/mod_evasive"
</IfModule>

/etc/apache2/conf-enabled/security.conf 
ServerTokens Prod 

重现问题的一种方法是当客户端发出此类请求时:

https://example.com/s/p.json?eyJ0IjoyLjksImYiOnsiZmxpX3BsIjoiYXNwZXJzb3IiLCJmbGlfZyI6LTEsImZsaV9jIjotMSwiZmxpX20iOjAsImZsaV9hIjoyMDExfSwiY3NyZiI6ImE5MDMwMDkxLTBlZjgtNDcyOC05YjQ1LTU1MWY3M2U5YjQ5MCJ9

...在我的情况下这是一个合法的请求。谁能告诉我如何解决这个问题?谢谢你。

apache2 mod-security http-status-code-403
  • 2 个回答
  • 1283 Views
Martin Hope
Mikhail T.
Asked: 2017-02-02 10:00:42 +0800 CST

如何告诉 Apache 回复 403 而不是 401?

  • 2

我们对 s 的子树有一些规则Location,包括Require-ingldap-group和expr-s。

用户受到适当的挑战,以提供经过验证的登录凭据。

但是,即使凭据正确并且由于其他原因(例如属于错误的组或来自不正确的 IP 地址)而拒绝访问,服务器的响应始终是 401,而不是 403。

结果,浏览器不断提示用户“再试一次”......我可以告诉 Apache(2.4)使用 403,如果Authorization-header 中提供的信息签出,并且它是其他一些规则,拒绝要求?

再次,我知道,为什么在身份验证成功后,某些用户的授权被拒绝 - 它应该是。我只需要与这些用户沟通,即:“是的,我们相信你就是你所说的那个人,但你不被允许访问这个位置。”

看来,mod_rewrite 是引发 403 响应的唯一方法—— mod_rewrite 表达式是否可以检查 LDAP 组的成员资格或强制将状态从 401 更改为 403?

我在WebMaster 的网站上问过这个问题,但没有得到答案——那里的人似乎更注重内容。

这是我当前配置的相关片段:

<Location /foo>
         Require ldap-group CN=foo,OU=Groups,DC=example,DC=net
</Location>

当验证提供的用户名/密码,但不满足要求时,我需要返回 403... 401 当前正在返回。

mod-rewrite apache-2.4 http-status-code-403 authorization
  • 1 个回答
  • 1367 Views
Martin Hope
tameeshb
Asked: 2016-12-08 16:18:19 +0800 CST

新安装 apache2 时出现 403

  • 0

我之前安装了lampp。我使用 sudo ./uninstall 卸载了它但即使在我卸载它之后,它仍向我显示 /opt/lampp/htdocs 的内容。我也使用 sudo rm 来删除目录。然后我安装了 apcache 使用

sudo apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring

但现在它说

禁止的

您无权访问此服务器上的 /。

此外,在尝试使用 ErrorDocument 处理请求时遇到 403 Forbidden 错误。

我怎样才能解决这个问题?是否有其他应用程序在运行:80 而不是任何 apache 安装?

apache-2.2 apache-2.4 apache2 http-status-code-403
  • 1 个回答
  • 262 Views

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