# ************************************
# Vhost template in module puppetlabs-apache
# Managed by Puppet
# ************************************

<VirtualHost *:443>
  ServerName controller.localdomain

  ## Vhost docroot
  DocumentRoot "/var/www/"
  ## Alias declarations for resources outside the DocumentRoot
  Alias /dashboard/static "/usr/share/openstack-dashboard/static"

  ## Directories, there should at least be a declaration for /var/www/

  <Directory "/var/www/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Require all granted
  </Directory>

  ## Logging
  ErrorLog "/var/log/httpd/horizon_ssl_error.log"
  ServerSignature Off
  CustomLog "/var/log/httpd/horizon_ssl_access.log" combined 

  ## RedirectMatch rules
  RedirectMatch permanent  ^/$ /dashboard

  ## Server aliases X
  ServerAlias *
  ServerAlias 192.168.0.10
  ServerAlias controller.localdomain
  ServerAlias localhost

  ## SSL directives
  SSLEngine on
  SSLCertificateFile      "/etc/pki/tls/certs/ssl_ps_server.crt"
  SSLCertificateKeyFile   "/etc/pki/tls/private/ssl_ps_server.key"
  SSLCACertificatePath    "/etc/pki/tls/certs"
  SSLCACertificateFile    "/etc/pki/tls/certs/ssl_ps_chain.crt"
  WSGIDaemonProcess horizon-ssl group=apache processes=3 threads=10 user=apache
  WSGIProcessGroup horizon-ssl
  WSGIScriptAlias /dashboard "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi"
</VirtualHost>
