From 73d6014d1021785ad8efbff07f60b4fcb6b54a9e Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 29 May 2013 00:07:26 -0400 Subject: [PATCH] documentation: merge & adapt suggestions from baus --- config/discourse.pill.sample | 31 ++++++++++++++++++------------- config/nginx.sample.conf | 12 ++++++------ docs/INSTALL-ubuntu.md | 15 +++++++-------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/config/discourse.pill.sample b/config/discourse.pill.sample index 1406a7fb3a4..592da646a4d 100644 --- a/config/discourse.pill.sample +++ b/config/discourse.pill.sample @@ -7,7 +7,12 @@ num_webs = ENV["NUM_WEBS"].to_i > 0 ? ENV["NUM_WEBS"].to_i : 4 # to debug use #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.uid = user @@ -52,18 +57,18 @@ Bluepill.application("your_app") do |app| end #debug instance - 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.pid_file = "#{rails_root}/tmp/pids/thin-debug.pid" - process.start_grace_time = 30.seconds - process.stop_grace_time = 10.seconds - process.restart_grace_time = 10.seconds - process.group = "thins" - process.uid = user - process.gid = group - process.daemonize = false - process.stdout = process.stderr = "#{rails_root}/log/thin-debug.log" - end +# 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.pid_file = "#{rails_root}/tmp/pids/thin-debug.pid" +# process.start_grace_time = 30.seconds +# process.stop_grace_time = 10.seconds +# process.restart_grace_time = 10.seconds +# process.group = "thins" +# process.uid = user +# process.gid = group +# process.daemonize = false +# process.stdout = process.stderr = "#{rails_root}/log/thin-debug.log" +# end app.process("sidekiq-worker") do |process| pidfile = "#{rails_root}/tmp/pids/sidekiq-worker.pid" diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index df7a0894f9e..f9fe3bbdf3f 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -1,8 +1,8 @@ upstream discourse { - server unix:/var/www/discourse/tmp/sockets/thin.0.sock; - server unix:/var/www/discourse/tmp/sockets/thin.1.sock; - server unix:/var/www/discourse/tmp/sockets/thin.2.sock; - server unix:/var/www/discourse/tmp/sockets/thin.3.sock; + server unix:/home/discourse/discourse/tmp/sockets/thin.0.sock; + server unix:/home/discourse/discourse/tmp/sockets/thin.1.sock; + server unix:/home/discourse/discourse/tmp/sockets/thin.2.sock; + server unix:/home/discourse/discourse/tmp/sockets/thin.3.sock; } server { @@ -12,14 +12,14 @@ server { gzip_min_length 1000; gzip_types application/json text/css application/x-javascript; - server_name meta.discourse.org; + server_name enter.your.web.hostname.here; sendfile on; keepalive_timeout 65; location / { - root /var/www/discourse/public; + root /home/discourse/discourse/public; location ~ ^/t\/[0-9]+\/[0-9]+\/avatar { expires 1d; diff --git a/docs/INSTALL-ubuntu.md b/docs/INSTALL-ubuntu.md index b388ea30627..8ade8f64660 100644 --- a/docs/INSTALL-ubuntu.md +++ b/docs/INSTALL-ubuntu.md @@ -178,7 +178,7 @@ Configure discourse: Edit discourse/config/database.yml -- change production db name to: `discourse_prod` +- change production db name if appropriate - change username/password if appropriate - set db_id if using multisite - 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 -- change application name from 'your_app' to however you want to distinguish this ('discourse') -- Add option to Bluepill.application: `":base_dir => ENV["HOME"] + '/.bluepill'"` -- 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`) +- change application name from 'discourse' if necessary +- Ensure appropriate Bluepill.application line is uncommented - search for "host to run on" and change to current hostname - note: clockwork should run on only one host Edit discourse/config/initializers/secret_token.rb + - uncomment secret_token line - replace SET_SECRET_HERE with secret output from 'rake secret' command in discourse directory - delete the lines below as per instructions in the file @@ -220,9 +219,9 @@ Initialize the database: 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;" -- modify root location to match installed location: "root /home/discourse/discourse/public;" +- 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 if discourse is installed to a different location ## Bluepill setup