Puppet 仪表板 - 禁止目录索引

Posted

技术标签:

【中文标题】Puppet 仪表板 - 禁止目录索引【英文标题】:Puppet Dashboard - Directory Index Forbidden 【发布时间】:2015-11-14 16:53:02 【问题描述】:

我在启动 Puppet Dashboard UI 时也遇到了问题,下面是我的配置文件。谁能帮我解决这个问题。

我得到的错误:

[Thu Aug 20 05:25:09 2015] [error] [client 192.168.XXX.XXX] Directory index forbidden by Options directive: /usr/share/puppet-dashboard/public/

下面是我的 VirtualHost 文件。

# UPDATE THESE PATHS TO SUIT YOUR ENVIRONMENT
#LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-5.0.15
PassengerRuby /usr/bin/ruby

# you may want to tune these settings
PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
# PassengerMaxRequests 1000
PassengerStatThrottleRate 120
#RailsAutoDetect On
Listen 3000

<VirtualHost *:3000>
        ServerName puppetma.domain.net
        ServerAlias puppetma
        DocumentRoot /usr/share/puppet-dashboard/public/
<Directory /usr/share/puppet-dashboard/public/>
                Options None
                Order allow,deny
                allow from all
        </Directory>
  ErrorLog /var/log/httpd/puppet-dashboard_error.log
  LogLevel warn
  CustomLog /var/log/httpd/puppet-dashboard_access.log combined
  ServerSignature On

我可以看到我的 DNS 工作正常,我还确保停止我的主机级防火墙和 selinux。

谢谢

编辑

[admin@$$$]$ pwd
/usr/share/puppet-dashboard/public
drwxr-xr-x  5 puppet-dashboard puppet-dashboard 4.0K Apr  3 17:46 .
drwxr-xr-x 17 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 ..
-rwxr-xr-x  1 puppet-dashboard puppet-dashboard 1006 Mar 21  2013 404.html
-rwxr-xr-x  1 puppet-dashboard puppet-dashboard  989 Mar 21  2013 422.html
-rwxr-xr-x  1 puppet-dashboard puppet-dashboard 1.2K Mar 21  2013 500.html
drwxr-xr-x  3 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 images
drwxr-xr-x  2 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 javascripts
-rwxr-xr-x  1 admin            admin             18K Apr  3 17:46 puppet_dashboard.sql
-rwxr-xr-x  1 puppet-dashboard puppet-dashboard   26 Mar 30 15:42 robots.txt
drwxr-xr-x  4 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 stylesheets

[admin@$$$]$ pwd
/usr/share/puppet-dashboard
drwxr-xr-x   17 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 .
drwxr-xr-x. 127 root             root             4.0K Apr  3 16:55 ..
drwxr-xr-x    7 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 app
drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 bin
drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 21  2013 certs
drwxr-xr-x    5 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:59 config
drwxr-xr-x    3 puppet-dashboard puppet-dashboard 4.0K Mar 29 13:00 db
drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 examples
drwxr-xr-x    4 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 ext
drwxr-xr-x    4 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 lib
drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 31 03:24 log
drwxr-xr-x    5 puppet-dashboard puppet-dashboard 4.0K Apr  3 17:46 public
-rwxrwxrwx    1 puppet-dashboard puppet-dashboard 1.7K Mar 21  2013 Rakefile
drwxr-xr-x    3 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 script
drwxr-xr-x   10 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 spec
drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 21  2013 spool
drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 21  2013 tmp
drwxr-xr-x    5 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 vendor
-rw-r--r--    1 puppet-dashboard puppet-dashboard    7 Mar 21  2013 VERSION

【问题讨论】:

问题似乎是 apache 无法找到索引文件并尝试列出目录内容 - 由于Options None,这是禁止的。请查看wiki.debian.org/PuppetDashboard 有一些变量,例如RailsBaseURI / 未在您的虚拟主机配置中设置。另外:是否所有内容都正确安装到 DocumentRoot 中? @Kiran Sysadm :我面临同样的问题。 P,请告诉我你是怎么解决这个问题的? @mat1010 :尝试添加“RailsBaseURI /” - 仍然得到相同的错误。 【参考方案1】:

也许这会有所帮助?

1) 在/etc/httpd/conf.d/welcome.conf 改变:

Options -IndexesOptions Indexes(您可能想要完全注释掉这些行 - 取决于您的具体需要)。

2) 第二件事也许您只需要调整您的/usr/share/puppet-dashboard/public/ 目录的+x(执行)权限。

尝试运行chmod 777 /usr/share/puppet-dashboard/public/,它会将所有内容都提供给用户、组和世界。完成后请不要忘记正确调整它。如果要递归运行 chmod,请添加 -R 选项。

【讨论】:

@VasanthNagKV 你能告诉我们你的目录/usr/share/puppet-dashboard/public//usr/share/puppet-dashboard/ls -la 和你的welcome.conf 文件的内容吗? ls -lrth /usr/share/puppet-dashboard/public/ 。 .. 404.html 422.html 500.html 图像 javascripts robots.txt 样式表 ---> 第一个输出 ls -lrth /usr/share/puppet-dashboard/ VERSION Rakefile tmp spool certs app bin examples ext lib script spec vendor config db登录公共 --> 第二个输出 @VasanthNagKV 无法阅读,您能否编辑帖子并向我们展示包含权限和所有内容的整个输出? 我已经编辑了这篇文章,但只有在同行批准后才能看到。你可以看看这个链接,我在其中发布了我的担忧。 - ***.com/questions/49599341/… @VasanthNagKV 感谢您的列表。你能告诉我们phusion passer的配置吗?应该在/etc/apache2/mods-available/passenger.conf

以上是关于Puppet 仪表板 - 禁止目录索引的主要内容,如果未能解决你的问题,请参考以下文章

以 Forbidden Errors 开头的 Kubernetes 仪表板

Asp.NET Core 如何使用ElasticSearch和Kibana创建仪表板

OBIEE 目录管理器 - 确定哪些仪表板使用特定报告

CloudKit 仪表板未更新

Hangfire.io仪表板映射到IIS虚拟目录

Google 可视化仪表板错误