Update sample bluepill config and install docs
This commit is contained in:
parent
a908f00771
commit
70be638f47
|
@ -32,9 +32,10 @@ Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |a
|
||||||
|
|
||||||
if bootup_bundle
|
if bootup_bundle
|
||||||
app.environment = `env -i BUNDLE_GEMFILE=#{rails_root}/Gemfile #{bootup_bundle} exec env`.lines.inject({}) do |env_hash,l|
|
app.environment = `env -i BUNDLE_GEMFILE=#{rails_root}/Gemfile #{bootup_bundle} exec env`.lines.inject({}) do |env_hash,l|
|
||||||
kv = l.chomp.split('=',2)
|
kv = l.chomp.split('=',2)
|
||||||
env_hash[kv[0]] = kv[1]
|
env_hash[kv[0]] = kv[1]
|
||||||
env_hash
|
env_hash
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
app.environment ||= {}
|
app.environment ||= {}
|
||||||
|
@ -94,7 +95,10 @@ Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |a
|
||||||
process.daemonize = true
|
process.daemonize = true
|
||||||
end
|
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|
|
app.process("clockwork") do |process|
|
||||||
pidfile = "#{rails_root}/tmp/pids/clockwork.pid"
|
pidfile = "#{rails_root}/tmp/pids/clockwork.pid"
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ Edit ~/discourse/config/database.yml
|
||||||
|
|
||||||
- change production db name if appropriate
|
- change production db name if appropriate
|
||||||
- change username/password 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
|
- change `host_names` to the name you'll use to access the discourse site
|
||||||
|
|
||||||
Edit ~/discourse/config/redis.yml
|
Edit ~/discourse/config/redis.yml
|
||||||
|
@ -236,10 +236,22 @@ Initialize the database:
|
||||||
|
|
||||||
# Run these commands as the discourse user
|
# Run these commands as the discourse user
|
||||||
# The database name here should match the production one in database.yml
|
# The database name here should match the production one in database.yml
|
||||||
|
cd ~/discourse
|
||||||
createdb discourse_prod
|
createdb discourse_prod
|
||||||
RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production rake db:migrate
|
RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production rake db:migrate
|
||||||
RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production rake assets:precompile
|
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
|
## nginx setup
|
||||||
|
|
||||||
# Run these commands as your normal login (e.g. "michael")
|
# Run these commands as your normal login (e.g. "michael")
|
||||||
|
@ -248,7 +260,12 @@ Initialize the database:
|
||||||
Edit /etc/nginx/nginx.conf:
|
Edit /etc/nginx/nginx.conf:
|
||||||
|
|
||||||
- add: `server_names_hash_bucket_size 64;` to the `http` section
|
- 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
|
Edit /etc/nginx/conf.d/discourse.conf
|
||||||
|
|
||||||
|
@ -284,11 +301,13 @@ Add the bluepill startup to crontab.
|
||||||
Add the following lines:
|
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
|
@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.
|
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!
|
Congratulations! You've got Discourse installed and running!
|
||||||
|
|
||||||
Now make yourself an administrator account. Browse to your discourse instance
|
Now make yourself an administrator account. Browse to your discourse instance
|
||||||
|
|
Loading…
Reference in New Issue