gpt4 book ai didi

javascript - Apache Alias 指令破坏 CGI

转载 作者:行者123 更新时间:2023-11-27 23:58:37 25 4
gpt4 key购买 nike

因此,我试图在 mac mini 上设置 Nagios,但对这个问题感到非常困惑。如果我在我的 VirtualHost 中注释掉我的 Alias 指令,CGI 工作正常,但是我所有的 js 和 css 文件都找不到。另一方面,如果我保留 Alias 指令,我的 cgi 就会中断。

这是我的 nagios 设置的虚拟主机配置文件。任何帮助将不胜感激!

<VirtualHost *:80>
ServerName nagios.mydomain.local
DocumentRoot "/usr/local/Cellar/nagios/4.4.3/share/nagios/htdocs"
#Alias /nagios "/usr/local/Cellar/nagios/4.4.3/share/nagios/htdocs"

<Directory "/usr/local/Cellar/nagios/4.4.3/sbin">
Options ExecCGI
AllowOverride None

<IfModule dir_module>
AddHandler cgi-script .cgi
</IfModule>

<IfVersion >= 2.3>
<RequireAll>
Require all granted
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</IfVersion>
</Directory>

<Directory "/usr/local/Cellar/nagios/4.4.3/share/nagios/htdocs">
# SSLRequireSSL
Options None
AllowOverride None

<IfModule dir_module>
DirectoryIndex index.php index.html index.htm
AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
</IfModule>

<IfVersion >= 2.3>
<RequireAll>
Require all granted
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</IfVersion>
</Directory>

ErrorLog "/var/log/apache2/nagios.mydomain.local-error_log"
CustomLog "/var/log/apache2/nagios.mydomain.local-access_log" common

ScriptAlias /nagios/cgi-bin "/usr/local/Cellar/nagios/4.4.3/sbin"
</VirtualHost>

最佳答案

好吧……很奇怪!如果我将 Alias 指令移动到底部,在关闭的 virtualhost 标记之间和 scriptalias 标记之后,它就解决了这个问题。

虽然我不知道为什么!

关于javascript - Apache Alias 指令破坏 CGI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56118176/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com