Redmine depends on several packages.
- Mysql - current 5.7.17
- Ruby - current 2.8.18
- Redmine - 3.3.2
1. How to install and setup mysql
- if mysql exist, remove and upgrade it.
- rpm -qa | grep mysql
- rpm -e mysql-5.7.xxx --nodeps
- create mysql group and user
- groupadd mysql
- useradd -r -g mysql mysql (r because mysql is a system user , not a login user)
- install mysql
- wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar (download mysql tar.gz for 64 bit generic linux from )
- cd /usr/local
- tar -xvf mysql-5.7.17-linux-glibc2.5-x86_64.tar
- tar -zxvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
- mv mysql-5.7.17-linux-glibc2.5-x86_64 mysql
- chown -R mysql:mysql mysql
- cd mysql
- bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
- cp -a ./support-files/my-default.cnf /etc/my.cnf (if dir changes, please update content in my.cnf)
- cp -a ./supoort-files/mysql.server /etc/init.d/mysqld
- cd /bin
- ./mysqld_safe --user=mysql &
- /etc/init.d/mysqld restart , after this, mysql database initialized successfully.
- chkconfig --level 35 mysqld on, setup startup automatically
- cat /root/.mysql_secret
- ./mysql -uroot -p (input pwd list above)
- mysql > SET PASSWORD = PASSWORD('YOUR_PASSWORD');
- mysql > flush privileges;
- mysql > use mysql; // add remote access permission.
- mysql > update user set host = '%' where user = 'root';
- mysql > select host, user from user;
- /etc/init.d/mysqld restart
- modify charset. vim /etc/my.cnf
- character-set-server=utf8
- /etc/init.d/mysqld restart
- uninstall mysql
- /etc/init.d/mysqld stop
- chkconfig mysqld off
- chkconfig --del mysqld
- rm -rf /usr/local/mysql
- rm -f /etc/my.cnf
- rm -r /etc/inid.d/mysqld
- rm -r /root/.mysql_secret
- userdel -r mysql
2. How to install ruby 2.1.8
- install deps
- yum install gcc-c++ patch readline readline-devel zlib zlib-devel
- yum install libyaml-devel libffi-devel openssl-devel make
- yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel
- install and setup rvm
- curl -L get.rvm.io | bash -s stable (if key or cert error, gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3, then curl again)
- source /etc/profile.d/rvm.sh
- curl -L get.rvm.io | bash -s stable (if key or cert error, gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3, then curl again)
- install and setup rvm manually if rvm.io website is blocked
- mkdir rvm
- cd rvm
- gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
- curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer
- curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc
- gpg --verify rvm-installer.asc
- bash rvm-installer stable
- install and setup ruby 2.1.8
- rvm install 2.1.8
- rvm use 2.1.8 --default
- ruby --version
3. How to install redmine
- wget http://www.redmine.org/releases/redmine-3.3.2.tar.gz (http://www.redmine.org/projects/redmine/wiki/Download)
- unzip redmine-3.3.2.tar.gz
- create redmine db user.
- CREATE DATABASE redmine CHARACTER SET utf8;
- CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
- GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
- edit db config file
- Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment
production: adapter: mysql2 database: redmine host: localhost username: redmine password: my_password
- Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment
- install bundle
- gem install bundler
- bundle install --without development test rmagick (under redmine project root folder)
- gem install bundler
- generate secret token
- bundle exec rake generate_secret_token
- bundle exec rake generate_secret_token
- create database schema object
- RAILS_ENV=production bundle exec rake db:migrate
- RAILS_ENV=production bundle exec rake db:migrate
- startup redmine
- nohup bundle exec rails server -p 3000 -b 192.168.0.96 -e production > nohup.log 2>&1 &
- nohup bundle exec rails server -p 3000 -b 192.168.0.96 -e production > nohup.log 2>&1 &
4. How to backup and move redmine
just backup database 'redmine', and plugins, files, and yml files.
- backup database for redmine
- /usr/local/mysql/bin/mysqldump -uroot -p redmine > redmine.sql
- backup files
- tar -czvf files.tar.gz /opt/redmine/redmine3.3.1/files (images, xls and all docs are stored here)
- backup yml files
- cp redmine3.3.1/config/configuration.yml and redmine3.31/config/database.yml
- back plugins
- tar plugins folder, if error occurs, please refers to redmine3.3.1/log/production.log, and maybe you should rake migrate:plugins
- restore
- install ruby, mysql, and redmine on the new OS, following all the steps listed above.
- unzip plugins, files, and yml files
- /usr/local/mysql/bin/mysql -uroot -p redmine < redmine.sql
---------------------
available plugins for 3.x:
1. redmine_checklists
2. clipboard_image_paste
3. redmine_agile
4. redmine_vote
5. XML-Task-Importer MS Project
How to install agile plugin - redmine_agile
1. unzip redmine agile package, and copy redmine_agile to "plugins\"
2. bundle install --without development test --no-deployment
3. bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
4. restart
if ssl error occurs when bundle install, just modify source url from https to http in Gemfile
tobe continued.