Dear Visitor,

Since December 1st. 2016 we migrated our website after rebranding to www.redmineup.com. Please go there to find all current resources and support. This website and its content are no longer supported.

Your RedmineUP (RedmineCRM) Team

Read more »

Installing Redmine 2.5 + Passenger + nginx + rvm on Ubuntu 12.04 LTS and 14.04 LTS

Kirill Bezrukov
Added about 4 years ago

Screencast

Installing rvm (ruby version manager)

  sudo su
  apt-get install mysql-server libmysqlclient-dev git-core subversion imagemagick libmagickwand-dev libcurl4-openssl-dev 
  gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
  curl -L https://get.rvm.io | bash -s stable --ruby=2.0.0

Now, you should load the RVM

  source /usr/local/rvm/scripts/rvm
  echo '[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"' >> ~/.bashrc

Installing Phusion Passenger and Nginx

gem install passenger --no-ri --no-rdoc
passenger-install-nginx-module

Configuring nginx

git clone git://github.com/jnstq/rails-nginx-passenger-ubuntu.git
mv rails-nginx-passenger-ubuntu/nginx/nginx /etc/init.d/nginx
chown root:root /etc/init.d/nginx
update-rc.d nginx defaults
nano /opt/nginx/conf/nginx.conf

Replace server section for port 80

server {
  listen  80;
  server_name <your_server_domain_name>;
  root /var/data/redmine/public;
  passenger_enabled on;
  client_max_body_size      10m; # Max attachemnt size
}

Installing Redmine

 mkdir /var/data
 cd /var/data/
 svn co http://svn.redmine.org/redmine/branches/2.5-stable redmine
 cd /var/data/redmine

Database configuration

nano config/database.yml

Add following lines

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: redmine
  encoding: utf8

development:
  adapter: mysql2
  database: redmine 
  host: localhost
  username: redmine
  password: redmine
  encoding: utf8

Plugins installation

Unarchive plugins to /plugins/ folder

cd /var/data/redmine
bundle install

Configuring redmine

Setup redmine folder permissions

cd /var/data/redmine
mkdir public/plugin_assets
chown -R www-data:www-data files log tmp public/plugin_assets config.ru
chmod -R 755 files log tmp public/plugin_assets

Create database

mysql -u root -p

Execute following lines to MySQL

CREATE DATABASE redmine character SET utf8;
CREATE user 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL privileges ON redmine.* TO 'redmine'@'localhost';
exit

Migrate database

cd /var/data/redmine
bundle exec rake db:migrate
bundle exec rake redmine:plugins

Generate session store

bundle exec rake generate_secret_token 

Start web server

service nginx start

Restart Redmine

touch /var/data/redmine/tmp/restart.txt