documentation: merge & adapt suggestions from baus

This commit is contained in:
Michael Brown 2013-05-29 00:07:26 -04:00
parent 27c1f1044c
commit 73d6014d10
3 changed files with 31 additions and 27 deletions

View file

@ -7,7 +7,12 @@ num_webs = ENV["NUM_WEBS"].to_i > 0 ? ENV["NUM_WEBS"].to_i : 4
# to debug use # to debug use
#Bluepill.application("your_app", :foreground => true) do |app| #Bluepill.application("your_app", :foreground => true) do |app|
Bluepill.application("your_app") do |app|
# Running bluepill as a user? Use:
Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |app|
# Running bluepill as root? Use:
#Bluepill.application("discourse") do |app|
app.gid = group app.gid = group
app.uid = user app.uid = user
@ -52,18 +57,18 @@ Bluepill.application("your_app") do |app|
end end
#debug instance #debug instance
app.process("thin-debug") do |process| # app.process("thin-debug") do |process|
process.start_command = "bundle exec thin start -e development -t 0 -p 10040 -P #{rails_root}/tmp/pids/thin-debug.pid -d" # process.start_command = "bundle exec thin start -e development -t 0 -p 10040 -P #{rails_root}/tmp/pids/thin-debug.pid -d"
process.pid_file = "#{rails_root}/tmp/pids/thin-debug.pid" # process.pid_file = "#{rails_root}/tmp/pids/thin-debug.pid"
process.start_grace_time = 30.seconds # process.start_grace_time = 30.seconds
process.stop_grace_time = 10.seconds # process.stop_grace_time = 10.seconds
process.restart_grace_time = 10.seconds # process.restart_grace_time = 10.seconds
process.group = "thins" # process.group = "thins"
process.uid = user # process.uid = user
process.gid = group # process.gid = group
process.daemonize = false # process.daemonize = false
process.stdout = process.stderr = "#{rails_root}/log/thin-debug.log" # process.stdout = process.stderr = "#{rails_root}/log/thin-debug.log"
end # end
app.process("sidekiq-worker") do |process| app.process("sidekiq-worker") do |process|
pidfile = "#{rails_root}/tmp/pids/sidekiq-worker.pid" pidfile = "#{rails_root}/tmp/pids/sidekiq-worker.pid"

View file

@ -1,8 +1,8 @@
upstream discourse { upstream discourse {
server unix:/var/www/discourse/tmp/sockets/thin.0.sock; server unix:/home/discourse/discourse/tmp/sockets/thin.0.sock;
server unix:/var/www/discourse/tmp/sockets/thin.1.sock; server unix:/home/discourse/discourse/tmp/sockets/thin.1.sock;
server unix:/var/www/discourse/tmp/sockets/thin.2.sock; server unix:/home/discourse/discourse/tmp/sockets/thin.2.sock;
server unix:/var/www/discourse/tmp/sockets/thin.3.sock; server unix:/home/discourse/discourse/tmp/sockets/thin.3.sock;
} }
server { server {
@ -12,14 +12,14 @@ server {
gzip_min_length 1000; gzip_min_length 1000;
gzip_types application/json text/css application/x-javascript; gzip_types application/json text/css application/x-javascript;
server_name meta.discourse.org; server_name enter.your.web.hostname.here;
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
location / { location / {
root /var/www/discourse/public; root /home/discourse/discourse/public;
location ~ ^/t\/[0-9]+\/[0-9]+\/avatar { location ~ ^/t\/[0-9]+\/[0-9]+\/avatar {
expires 1d; expires 1d;

View file

@ -178,7 +178,7 @@ Configure discourse:
Edit discourse/config/database.yml Edit discourse/config/database.yml
- change production db name to: `discourse_prod` - 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
@ -189,14 +189,13 @@ Edit discourse/config/redis.yml
Edit discourse/config/discourse.pill Edit discourse/config/discourse.pill
- change application name from 'your_app' to however you want to distinguish this ('discourse') - change application name from 'discourse' if necessary
- Add option to Bluepill.application: `":base_dir => ENV["HOME"] + '/.bluepill'"` - Ensure appropriate Bluepill.application line is uncommented
- Should end up looking something like: `Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |app|`
- comment out debug instance (from `app.process("thin-debug")` through to nearest `end`)
- search for "host to run on" and change to current hostname - search for "host to run on" and change to current hostname
- note: clockwork should run on only one host - note: clockwork should run on only one host
Edit discourse/config/initializers/secret_token.rb Edit discourse/config/initializers/secret_token.rb
- uncomment secret_token line - uncomment secret_token line
- replace SET_SECRET_HERE with secret output from 'rake secret' command in discourse directory - replace SET_SECRET_HERE with secret output from 'rake secret' command in discourse directory
- delete the lines below as per instructions in the file - delete the lines below as per instructions in the file
@ -220,9 +219,9 @@ Initialize the database:
Edit /etc/nginx/conf.d/discourse.conf Edit /etc/nginx/conf.d/discourse.conf
- change socket paths to: "unix:/home/discourse/discourse/tmp/sockets/thin.0.sock;" - edit `server_name`. Example: `server_name cain.discourse.org test.cain.discourse.org;`
- edit `server_name`. Example: "server_name cain.discourse.org test.cain.discourse.org;" - change socket paths if discourse is installed to a different location
- modify root location to match installed location: "root /home/discourse/discourse/public;" - modify root location if discourse is installed to a different location
## Bluepill setup ## Bluepill setup