How to install Redmine

来源:互联网 发布:octave mac 编辑:程序博客网 时间:2024/06/05 17:10

Redmine depends on several packages.

  1. Mysql - current 5.7.17
  2. Ruby - current 2.8.18
  3. 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
                                                  • 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

                                                  • install bundle
                                                    • gem install bundler
                                                    • bundle install --without development test rmagick (under redmine project root folder)
                                                  • generate secret token
                                                    • bundle exec rake generate_secret_token
                                                  • create database schema object
                                                    • 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 &

                                                  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
                                                  tobe continued.

                                                  0 0
                                                  原创粉丝点击