Puppet module to deploy an OpenStack ci system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

logs.vhost.erb 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # -*- apache -*-
  2. # ************************************
  3. # Managed by Puppet
  4. # ************************************
  5. NameVirtualHost <%= @vhost_name %>:<%= @port %>
  6. <VirtualHost <%= @vhost_name %>:<%= @port %>>
  7. ServerName <%= @srvname %>
  8. <% if @serveraliases.is_a? Array -%>
  9. <% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
  10. <% elsif @serveraliases != '' -%>
  11. <%= " ServerAlias #{@serveraliases}" %>
  12. <% end -%>
  13. DocumentRoot <%= @docroot %>
  14. AddType text/plain .log
  15. AddType text/plain .sh
  16. AddType text/plain .yaml
  17. AddType text/plain .yml
  18. # use Apache to compress the results afterwards, to save on the wire
  19. # it's approx 18x savings of wire traffic to compress. We need to
  20. # compress by content types that htmlify can produce
  21. AddOutputFilterByType DEFLATE text/plain text/html application/x-font-ttf image/svg+xml
  22. <FilesMatch \.html\.gz$>
  23. ForceType text/html
  24. AddDefaultCharset UTF-8
  25. AddEncoding x-gzip gz
  26. </FilesMatch>
  27. <FilesMatch \.css\.gz$>
  28. ForceType text/css
  29. AddDefaultCharset UTF-8
  30. AddEncoding x-gzip gz
  31. </FilesMatch>
  32. <FilesMatch \.js\.gz$>
  33. ForceType text/javascript
  34. AddDefaultCharset UTF-8
  35. AddEncoding x-gzip gz
  36. </FilesMatch>
  37. <FilesMatch \.ttf\.gz$>
  38. ForceType application/x-font-ttf
  39. AddEncoding x-gzip gz
  40. </FilesMatch>
  41. <FilesMatch \.svg\.gz$>
  42. ForceType image/svg+xml
  43. AddEncoding x-gzip gz
  44. </FilesMatch>
  45. <FilesMatch \.json\.gz$>
  46. ForceType application/json
  47. AddEncoding x-gzip gz
  48. </FilesMatch>
  49. <FilesMatch \.css$>
  50. # mod_mime_magic is sometimes passing css files as asm sources
  51. # e.g css files generated by coverage reports
  52. ForceType text/css
  53. </FilesMatch>
  54. <Directory <%= @docroot %>>
  55. Options <%= @options %>
  56. AllowOverride None
  57. Order allow,deny
  58. allow from all
  59. Satisfy Any
  60. </Directory>
  61. <Directory /usr/local/lib/python2.7/dist-packages/os_loganalyze>
  62. Allow from all
  63. Satisfy Any
  64. </Directory>
  65. <% @readmes.each do |pattern, helpfile| -%>
  66. <Directory <%= @docroot %><%= pattern %>>
  67. ReadmeName <%= helpfile %>
  68. </Directory>
  69. <% end -%>
  70. <Directory <%= @docroot %>/periodic*/*>
  71. IndexOrderDefault Descending Date
  72. </Directory>
  73. RewriteEngine On
  74. # If the specified file does not exist, look if there is a gzipped version
  75. # If there is, serve that one instead
  76. RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
  77. RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.gz -f
  78. RewriteRule ^/(.*)$ %{REQUEST_URI}.gz
  79. # rewrite txt.gz & console.html[.gz] files to map to our internal htmlify
  80. # wsgi app
  81. # PT, Pass-through: to come back around and get picked up by the
  82. # WSGIScriptAlias
  83. # NS, No-subrequest: on coming back through, mod-autoindex may have added
  84. # index.html which would match the !-f condition. We
  85. # therefore ensure the rewrite doesn't trigger by
  86. # disallowing subrequests.
  87. RewriteRule ^/(.*\.txt\.gz)$ /htmlify/$1 [QSA,L,PT,NS]
  88. RewriteRule ^/(.*console\.html(\.gz)?)$ /htmlify/$1 [QSA,L,PT,NS]
  89. # Check if the request exists as a file, directory or symbolic link
  90. # If not, write the request to htmlify to see if we can fetch from swift
  91. RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
  92. RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
  93. RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-l
  94. RewriteCond %{REQUEST_FILENAME} !^/icon
  95. RewriteRule ^/(.*)$ /htmlify/$1 [QSA,L,PT,NS]
  96. WSGIScriptAlias /htmlify /usr/local/lib/python2.7/dist-packages/os_loganalyze/wsgi.py
  97. ErrorLog /var/log/apache2/<%= @name %>_error.log
  98. LogLevel warn
  99. CustomLog /var/log/apache2/<%= @name %>_access.log combined
  100. ServerSignature Off
  101. </VirtualHost>