0
-Dir.chdir("#{File.dirname(__FILE__)}/..")
0
-exec "rake", "apache2:install"
0
+PASSENGER_ROOT = File.expand_path(File.dirname(__FILE__) << "/..")
0
+PASSENGER_WEBSITE = "http://passenger.phusion.nl/"
0
+PHUSION_WEBSITE = "www.phusion.nl"
0
+Dir.chdir(PASSENGER_ROOT)
0
+ return "\e[33m\e[44m\e[1m#{text}\e[0m"
0
+ return "\e[1m#{text}\e[0m"
0
+ return "\e[1m\e[31m#{text}\e[0m"
0
+#{banner("Welcome to the Passenger Apache 2 module installer.")}
0
+This installer will guide you through the entire installation process. It
0
+shouldn't take more than 3 minutes in total.
0
+Here's what you can expect from the installation process:
0
+ #{bold('1.')} The Apache 2 module will be automatically installed for you.
0
+ #{bold('2.')} This installer will teach you how to configure Apache.
0
+ #{bold('3.')} This installer will teach you how to deploy a Ruby on Rails application.
0
+ #{bold('4.')} There is no step 4.
0
+Don't worry if anything goes wrong. This installer will advise you on how to
0
+#{bold('Press Enter to continue, or Ctrl-C to abort.')}
0
+puts "--------------------------------------------------------------------"
0
+puts banner('Compiling and installing Apache 2 module...')
0
+puts "cd #{PASSENGER_ROOT}"
0
+puts "rake apache2:install"
0
+if system "rake", "apache2:install"
0
+ module_location = `apxs2 -q LIBEXECDIR`.strip << "/mod_passenger.so"
0
+ spawn_server_location = "#{PASSENGER_ROOT}/bin/passenger-spawn-server"
0
+ puts "--------------------------------------------------------------------"
0
+ puts banner('The Apache 2 module was successfully installed.')
0
+ Please edit your Apache configuration file, and add these lines:
0
+ #{bold('LoadModule passenger_module ' << module_location)}
0
+ #{bold('RailsSpawnServer ' << spawn_server_location)}
0
+ After you restart Apache, you are ready to deploy any number of Ruby on Rails
0
+ applications on Apache, without any further Ruby on Rails-specific
0
+ #{bold('Press ENTER to continue.')}
0
+ puts message.gsub(/^\t/, '')
0
+ puts "--------------------------------------------------------------------"
0
+ #{banner('Deploying a Ruby on Rails application: an example')}
0
+ Suppose you have a Ruby on Rails application in #{bold('/somewhere')}.
0
+ #{bold('1.')} Add a virtual host to your Apache configuration file.
0
+ #{bold('2.')} Set the virtual host's DocumentRoot to #{bold('/somewhere/public')}.
0
+ And that's it! You may also want to check the documentation on our website,
0
+ #{bold(PASSENGER_WEBSITE)}, for security and optimization tips and other
0
+ Enjoy Passenger, a product of Phusion (#{bold(PHUSION_WEBSITE)}) :-)
0
+ puts message.gsub(/^\t/, '')
0
+ --------------------------------------------------------------------
0
+ #{red('It looks like something went wrong.')}
0
+ #{bold('*')} Do you see any #{bold('permission errors?')} If so, then please rerun this installer
0
+ #{bold('*')} Do you see any errors about #{bold(".h files that can't be found")}? If so, then you
0
+ probably don't have the Apache/APR development headers installed. Please
0
+ install the Apache/APR development headers and try again.
0
+ It is also possible that the headers are installed, but your compiler can't
0
+ find them. Please set the environment variables #{bold('C_INCLUDE_PATH')} and
0
+ #{bold('CPLUS_INCLUDE_PATH')} to the directory where your Apache/APR headers are
0
+ If the above checklist didn't help, please use our support facilities at
0
+ #{bold(PASSENGER_WEBSITE)}
0
+ puts message.gsub(/^\t/, '')
Comments
No one has commented yet.