Michael Krotscheck 168eab95d8 Added pypi hosting for AFS mirror slave
This patch adds a vhost that exposes /afs/openstack.org/mirror/pypi/web
to the internet under <hostname>/pypi. It also adds a do-not-follow
robots.txt file.

Change-Id: I3d7629d80fe1e8762344852fab4a942bc476b706
2016-01-21 11:25:36 -08:00

37 lines
1.3 KiB
Plaintext

# ************************************
# Managed by Puppet
# ************************************
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 != nil -%>
<%= " ServerAlias #{@serveraliases}" -%>
<% end -%>
DocumentRoot <%= @docroot %>
<Directory <%= @docroot %>>
Options <%= @options %>
AllowOverride None
Order allow,deny
allow from all
Satisfy any
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
# Pypi URL's are:
# /pypi/simple/a/a/a-etc.whl
# /pypi/simple/a/abcd/abcd-etc.whl
# /pypi/simple/a/abcde/abcde-etc.whl
RewriteEngine On
RewriteRule ^/pypi/simple/([^/])([^/]*)$ /pypi/simple/$1/$1$2 [L]
RewriteRule ^/pypi/simple/([^/])([^/]*)/(.*)$ /pypi/simple/$1/$1$2/$3 [L]
ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log
LogLevel warn
CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined
ServerSignature Off
</VirtualHost>