1、搭建虚拟环境,在虚拟机上安装centos7版本
centos 7.0百度云下载链接
提取码:c13p
2、一键安装部署
3、安装步骤
(假设已把下载文字放入服务器的/home目录下),以安装4.0.3版本为例,在centos6.5安装会报错,故选用centos7。
赋予执行权限
chmod +x bitnami-redmine-4.0.3-0-linux-x64-installer.run
# 执行
./bitnami-redmine-4.0.3-0-linux-x64-installer.run
接着按提示安装即可。成功截图如下 :
4、防火墙开启80端口(开放Linux的对外访问的端口80,3306)
centos7.0开启防火墙方法
centos7版本对防火墙进行 加强,不再使用原来的iptables,启用firewall
启动:
systemctl start firewalld
关闭:
systemctl stop firewalld
查看状态:
systemctl status firewalld
开机禁用 :
systemctl disable firewalld
开机启用 :
systemctl enable firewalld
那怎么开启一个端口:
firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent永久生效,没有此参数重启后失效)
重新载入:
firewall-cmd --reload
查看:
firewall-cmd --zone= public --query-port=80/tcp
删除:
firewall-cmd --zone= public --remove-port=80/tcp --permanent
centos7以下版本
开放80,22,8080 端口
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
保存
/etc/rc.d/init.d/iptables save
查看打开的端口
/etc/init.d/iptables status
关闭防火墙
1) 永久性生效,重启后不会复原
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后复原
开启: service iptables start
关闭: service iptables stop
5、设置成开机自启动
cp -piv /opt/redmine-4.0.3-0/ctlscript.sh /etc/rc.d/init.d/bitnami-redmin
cd /etc/rc.d/init.d/
vi bitnami-redmin
在#!/bin/sh下面添加:
# chkconfig:2345 80 30
# description: BitNami Service
保存退出后添加启动配置项即可。
chkconfig --add bitnami-redmin
chkconfig --list bitnami-redmin
6、访问redmine
访问服务器的ip(ifconfig的ipv4地址),如192.168.1.144/,后面加redmine
http://192.168.1.114/redmine 或 http://127.0.0.1/redmine
登录名和密码是安装时设置的账号及密码。mysql登录的root用户密码与这里账号密码为同一个(注意)。
7、重启redmine
sh /opt/redmine-[version]/ctlscript.sh restart
8、插件安装
1.)Go to plugins folder
$ cd /opt/redmine-[version]/apps/redmine/htdocs/plugins
2). Copy plugin there
3). Unarchive plugin
$ unzip redmine_agile-[version]-pro.zip
4). Run use_redmine script
$ cd ../../../
$ ./use_redmine
$ cd apps/redmine/htdocs
5). Intall required gems
To avoid gem freezing during installation use option --no-deployment
$ bundle install --without development test --no-deployment
6). Migrate database
# 注意,如果报错不能使用root,则为 apps/redmine/htdocs赋予另外的用户权限,即可。当然可能镜像源问题,也会报错,多试几次,可能就可以了。
chown -R 用户名称 目录名称
bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
bundle exec rake redmine:plugins NAME=redmine_checklists RAILS_ENV=production
bundle exec rake redmine:plugins NAME=redmine_ckeditor RAILS_ENV=production
bundle exec rake redmine:plugins NAME=redmine_code_review RAILS_ENV=production
bundle exec rake redmine:plugins NAME=redmine_people RAILS_ENV=production
bundle exec rake redmine:plugins NAME=redmine_questions RAILS_ENV=production
bundle exec rake redmine:plugins NAME=redmine_zenedit RAILS_ENV=production
or run with:
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
7). Restart Redmine application
$ sudo /opt/redmine-[version]/ctlscript.sh restart
# demo:
$ sudo /opt/redmine-4.0.3-0/ctlscript.sh restart
9、查询日志功能是否开启
general_log:日志功能是否开启,默认关闭OFF
general_log_file:日志文件保存位置
SHOW VARIABLES LIKE 'general%';
set GLOBAL general_log='ON';
10. redmine mysql远程连接问题
问题:Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
具体的解决步骤如下:
找到并修改my.cnf文件。在不同的Linux系统下,my.cnf放在不同的位置。vim /etc/mysql/my.cnf
看看是否有绑定本地回环地址的配置,如果有,注释掉下面这段文字:(在文字之前加上#号即可)
# 查看my.cnf是否有本地绑定
cat my.cnf |grep "bind-address"
# 注释
sed -i s/bind-address=127.0.0.1/#bind-address=127.0.0.1/g my.cnf
# 重启redmine
sh ctlscript.sh restart
# 远程连接,nat网络地址,映射对应端口