system-config/modules/openstack_project/templates/pypi.vhost.erb
Michael Krotscheck 787b408d84 Add wheel mirror to mirrors
This patch adds a new "wheel" directory to the pypi mirrors,
as an rsync target for our built wheel packages.

A rewrite rule has been added in anticipation of serving
the wheels from an AFS drive. Since AFS has a practical
folder size limit, we are using /a/a /s/sp/split /s/st/style
directory structure that should be AFS-tolerant. The rewrite
rule creates the necessary mappings that make the packages
available to pip.

Example: HTTP GET /Babel/ -> /B/Ba/Babel/

Furthermore, a cron job has been added to periodically generate
a human-readable index of these mappings, in accordance with
PEP503. While frequently regenerated, this index should only
change meaningfully if a new package is added to the wheel, as
it only represents the package names themselves, rather than
the available versions of said package.

Change-Id: I743fc3ec629eea225c981d6e870751f33e77d7c6
2016-01-15 08:07:53 -08:00

38 lines
1.4 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 <%= @www_root %>
<Directory <%= @www_root %>>
Options <%= @options %>
AllowOverride None
Order allow,deny
allow from all
Satisfy any
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
# URL's are:
# /wheel/{distro}-{distro-version}/a/a/a-etc.whl
# /wheel/{distro}-{distro-version}/a/ab/abcd/abcd-etc.whl
# /wheel/{distro}-{distro-version}/a/ab/abcde/abcde-etc.whl
RewriteEngine On
RewriteRule ^/wheel/([^/]+)/([^/])/(.*)$ /wheel/$1/$2/$2/$3 [L]
RewriteRule ^/wheel/([^/]+)/([^/])([^/])([^/]*)/(.*)$ /wheel/$1/$2/$2$3/$2$3$4/$5 [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>