Comment 1 for bug 1637576

Revision history for this message
Andreas Karis (akaris) wrote :

Running another test to get rid of the docroot altogether as /var/www as docroot is not needed according to horizon documentation:
http://docs.openstack.org/liberty/config-reference/content/configure-dashboard.html

~~~
##### `docroot`

**Required**. Sets the [`DocumentRoot`][] location, from which Apache serves files.

If `docroot` and [`manage_docroot`][] are both set to `false`, no [`DocumentRoot`][] will be set and the accompanying `<Directory /path/to/directory>` block will not be created.
~~~

~~~
define apache::vhost(
  $docroot,
  $manage_docroot = true,
~~~

~~~
  controllerExtraConfig:
    horizon::vhost_extra_params:
      docroot: false
      manage_docroot: false
      add_listen: false
~~~

The end result removed any reference to /var/www
~~~
[root@overcloud-controller-0 ~]# cat /etc/httpd/conf.d/12-horizon_vhost.conf
# ************************************
# Vhost template in module puppetlabs-apache
# Managed by Puppet
# ************************************

<VirtualHost 172.16.2.9:80>
  ServerName overcloud-controller-0.localdomain
  ## Alias declarations for resources outside the DocumentRoot
  Alias /dashboard/static "/usr/share/openstack-dashboard/static"

  ## Logging
  ErrorLog "/var/log/httpd/horizon_error.log"
  ServerSignature Off
  CustomLog "/var/log/httpd/horizon_access.log" combined

  ## RedirectMatch rules
  RedirectMatch permanent ^/$ /dashboard

  ## Server aliases
  ServerAlias overcloud-controller-0.localdomain
  WSGIDaemonProcess dashboard group=apache processes=3 threads=10 user=apache
  WSGIProcessGroup dashboard
  WSGIScriptAlias /dashboard "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi"
</VirtualHost>
~~~

Before, this created the following issue:
~~~
[root@undercloud-6 ~]# curl http://10.0.0.4/cgi-bin/ | grep Index
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 1254 100 1254 0 0 24155 0 --:--:-- --:--:-- --:--:-- 24588
  <title>Index of /cgi-bin</title>
<h1>Index of /cgi-bin</h1>
~~~
After, the issue is gone:

However, this will default to "PREFIX/htdocs/ where PREFIX is set when you build apache".
http://serverfault.com/questions/705169/how-to-disable-the-default-document-root-in-apache

So it may be preferrable to keep control over this value, keep it at /var/www, and simply disable the Indexes option