#!/opt/rhoconnect/bin/ruby $:.unshift File.expand_path(File.join(File.dirname(__FILE__),'..','scripts')) require 'rho_connect_install_constants' @prefix = '/opt/rhoconnect' @dist = 'debian' @redis = '' @ruby_version = 'rubyee' @profile = '~/.profile' # place_redis_init # Places the redis initialization file into the correct directory def place_redis_init redis_init="/etc/init.d/redis" # Move the script into the appropriate directory `mv redis_init_script #{redis_init}` # Make the init script executable `chmod +x #{redis_init}` # Set run levels `update-rc.d -f redis defaults` end #place_redis_init def place_redis_logrotate log_rotate = '/etc/logrotate.d/redis' # Move the file to the appropriate directory `mv redis_log_rotate #{log_rotate}` end # place_readme # Places the readme file in the appropriate directory def place_readme readme_dir = "#{prefix}/README" # Move the readme into the appropriate folder `mv README #{readme_dir}` end #create_readme def create_passenger_load passenger_load_file = '/etc/apache2/mods-available/passenger.load' passenger_load = <<_PASSENGER_LOAD_ LoadModule passenger_module /opt/rhoconnect/lib/ruby/gems/1.8/gems/#{Constants::PASSENGER_VERSION}/ext/apache2/mod_passenger.so PassengerRoot /opt/rhoconnect/lib/ruby/gems/1.8/gems/#{Constants::PASSENGER_VERSION} PassengerRuby /opt/rhoconnect/bin/ruby _PASSENGER_LOAD_ File.open( passenger_load_file, 'w' ) { |f| f << passenger_load } end #create_passenger_load def create_nginx_vhost vhost_file = '' File.open( vhost_file, 'w' ) { |f| f << vhost } end #create_apache_vhost def create_texts if @redis place_redis_init place_redis_logrotate end readme = create_readme create_passenger_load create_apache_vhost puts readme end #create_texts create_texts