WebFaction
Community site: login faq
4
1

This is more a statement than a question but I would love to see the folks at Webfaction make an install script for the Discourse app here: discourse.org. That project is aiming to be the "Wordpress of forums" and they have an impressive v1 release. No web host so far has an easy way to get up and running with it - Webfaction could win a lot of new converts with this. The app relies on Rails / Postgres and Redis.

asked 19 Feb '13, 21:43

grid7
4112
accept rate: 0%


We do not often add new installers to our list of official installers, and when we do there has to be a high demand for them as we support all future releases. Other apps we are happy to support via tickets or the community forum. Discourse should be able to be installed, if you build the various required packages

Languages/Frameworks

Ruby on Rails - our documentation on RoR is here.

Ember.js - a Front-End JavaScript language, you should not need to install this on the server.

Databases

PostgreSQL - We provide posrgres as a shared/maintained server and you may build your own from source if needed.

Redis - Redis should be able to be installed by following its installation documentation altered as outlined in our 'building from source' documentation.

If you get stuck or have any questions post your progress here or in a support ticket and we would be happy to help.

permanent link

answered 20 Feb '13, 02:34

johns ♦♦
5.2k211
accept rate: 22%

The RAM requirement is worth noting also:

We also recommend a minimum 1 Gb RAM to host Discourse, though it may work with slightly less.

This means that it's likely that it would only run on our 1GB hosting plan.

(20 Feb '13, 20:06) seanf

+1 for install script for Discourse. No Ruby + Rails expertise available here to set it up manually.

(28 Feb '13, 01:02) epqrs

Hi,

I'm running an install of discourse into 1Gb plan on webfaction.

With help of install instruction of discourse, great support of webfaction (especially seanf), and some other tricks i find on the web, you can find a big tutorial to make this install here : post on discourse forum

I also paste the step here :

1) Create a new private PostgreSQL instance application via our control panel and make a note of its assigned port number and password. We name it XXXX for example here (needeed for database modification step 7)

2) Run the following command to create an empty PostgreSQL database for Discourse, replacing NNNNN with your DB port number and entering your DB server password when prompted:

createdb -h localhost -p NNNNN discourse_prod

Install extension Hstore and pg_trgm

psql -p NNNN -h localhost -d discourse_prod -c 'create extension hstore;

psql -p NNNN -h localhost -d discourse_prod -c 'create extension pg_tgrm;

3) Create a new 'custom app listening on port' application via our control panel to reserver a port for Redis. Make a note of the app's assigned port number.

4) Run the following commands to install and run Redis, replacing NNNNN with the your Redis port number.

cd ~
wget http://download.redis.io/releases/redis-2.6.16.tar.gz
tar redis-2.6.16.tar.gz
cd redis-2.6.16
make test
make PREFIX=$HOME install
redis-server --port NNNNN &

I find also a great tutorial to install redis on webfaction here :

5) Create a new Rails 4 application via our control panel. For this example, name the app "discourse". Assign the app to a website.

6) Run the following commands to install discourse:

cd ~/webapps/discourse
export GEM_HOME=$PWD/gems
export RUBYLIB=$PWD/lib
export PATH=$PWD/bin:$PATH
gem install bundler
git clone https://github.com/discourse/discourse.git
cd discourse
bundle install
cp config/database.yml.production-sample config/database.yml
cp config/redis.yml.sample config/redis.yml

7) Edit config/database.yml to set your database parameters:

You need to verify if the socket is good, here mine is /home/reyman/webapps/XXXX/run/.s.PGSQL.NNNNNN with NNNNN = port of database, and XXXX name of the app which contain private instance of postgresql.

production:
  adapter: postgresql
  database: discourse_prod
  username: reyman
  password: your_db_server_password
  port: NNNNN 
  host: localhost
  pool: 5       
  timeout: 5000
  host_names:
    - yourdomain.com # Update this to be the domain of your production site
   socket: /home/reyman/webapps/XXXX/run/.s.PGSQL.NNNNNN

8) Edit config/redis.yml to set your redis port:

defaults: &defaults
  uri: <%= uri = URI.parse(ENV['REDIS_PROVIDER_URL'] || "redis://localhost:NNNNN") %>
  host: <%= uri.host %>
  port: <%= uri.port %>
  password: <%= uri.password %>
  db: 0
  cache_db: 2

development:
  <<: *defaults

profile:
  <<: *defaults

test:
  <<: *defaults
  db: 1

staging:
  <<: *defaults

production:
  <<: *defaults

9) Populate your database:

cd ~/webapps/discourse/discourse
RAILS_ENV=production bundle exec rake db:migrate

10) Edit your nginx.conf to point it at discourse - you need to change the 'root' and 'rails_env' values:

 root               /home/reyman/webapps/discourse/discourse/public;
 rails_env          production;

11) Modify launching of nginx to add performance command, see into bash file here /home/reyman/webapps/discourse/bin/start in my case :

RUBY_GC_MALLOC_LIMIT=90000000 PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/reyman/bin RUBYLIB=/home/reyman/webapps/discourse/lib:$RUBYLIB TMPDIR=/home/reyman/webapps/discourse/tmp PASSENGER_TMPDIR=/home/reyman/webapps/discourse/tmp GEM_HOME=/home/reyman/webapps/discourse/gems /home/reyman/webapps/discourse/nginx/sbin/nginx -p /home/reyman/webapps/discourse/nginx/

12) Restart nginx:

~/webapps/discourse/bin/restart

Bonus, if you want to see memory usage on webfaction :

ps -u <username> -o pid,rss,command | awk '{print $0}{sum+=$2} END {print "Total", sum/1024, "MB"}

13) About sidekick and blupill which cannot run without rvm and root access, answer of support is here :

Instructions like https://github.com/lee-dohm/install-discourse and http://meta.discourse.org/t/successfully-daemonized-sidekiq-and-clockwork-on-ubuntu/6561/2 assume that you have root access to your server, which is not the case for your shared hosting account.

sidekiq and clockwork are Ruby gems, so you can install them like any other Ruby gem by following the instructions in our documentation: http://docs.webfaction.com/software/rails.html#installing-gems

As far as configuring them to work with discourse, I'm afraid I can't offer any assistance there. My recommendation is that you take this question to the discourse forums and make it clear to them that you need to get them running as an unprivileged user in a shared hosting environment.

At this time, it's not possible to run sidekiq and bluepill because they need rvm and root access, but it's not possible to have this on shared instance. So at this time, because sidekiq not run, my forum cannot send any mail :/

I wait a message of developper on the forum ...

permanent link
This answer is marked "community wiki".

answered 26 Oct '13, 08:51

reyman64
13515
accept rate: 25%

edited 26 Oct '13, 09:02

Any updates on sidekiq and bluepill?

(26 Apr '16, 04:05) cliper
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×107
×54
×8

question asked: 19 Feb '13, 21:43

question was seen: 4,598 times

last updated: 26 Apr '16, 04:05

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM