Rewrite trystack.org to trystack.o.o

Add the required serveraliases and rewrite settings needed to support
both trystack.openstack.org and trystack.org.

Change-Id: I1a6560be8a1a24b50b1d047ed990e5f029ac5ee5
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2015-08-10 10:36:55 -04:00
parent 6a533b002c
commit 884a1c3432
2 changed files with 17 additions and 5 deletions

View File

@ -233,11 +233,12 @@ class openstack_project::static (
# Trystack
::httpd::vhost { 'trystack.openstack.org':
port => 80,
priority => '50',
docroot => '/opt/trystack',
template => 'openstack_project/trystack.vhost.erb',
require => Vcsrepo['/opt/trystack'],
port => 80,
priority => '50',
docroot => '/opt/trystack',
template => 'openstack_project/trystack.vhost.erb',
serveraliases => ['trystack.org'],
require => Vcsrepo['/opt/trystack'],
}
vcsrepo { '/opt/trystack':

View File

@ -5,6 +5,16 @@
NameVirtualHost <%= @vhost_name %>:<%= @port %>
<VirtualHost <%= @vhost_name %>:<%= @port %>>
ServerName <%= @srvname %>
<% if @serveraliases.is_a? Array -%>
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
<% elsif @serveraliases != '' -%>
<%= " ServerAlias #{@serveraliases}" %>
<% end -%>
# NOTE(pabelanger): Rewrite any valid serveraliases to srvname.
RewriteEngine On
RewriteCond %{HTTP_HOST} !<%= @srvname %>$ [NC]
RewriteRule ^/(.*)$ http://<%= @srvname %>/$1 [L,R=301]
DocumentRoot <%= @docroot %>
<Directory <%= @docroot %>>
@ -12,6 +22,7 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
AllowOverride None
Order allow,deny
allow from all
Satisfy Any
</Directory>
ErrorLog /var/log/apache2/<%= @name %>_error.log