Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing Rails and Redmine in Ubuntu 16.04 LTS / Linux Mint 18
# Make sure you have already installed apache and mysql;
# see https://gist.github.com/rotexdegba/d0cab757b5194a58c93db5ab6df7dc67
# for instructions.
# install rails
# https://help.ubuntu.com/lts/serverguide/ruby-on-rails.html
sudo apt install rails
# install comman dependencies
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev make libmysqlclient-dev imagemagick \
libmagickcore-dev libmagickwand-dev
#install passenger mod for apache to run rails
sudo apt-get install libapache2-mod-passenger
sudo mkdir -p /opt/redmine
# download redmine and move it (e.g `sudo mv /download/path/redmine-3.3.1 /opt/redmine/`) to
# /opt/redmine so we get some thing like /opt/redmine/redmine-3.3.1
# then cd /opt/redmine/redmine-3.3.1
# Run the SQL statement below; Don't forget to replace your_password_here with the password that you specified in the
# config/database.yml file while you were configuring the database for Redmine.
CREATE DATABASE redmine CHARACTER SET UTF8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
sudo mv ./config/database.yml.example ./config/database.yml
# edit ./config/database.yml with the correct db credential values
sudo gem install bundler
bundle install --without development test
# create a secret token for the Redmine session
bundle exec rake generate_secret_token
# Next, we need to create the structure (tables, indexes, and so on) of the Redmine database:
RAILS_ENV=production bundle exec rake db:migrate
# Finally, we need to insert initial data (such as trackers, the administrator account, and so on) into the database:
RAILS_ENV=production bundle exec rake redmine:load_default_data
# Now Configure Apache
cd /etc/apache2
# Now, create the redmine.conf file in the sites-available subdirectory with the following content (do this under root):
<VirtualHost *:3000>
RailsEnv production
DocumentRoot /opt/redmine/redmine-3.2.0/public
<Directory "/opt/redmine/redmine-3.2.0/public">
Allow from all
Require all granted
</Directory>
</VirtualHost>
# This is the configuration of the virtual host that will run Redmine. However, this is not the only virtual host that we currently have.
# Please note that Redmine, which is installed and configured this way, is going to run from your user account.
# If you prefer to use another user, www-data, for example, you need to add PassengerDefaultUser www-data
# to your virtual host configuration, and change the owner of the redmine-3.2.0 directory by executing
# chown www-data:www-data /opt/redmine/redmine-3.2.0 -R.
# enable the redmine.conf
sudo a2ensite redmine
# add port 3000 to the /etc/apache2/ports.conf file like so:
Listen 3000
# restart apache
sudo service apache2 reload
# Good books for redmine:
# https://www.packtpub.com/networking-and-servers/mastering-redmine-second-edition
# https://www.packtpub.com/big-data-and-business-intelligence/redmine-cookbook
# Follow instructions here http://www.redmine.org/projects/redmine/wiki/RedmineInstall
@leguminator

This comment has been minimized.

Copy link

leguminator commented Jul 25, 2017

Thanks for that precious, clean, neat and precise installation procedure !
Should be referenced directly by redmine.org ;)

@mihaikelemen

This comment has been minimized.

Copy link

mihaikelemen commented Mar 24, 2018

Very nice.

One thing on downloading redmine, the svn can be used to grab the files: svn co https://svn.redmine.org/redmine/branches/3.4-stable /opt/redmine (assuming that svn is available on the server, if not just run apt -y install subversion)

@RecNes

This comment has been minimized.

Copy link

RecNes commented Jun 13, 2018

You have to change extension to .txt, .sh extension has made me to try run this as shell script but it's failed.

@6temflex

This comment has been minimized.

Copy link

6temflex commented Dec 18, 2018

Hi
do you know id we have to do it with a specific user ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.