Redmine3.6.4 安装和迁移说明

Redmine安装维护

环境说明:

  Ubuntu版本:20.04
  MySQL版本:Ver 14.14 Distrib 5.7.31
  Redmine版本:3.4.6.stable

一、安装

1.1官方文档

redmine安装官方文档

1.2安装步骤:
之前根据文档安装出来的还是3.6.4的版本,但是最近重装了一次发现是4.0.6的。两个版本之间区别就是4.0.6的附件和配置文件都默认放在/var/lib/redmine/default,3.6.4的文件都放在安装目录里面,所以不同版本之间迁移要注意这个问题。
	1. 安装Apache和相关插件
    	$ sudo apt-get install apache2 libapache2-mod-passenger
    2. 安装MySQL
    	$ sudo apt-get install mysql-server mysql-client
    3. 安装Redmie
    	$ sudo apt-get install redmine redmine-mysql
    4. 安装过程中先选择MySQL数据库,然后再指定redmine的密码和确认密码
    5. 安装所需插件,先确保已经安装gem
        $ sudo gem update
        $ sudo gem install bundler
	6. 配置Apache
    	6.1 在配置文件中添加一行PassengerDefaultUser www-data,如下图:
    	$ sudo vim /etc/apache2/mods-available/passenger.conf

Apache配置文件1

	7. 修改文件/etc/apache2/sites-available/000-default.conf,复制以下内容直接覆盖
        <VirtualHost *:80>
            # The ServerName directive sets the request scheme, hostname and port that
            # the server uses to identify itself. This is used when creating
            # redirection URLs. In the context of virtual hosts, the ServerName
            # specifies what hostname must appear in the request's Host: header to
            # match this virtual host. For the default virtual host (this file) this
            # value is not decisive as it is used as a last resort host regardless.
            # However, you must set it for any further virtual host explicitly.
            #ServerName www.example.com

            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/html/redmine

            # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
            # error, crit, alert, emerg.
            # It is also possible to configure the loglevel for particular
            # modules, e.g.
            #LogLevel info ssl:warn
            PassengerAppRoot /usr/share/redmine
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined

            # For most configuration files from conf-available/, which are
            # enabled or disabled at a global level, it is possible to
            # include a line for only one particular virtual host. For example the
            # following line enables the CGI configuration for this host only
            # after it has been globally disabled with "a2disconf".
            #Include conf-available/serve-cgi-bin.conf
		</VirtualHost>
		# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
	8. 创建符号链接
		$ sudo ln -s /usr/share/redmine/public/ /var/www/html/
	9. 创建并设置Gemfile.lock文件的所有权,以便apache的www-data用户可以访问它:
		$ sudo touch /usr/share/redmine/Gemfile.lock
		$ sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock
	10. 重启服务器
		$ sudo reboot
	12. 访问Redmie(之前创建的链接是不带虚拟目录的)
		例如:http://127.0.0.1
1.3报错信息处理
	1.500错误,重启Apache服务
		$ sudo service apache2 restart
	2.其他错误页面,自行百度解决或者重启服务器(一般情况下都是MySQL,Apache和配置的问题)
		$ sudo reboot

二、备份

	1.要备份的内容:
		附件:/usr/share/redmine/files
		配置文件:/usr/share/redmine/config/configuration.yml(有邮件相关的配置)
		         /usr/share/redmine/config/database.yml(数据库相关配置)
		如果安装了插件还需要备份:/usr/share/redmine/plugins
		数据库:
		$ sudo mysql -u用户名 –p密码 数据库名 > sql备份文件路径/文件名

三、环境迁移和还原(升级也是一样的道理)

3.1 环境本身未损坏,可以使用备份文件还原
	3.1.1 把备份的文件按照对应的路径覆盖回去
	3.1.2 还原数据库
		$ sudo mysql -u用户名 –p密码 数据库名 < sql备份文件路径/文件名
		例如:mysql -u root -p redmine < redmine.db.bak
	3.1.3 重启MySQL和Apache服务
		$ sudo systemctl restart mysql
		$ sudo service apache2 restart
3.2 环境已经损坏无法登录
	3.2.1 另找一台服务器安装redmine
	3.2.2 旧环境关机,把备份好的虚拟机文件上传到服务器
	3.2.3 还原备份的文件和数据库
	3.3.4 重启服务器

4. 注意

目前安装在Ubuntu20.04上的Redmine导出功能不可用,目前官网也找不到解决方案,请谨慎安装
如果要使用显示附件缩略图的功能,得安装ImageMagick才能正常使用在这里插入图片描述在这里插入图片描述

	直接在服务器上安装即可
	$ sudo apt-get install imagemagick
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

贝加尔湖一条鱼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值