redmine (rails) + puma + lighttpd

Running redmine with a lightweight ruby on rails/webserver stack on a debian server – puma and lighttpd:

Assumed you’ve got both redmine and lighttpd already installed:

  1. install puma gem:
    $ sudo gem install puma
  2. caution: ArgumentError on ruby 1.8.7
  3. get tools/jungle/init.d/puma to /etc/init.d/
  4. get tools/jungle/init.d/run-puma to /usr/local/bin/
  5. add a puma app:
    $ sudo /etc/init.d/puma add /your/app/path www-data
  6. $ sudo -u www-data mkdir /your/app/path/tmp/puma
  7. puma config in rails app /your/app/path/config/puma.rb
    1
    2
    3
    4
    5
    6
    7
    
    $ cat your/app/path/config/puma.rb
    environment 'production'
    pidfile File.expand_path( File.dirname(__FILE__) + "/../tmp/puma/pid" )
    state_path File.expand_path( File.dirname(__FILE__) + "/../tmp/puma/state" )
    threads 1,4
    port 8082
    activate_control_app
  8. $ grep puma /your/app/path/Gemfile.local
    gem "puma"
  9. lighttpd proxy config:
    1
    2
    
    $ grep 8082 /etc/lighttpd/conf-enabled/10-proxy.conf
    $HTTP["host"] == "redmine.example.com" { proxy.server = ( "" => (("host" => "127.0.0.1", "port" => 8082))) }
  10. $ sudo /etc/init.d/puma start
  11. $ sleep 5 ; cat /your/app/path/tmp/puma/state
  12. $ sudo update-rc.d -f puma defaults

Versions:

  • ruby: 1.8.7-p358 (2012-02-08) [x86_64-linux]
  • rails: 3.2.15
  • lighttpd: 1.4.28
  • puma: 2.7.1
  • redmine: 2.4.0

Flattr this!

Post a Comment

Your email is never published nor shared. Required fields are marked *