lib/deprec/templates/passenger/apache_vhost.erb in isaac-deprec-1.99.30 vs lib/deprec/templates/passenger/apache_vhost.erb in isaac-deprec-1.99.32

- old
+ new

@@ -1,10 +1,21 @@ -<VirtualHost *:80> - ServerName <%= domain %> - DocumentRoot "<%= passenger_document_root %>" - RailsEnv <%= rails_env %> - RailsAllowModRewrite <%= passenger_rails_allow_mod_rewrite %> - <directory "<%= passenger_document_root %>"> - Order allow,deny - Allow from all - </directory> -</VirtualHost> +# Don't cause the server to break if Passenger module not loaded +<IfModule passenger_module> + <VirtualHost *:80> + ServerName <%= domain %> + DocumentRoot "<%= passenger_document_root %>" + RailsEnv <%= rails_env %> + # RailsAllowModRewrite <%= passenger_rails_allow_mod_rewrite %> + # + # Check for maintenance file and redirect all requests + RewriteEngine On + RewriteCond %{REQUEST_URI} !\.(css|jpg|png|gif)$ + RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f + RewriteCond %{SCRIPT_FILENAME} !maintenance.html + RewriteRule ^.*$ /system/maintenance.html [L] + <Directory "<%= passenger_document_root %>"> + Order allow,deny + Allow from all + </Directory> + </VirtualHost> +</IfModule> +