Default Configuration

kplawver edited this page Sep 11, 2014 · 1 revision

These are all the defaults for all of the configurable things in Moonshine.

All of these go in config/moonshine.yml (or in config/moonshine/STAGE.yml if you're using capistrano stages). All options are listed with their defaults, blank if that's the default.

Basic Configuration

These all belong at the top level of your yaml file.

  • :rake_version:
  • :domain:
  • :domain_aliases: (an array of domain aliases, gets used in the VirtualHost configuration)
  • :deploy_to: /srv/APPNAME
  • :shared_children:
  • :user: rails
  • :group: rails
  • :assets:
    • :enabled: false (set to true if you use the asset pipeline)

Apache

Belong in the :apache: section:

  • :keep_alive: 'Off'
  • :max_keep_alive_requests: 100
  • :keep_alive_timeout: 15
  • :max_clients: 150
  • :server_limit: 16
  • :timeout: 300
  • :trace_enable: 'On'
  • :gzip: true
  • :gzip_types: ['text/html', 'text/plain', 'text/xml', 'text/css', 'text/javascript', 'text/json', 'application/x-javascript', 'application/javascript', 'application/json'] (this should be a YAML array, but easier to list it this way here)
  • :htpasswd:
  • :users:
  • :envvars: This should be an array of keys and values.
  • :allow_override: None
  • :file_etag:
  • :allow:
  • :authname:
  • :deny:
  • :satisfy: Any

MySQL

Belong in the :mysql: section

  • :default_character_set: utf8
  • :default_storage_engine: innodb
  • :character_set_server: utf8
  • :collation: utf8_general_ci
  • :server_id: 1
  • :auto_increment_increment: 10
  • :auto_increment_offset: 1
  • :log_bin: {log_prefix}-bin
  • :log_bin_index: {log_prefix}-bin
  • :relay_log: {log_prefix}-relay
  • :relay_log_index: {log_prefix}-relay
  • :replicate_same_server_id: 0
  • :log_prefix: Defaults to the hostname.
  • :innodb_buffer_pool_size: 128M
  • :innodb_additional_mem_pool_size: 16M
  • :innodb_data_file_path: idbata1:10M:autoextend
  • :innodb_file_io_threads: 4
  • :innodb_thread_concurrency: 4
  • :innodb_flush_log_at_trx_commit: 2
  • :innodb_log_buffer_size: 64M
  • :innodb_log_file_size: 80M
  • :innodb_log_files_in_group: 3
  • :innodb_file_per_table: 1
  • :innodb_max_dirty_pages_pct: 90
  • :innodb_lock_wait_timeout: 120
  • :default_time_zone: SYSTEM
  • :connect_timeout: 10
  • :back_log: 50
  • :max_connections: 25
  • :max_connect_errors: 10
  • :table_cache: 2048
  • :max_allowed_packet: 32M
  • :open_files_limit: 1024
  • :max_heap_table_size: 64M
  • :join_buffer_size: 4M
  • :read_buffer_size: 4M
  • :sort_buffer_size: 8M
  • :read_rnd_buffer_size: 8M
  • :thread_cache_size: 8
  • :thread_concurrency: 8
  • :query_cache_size: 128M
  • :query_cache_limit: 2M
  • :thread_stack: 192K
  • :transaction_isolation: READ-COMMITTED
  • :tmp_table_size: 128M
  • :tmpdir: /tmp
  • :disable_slow_query_log: false
  • :log_slow_queries: /var/log/mysql/slow_queries.log
  • :long_query_time: 5
  • :bind_address: 127.0.0.1
  • :extra: This is a big text block you can add any other configuration options you might want to.

SSL

Used in the VirtualHost, belongs in the :ssl: section.

  • :cipher_suite: ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
  • :certificate_file: /etc/ssl/certs/ssl-cert-snakeoil.pem
  • :certifice_key_file: /etc/ssl/private/ssl-cert-snakeoil.key
  • :certificate_chain_file:
  • :protocol:
  • :vhost_extra: A text block appended to the end of the VirtualHost block where you can add your own rules.
  • :ip: default

Passenger

Belong in the :passenger: section

  • :version: 3.0.11
  • :log_level: 0
  • :use_global_queue: true
  • :user_switching: true
  • :default_user: rails
  • :max_pool_size: 6
  • :max_instances_per_app: 0
  • :pool_idle_time: 300
  • :max_requests: 0
  • :stat_throttle_rate: 0
  • :buffer_response: true
  • :limit_except:
  • :rails_auto_detect: true
  • :rails_base_uri:
  • :allow_mod_rewrite: false
  • :rack_env: production
  • :rails_spawn_method: smart
  • :min_instances: 0
  • :pre_start_url:
  • :app_group_name:
  • :maintenance_status_code: 503
  • :maintenance_rewrite: If you don't want to use the default, you can supply a text block with your own maintenance rewrite rules. We suggest you use the default.
  • :page_cache_directory:
  • :buffer_upload: Added in Passenger 4.0.26, waits until file uploads are finished before handing them to Rails. Defaults to on.
  • :vhost_extra: A text block appended to the end of the VirtualHost block where you can add your own rules.

And the settings just for Passenger Enterprise:

  • :rolling_restarts: Defaults to false, but you should really set it to true.
  • :max_request_time: Defaults to 0. Be careful with this one because there appears to be a bug that kills of passenger instances as they start if they take longer to spin up than the value of this setting. I'd recommend setting it to something extreme like 120 for now (hopefully your app doesn't take 2 minutes to start up).
  • :memory_limit: Defaults to 0. We haven't set this one in production yet, but I'd set it the absolute maximum you're comfortable running your app (like 500M).
  • :resist_deployment_errors: Defaults to false.
  • :debug_log_file: This is a great feature. It moves all the apache errors related to startup or stopped connections to a separate log file. We've been setting this to the /srv/APPNAME/current/log/debug.log.

Rails Log Rotation

Belong in the :rails_logrotate: section

  • :options: "daily missingok compress delaycompress sharedscripts"
  • :postrotate: "touch /srv/APPNAME/current/tmp/restart"