-
Make sure you have already installed apache and mysql;
-
install rails
sudo apt install rails- install common 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/redminedownload 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
Thanks for that precious, clean, neat and precise installation procedure !
Should be referenced directly by redmine.org ;)