Skip to content

Commit

Permalink
Updated passenger to 2.1.2 (Rails 2.3 support)
Browse files Browse the repository at this point in the history
  • Loading branch information
benschwarz committed Mar 17, 2009
2 parents 42399f0 + 657901b commit 908a5a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1 +1 @@
config/deploy.rb
config/deploy.rb
34 changes: 17 additions & 17 deletions config/stack/apache.rb
Expand Up @@ -3,11 +3,11 @@
apt 'apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert' do
post :install, 'a2enmod rewrite'
end

verify do
has_process 'apache2'
end

requires :build_essential
end

Expand All @@ -20,29 +20,29 @@
description 'Phusion Passenger (mod_rails)'
gem 'passenger' do
post :install, 'echo -en "\n\n\n\n" | sudo passenger-install-apache2-module'

# Create the passenger conf file
post :install, 'mkdir -p /etc/apache2/extras'
post :install, 'touch /etc/apache2/extras/passenger.conf'
post :install, 'echo "Include /etc/apache2/extras/passenger.conf"|sudo tee -a /etc/apache2/apache2.conf'

[%q(LoadModule passenger_module /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.1.2/ext/apache2/mod_passenger.so),
%q(PassengerRoot /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.1.2),
%q(PassengerRuby /usr/local/bin/ruby),
%q(RailsEnv production)].each do |line|
post :install, "echo '#{line}' |sudo tee -a /etc/apache2/extras/passenger.conf"
end

# Restart apache to note changes
post :install, '/etc/init.d/apache2 restart'
end

verify do
has_file '/etc/apache2/extras/passenger.conf'
has_file '/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.1.2/ext/apache2/mod_passenger.so'
has_directory '/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.1.2'
end

requires :apache, :apache2_prefork_dev, :ruby_enterprise
end

Expand All @@ -56,7 +56,7 @@
# Passenger-stack-etags
FileETag MTime Size
eol

push_text config, apache_conf, :sudo => true
verify { file_contains apache_conf, "Passenger-stack-etags"}
requires :apache
Expand All @@ -69,14 +69,14 @@
# Passenger-stack-deflate
<IfModule mod_deflate.c>
# compress content with type html, text, and css
AddOutputFilterByType DEFLATE text/css text/html text/javascript application/javascript application/x-javascript text/js
AddOutputFilterByType DEFLATE text/css text/html text/javascript application/javascript application/x-javascript text/js text/plain text/xml
<IfModule mod_headers.c>
# properly handle requests coming from behind proxies
Header append Vary User-Agent
</IfModule>
</IfModule>
eol

push_text config, apache_conf, :sudo => true
verify { file_contains apache_conf, "Passenger-stack-deflate"}
requires :apache
Expand All @@ -85,18 +85,18 @@
# mod_expires, add long expiry headers to css, js and image files
package :apache_expires_support do
apache_conf = "/etc/apache2/apache2.conf"

config = <<eol
# Passenger-stack-expires
<ifmodule mod_expires.c>
<filesmatch "\.(jpg|gif|png|css|js)$">
<IfModule mod_expires.c>
<FilesMatch "\.(jpg|gif|png|css|js)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
</filesmatch>
</ifmodule>
</FilesMatch>
</IfModule>
eol

push_text config, apache_conf, :sudo => true
verify { file_contains apache_conf, "Passenger-stack-expires"}
requires :apache
end
end

0 comments on commit 908a5a9

Please sign in to comment.