Update sample bluepill config and install docs

This commit is contained in:
Michael Brown 2013-06-18 02:28:30 -04:00
parent a908f00771
commit 70be638f47
2 changed files with 30 additions and 7 deletions

View file

@ -36,6 +36,7 @@ Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |a
env_hash[kv[0]] = kv[1]
env_hash
end
end
app.environment ||= {}
app.environment['RAILS_ENV'] = rails_env
@ -94,7 +95,10 @@ Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |a
process.daemonize = true
end
if `hostname`.strip == "host to run on"
# Perhaps you want to run `hostname -f` here? It depends on your environment
# In any case, ensure the output is what you expect it to be on the system
# running clockwork!
if `hostname -s`.strip == "host to run on"
app.process("clockwork") do |process|
pidfile = "#{rails_root}/tmp/pids/clockwork.pid"

View file

@ -208,7 +208,7 @@ Edit ~/discourse/config/database.yml
- change production db name if appropriate
- change username/password if appropriate
- set db_id if using multisite
- set `db_id` if using multisite
- change `host_names` to the name you'll use to access the discourse site
Edit ~/discourse/config/redis.yml
@ -236,10 +236,22 @@ Initialize the database:
# Run these commands as the discourse user
# The database name here should match the production one in database.yml
cd ~/discourse
createdb discourse_prod
RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production rake db:migrate
RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production rake assets:precompile
Not english? Set the default language as appropriate:
# Run these commands as the discourse user
cd ~/discourse
RAILS_ENV=production bundle exec rails c
SiteSetting.default_locale = 'fr'
# Not sure if your locale is supported? Check at the rails console:
LocaleSiteSetting.all_values
=> ["cs", "da", "de", "en", "es", "fr", "id", "it", "nb_NO", "nl", "pseudo", "pt", "ru", "sv", "zh_CN", "zh_TW"]
## nginx setup
# Run these commands as your normal login (e.g. "michael")
@ -248,7 +260,12 @@ Initialize the database:
Edit /etc/nginx/nginx.conf:
- add: `server_names_hash_bucket_size 64;` to the `http` section
- uncomment: `gzip on;`
If discourse will be the only site served by nginx, disable the nginx default
site:
- `sudo mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.disabled`
- Otherwise, only `server_name`s configured below in `discourse.conf` will be passed to Discourse.
Edit /etc/nginx/conf.d/discourse.conf
@ -284,11 +301,13 @@ Add the bluepill startup to crontab.
Add the following lines:
@reboot RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ROOT=~/discourse RAILS_ENV=production NUM_WEBS=4 /home/discourse/.rvm/bin/bootup_bluepill --no-privileged -c ~/.bluepill load ~/discourse/config/discourse.pill
0 0 * * * /usr/sbin/logrotate ~/discourse/config/logrotate.conf
Note: in case of RVM system-wide installation RVM will be located in `/usr/local/rvm` directory instead of `/home/discourse/.rvm`, so update the line above respectively.
## Log rotation setup
0 0 * * * /usr/sbin/logrotate ~/discourse/config/logrotate.conf
Congratulations! You've got Discourse installed and running!
Now make yourself an administrator account. Browse to your discourse instance