Skip to content

Instantly share code, notes, and snippets.

@everestx
Last active August 29, 2015 13:56
Show Gist options
  • Save everestx/7aa392b039c2ad446d8a to your computer and use it in GitHub Desktop.
Save everestx/7aa392b039c2ad446d8a to your computer and use it in GitHub Desktop.
#/etc/httpd/conf.d/passenger.conf
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p286/gems/passenger-enterprise-server-4.0.5/libout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p286/gems/passenger-enterprise-server-4.0.5
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-1.9.3-p286/ruby
PassengerUserSwitching off
PassengerDefaultUser apache
PassengerDefaultGroup apache
PassengerPoolIdleTime 120
PassengerMaxPoolSize 50
PassengerMaxInstancesPerApp 15
PassengerMaxRequests 5000
PassengerMinInstances 1
PassengerRollingRestarts on
PassengerResistDeploymentErrors on
PassengerDebugLogFile /var/log/passenger.log
# config.ru
require ::File.expand_path('../config/environment', __FILE__)
run My::Application
# config/environment.rb
require File.expand_path('../application', __FILE__)
My::Application.initialize!
# config/environments/staging.rb
My::Application.configure do
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
end
# config/application.rb
require File.expand_path('../boot', __FILE__)
require "active_record/railtie"
require "action_controller/railtie"
require "active_resource/railtie"
if defined?(Bundler)
Bundler.require(*Rails.groups(:assets => %w(development test)))
end
module My
class Application < Rails::Application
config.autoload_paths += %W(#{config.root}/lib #{config.root}/app/documentation)
config.encoding = "utf-8"
config.filter_parameters += [:password]
config.active_support.escape_html_entities_in_json = true
config.active_record.whitelist_attributes = true
config.middleware.use Rack::Cors do
allow do
origins '*'
resource '*', headers: :any, methods: [:get, :options]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment