system-config/modules/openstackid/templates/vhost.erb
Jeremy Stanley 318c79b9fc Set up openstackid module
Refactor the openstack_project::openstackid_dev module out into a
top-level openstackid module in preparation for multiple servers,
set up Apache to serve content out of /srv/openstackid, add an
/etc/openstackid/database.php file with connection details injected
from hiera and keep an updated clone of openstack-infra/openstackid
in /opt/openstackid.

Change-Id: Icdde594384e3af27c8dd185a51b9e5a71619fb7b
2013-12-27 22:56:55 +00:00

40 lines
1.3 KiB
Plaintext

<VirtualHost <%= scope.lookupvar("openstackid::vhost_name") %>:80>
ServerAdmin <%= scope.lookupvar("openstackid::serveradmin") %>
ErrorLog ${APACHE_LOG_DIR}/openstackid-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/openstackid-access.log combined
Redirect / https://<%= scope.lookupvar("openstackid::vhost_name") %>/
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost <%= scope.lookupvar("openstackid::vhost_name") %>:443>
ServerName <%= scope.lookupvar("openstackid::vhost_name") %>
ServerAdmin <%= scope.lookupvar("openstackid::serveradmin") %>
ErrorLog ${APACHE_LOG_DIR}/openstackid-ssl-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/openstackid-ssl-access.log combined
SSLEngine on
SSLCertificateFile <%= scope.lookupvar("openstackid::ssl_cert_file") %>
SSLCertificateKeyFile <%= scope.lookupvar("openstackid::ssl_key_file") %>
<% if scope.lookupvar("openstackid::ssl_chain_file") != "" %>
SSLCertificateChainFile <%= scope.lookupvar("openstackid::ssl_chain_file") %>
<% end %>
RewriteEngine on
RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("openstackid::vhost_name") %>
RewriteRule ^.*$ <%= scope.lookupvar("openstackid::canonicalweburl") %>
DocumentRoot <%= docroot %>
<Directory <%= docroot %>/>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
</IfModule>