由于Redmine V3.4.5版本于2020-04-07官方结束其生命周期(EOL),同时相应数据库MYSQL及RUBY也EOL;故对Redmine等组建进行升级。
迁移前:
Redmine v3.4.5
ruby 2.4.4p296
MYSQL 5.5.68-MariaDB
迁移后:
Redmine v4.1.1
ruby 2.6.6
MYSQL mysql-5.7.32
一、部署MYSQL,并完成数据导入
1.升级httpd
# yum update httpd
# systemctl status httpd.service
# cd /etc/httpd/conf.d/
# mv ssl.conf ssl.conf.org
# systemctl start httpd.service
# systemctl status httpd.service
2.安装MYSQL
下载MYSQLRPM包,解压bundle包,参考common-libs-client-server-devel完成各RPM包安装
# wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.32-1.el7.x86_64.rpm-bundle.tar
# tar -xvf mysql-5.7.32-1.el7.x86_64.rpm-bundle.tar
# rm mysql-5.7.32-1.el7.x86_64.rpm-bundle.tar
# rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
# rpm -ivh mysql-community-common-5.7.32-1.el7.x86_64.rpm
# rpm -ivh mysql-community-libs-5.7.32-1.el7.x86_64.rpm
# rpm -ivh mysql-community-libs-compat-5.7.32-1.el7.x86_64.rpm
# rpm -ivh mysql-community-client-5.7.32-1.el7.x86_64.rpm
# rpm -ivh mysql-community-server-5.7.32-1.el7.x86_64.rpm
# rpm -ivh mysql-community-devel-5.7.32-1.el7.x86_64.rpm
确认安装目录
# ll /etc/my.cnf
# ll /etc/my.cnf.d/
# ll /var/lib/mysql
# ll /var/lib/mysql-files
# ll /var/lib/mysql-keyring
# ll /var/log/mysqld.log
# ll /var/run/mysqld/
3.MYSQL启动并设置自启动
# systemctl start mysqld.service
# systemctl status mysqld.service
# netstat -anop|grep 3306
# systemctl enable mysqld.service
# ps -ef|grep mysql
4.查看数据库root用户初始化密码,并创建redmine数据库用户
# grep 'temporary password' /var/log/mysqld.log
2021-03-16T09:36:32.530040Z 1 [Note] A temporary password is generated for root@localhost: <E,3aJrrI?pq
# mysql -uroot -p
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.00 sec)
mysql> alter user root@localhost identified by 'redmine';
Query OK, 0 rows affected (0.01 sec)
mysql> create database redmine_db;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on redmine_db.* to redmine@'localhost' identified by 'password';
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
mysql>CREATE USER 'redmine'@'%' IDENTIFIED BY 'redmine';
mysql>
mysql> use mysql
mysql> update user set authentication_string="redmine" where user="redmine";
Query OK, 1 row affected (0.01 sec)
mysql> flush privileges;
5.导出既存redmine数据库中数据,导入新的MYSQL数据库中
# mysqldump -uredmine -p redmine_db >redmine_db.db
# mysql -u root -p --default-character-set=utf8 redmine_db < /home/ffcsope/redmine_db.d
二、安装RUBY
1.创建rvm.sh
# curl -L https://get.rvm.io | bash
# source /etc/profile.d/rvm.sh
2.ruby2.6.6安装
# rvm install 2.6.6
# ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
三、安装Redmine
1.下载Redmine-4.1.1
# curl -LO http://www.redmine.org/releases/redmine-4.1.1.tar.gz
# tar -zxvf redmine-4.1.1.tar.gz -C /var/www/
# cd /var/www/
# ln -s redmine-4.1.1 /var/www/redmine
# cd /var/www/redmine/config/
2.配置Redmine
# vi database.yml
production:
adapter: mysql2
# database name
database: redmine_db
host: localhost
# database user
username: redmine
# password for user above
password: redmine
encoding: utf8
# cd /var/www/redmine
# gem install bundler
# bundle install --without development test
# bundle exec rake generate_secret_token
# bundle exec rake db:migrate RAILS_ENV=production
3.安装passenger
# gem install passenger
# passenger-install-apache2-module
* Checking for C compiler...
Found: yes
Location: /bin/cc
* Checking for C++ compiler...
Found: yes
Location: /bin/c++
* Checking for Curl development headers with SSL support...
Found: no
Error: Cannot find the `curl-config` command.
* Checking for Zlib development headers...
Found: yes
Location: true
* Checking for Apache 2...
Found: yes
Location of httpd: /sbin/httpd
Apache version: 2.4.6
* Checking for Rake (associated with /usr/local/rvm/gems/ruby-2.6.6/wrappers/ruby)...
Found: yes
Location: /usr/local/rvm/gems/ruby-2.6.6/wrappers/rake
* Checking for OpenSSL support for Ruby...
Found: yes
* Checking for RubyGems...
Found: yes
* Checking for Ruby development headers...
Found: yes
Location: /usr/local/rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby.h
* Checking for rack...
Found: yes
* Checking for OpenSSL development headers...
Found: yes
Location: true
* Checking for Apache 2 development headers...
Found: no
* Checking for Apache Portable Runtime (APR) development headers...
Found: no
* Checking for Apache Portable Runtime Utility (APU) development headers...
Found: no
Installation instructions for required software
* To install Curl development headers with SSL support:
Please install it with yum install libcurl-devel
* To install Apache 2 development headers:
Please install it with yum install httpd-devel
* To install Apache Portable Runtime (APR) development headers:
Please install it with yum install apr-devel
* To install Apache Portable Runtime Utility (APU) development headers:
Please install it with yum install apr-util-devel
If the aforementioned instructions didn't solve your problem, then please take
a look at our documentation for troubleshooting tips:
https://www.phusionpassenger.com/library/install/apache/
https://www.phusionpassenger.com/library/admin/apache/troubleshooting/
# yum install libcurl-devel
# yum install httpd-devel
# yum install apr-devel
# yum install apr-util-devel
# passenger-install-apache2-module
# vi /etc/httpd/conf.d/passenger.conf
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.6.6/gems/passenger-6.0.7/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.6.6/gems/passenger-6.0.7
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.6.6/wrappers/ruby
# chown -R apache. /var/www/redmine
配置/etc/httpd/conf.d/redmine.conf
# vi /etc/httpd/conf.d/redmine.conf
<VirtualHost *:80>
ServerName 127.0.0.1
DocumentRoot /var/www/redmine/public
<Directory /var/www/redmine/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
# systemct restart httpd.service
参考URL:
⇒MYSQL
https://blog.csdn.net/wudinaniya/article/details/81094578
https://blog.csdn.net/vkingnew/article/details/82710533
⇒Redmine
https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Installing-Redmine
https://www.jianshu.com/p/44a4e5c01b41
https://www.cnblogs.com/panwenbin-logs/p/10174525.html
https://qizhanming.com/blog/2020/04/16/how-to-install-and-config-redmine-4-on-centos-7
网友评论