本文基于上述官网方案,进行Redmine的快速安装,并介绍与git库的集成,项目的管理。
安装
- 下载
# cd /usr/local/src/
# wget https://bitnami.com/redirect/to/422826/bitnami-redmine-4.0.1-0-linux-x64-installer.run
- 修改bitnami-redmine-4.0.1-0-linux-x64-installer.run的执行权限
# chmod +x bitnami-redmine-4.0.1-0-linux-x64-installer.run
- 执行bitnami-redmine-4.0.1-0-linux-x64-installer.run实施安装
3.1 (补充)解决缺少Perl Data::Dumper 组件问题
./bitnami-redmine-4.0.1-0-linux-x64-installer.run
Warning: MySQL requires some Perl modules in order to install properly, but the
installer was unable to find them:
Data::Dumper
You can find more information on how to install these modules below:
https://docs.bitnami.com/installer/faq/linux-faq/administration/install-perl-linu
x/
Please ensure the modules are installed and work before proceeding with the
installation.
执行下面的命令安装
# which perl
/usr/bin/perl
# perl -MData::Dumper -e 'print "Data::Dumper is installed\n"'
Can't locate Data/Dumper.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
# yum install perl perl-Data-Dumper -y
3.2 (补充) 在小内存服务器上安装
Bitnami Redmine Stack requires at least 2000MB of memory and the installer has detected 985MB of memory. This may prevent the application from installing, working properly or cause it to stop functioning due to lack of memory. Visit the following link to learn how to increase the swap space.
https://bitnami.com/lowmemory
参考官方文档,需要增加swap空间,以下命令都是root账号执行
# free -m
total used free shared buff/cache available
Mem: 985 96 375 12 513 725
Swap: 0 0 0
# dd if=/dev/zero of=/mnt/swap.0 bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 3.06636 s, 350 MB/s
# mkswap /mnt/swap.0
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=474c5099-9096-4076-9f3d-129365a2f363
# echo "/mnt/swap.0 swap swap defaults 0 0" >> /etc/fstab
# swapon /mnt/swap.0
swapon: /mnt/swap.0: insecure permissions 0644, 0600 suggested.
# swapon -s
Filename Type Size Used Priority
/mnt/swap.0 file 1048572 0 -2
# free -m
total used free shared buff/cache available
Mem: 985 95 75 12 814 723
Swap: 1023 0 1023
3.3 执行安装
# ./bitnami-redmine-4.0.1-0-linux-x64-installer.run
Language Selection
Please select the installation language
[1] English - English
[2] Spanish - Español
[3] Japanese - 日本語
[4] Korean - 한국어
[5] Simplified Chinese - 简体中文
[6] Hebrew - עברית
[7] German - Deutsch
[8] Romanian - Română
[9] Russian - Русский
Please choose an option [1] : 5
----------------------------------------------------------------------------
欢迎使用 Bitnami Redmine Stack 安装向导。
----------------------------------------------------------------------------
选择您想要安装的组件,清除您不想安装的组件。当您准备继续时,点击“前进”。
Subversion [Y/n] : n
PhpMyAdmin [Y/n] : Y
Redmine : Y (Cannot be edited)
Git [Y/n] : Y
上述选择是否正确? [Y/n]: Y
----------------------------------------------------------------------------
安装文件夹
请选择安装Bitnami Redmine Stack的文件夹
选择一个文件夹 [/opt/redmine-4.0.1-0]:
----------------------------------------------------------------------------
创建管理员帐户
Bitnami Redmine Stack admin 用户创建
您的真实姓名 [User Name]: admin
Email地址 [user@example.com]: admin@test.com
登录 [user]: admin
密码 :
请确认密码 :
----------------------------------------------------------------------------
Web服务器端口
Choose a port that is not currently in use, such as port 444.
SSL 端口 [444]:
----------------------------------------------------------------------------
MySQL信息
请输入MySQL数据库信息
Choose a port that is not currently in use, such as port 3308.
MySQL服务端口 [3308]:
----------------------------------------------------------------------------
缺省数据配置语言
选择缺省数据配置语言:
[1] Bosnian
[2] 保加利亚语
[3] Catalan
[4] 捷克语
[5] Danish
[6] 德语
[7] 英语
[8] 西班牙
[9] 法语
[10] Galician
[11] 希伯来语
[12] Hungarian
[13] 意大利语
[14] 日语
[15] 朝鲜语
[16] Lithuanian
[17] 荷兰语
[18] Norwegian
[19] 波兰语
[20] 葡萄牙语
[21] 罗马尼亚语
[22] 俄语
[23] Slovak
[24] Slovenian
[25] 塞尔维亚语
[26] 瑞典语
[27] Turkish
[28] Ukrainian
[29] Vietnamese
[30] 中文
请选择选项 [30] :
Do you want to configure mail support? [y/N]: N
----------------------------------------------------------------------------
安装程序已经准备好将 Bitnami Redmine Stack 安装到您的电脑。
您确定要继续吗? [Y/n]: Y
----------------------------------------------------------------------------
正在安装 Bitnami Redmine Stack 至您的电脑中,请稍候。
正在安装
0% ______________ 50% ______________ 100%
#########################################
----------------------------------------------------------------------------
安装程序已经将 Bitnami Redmine Stack 安装于您的电脑中。
启动Redmine应用程序。 [Y/n]: Y
- 修改Redmine的端口号
用Bitnami安装Redmine后,默认使用80端口提供服务,我们接下来改一下端口,方便发布到公网
4.1 修改properties.ini
# cd /opt/redmine-4.0.1-0
# vi properties.ini
找到
[Apache]
apache_server_port=80
改成
[Apache]
apache_server_port=9999
# vi apache2/conf/httpd.conf
4.2 修改apache2端口
# vi apache2/conf/httpd.conf
找到
Listen 80
改成
Listen 9999
4.3 修改apache2启动脚本
# vi apache2/conf/bitnami/bitnami.conf
找到
NameVirtualHost *:80
修改为
NameVirtualHost *:9999
找到
<VirtualHost _default_:80>
修改为
<VirtualHost _default_:9999>
4.4 修改apache2命令的提示
# vi apache2/scripts/ctl.sh
找到
echo "$0 $ARG: httpd started at port 80"
修改为
echo "$0 $ARG: httpd started at port 9999"
- 重启Redmine,通过9999端口访问测试
# ./ctlscript.sh restart
Syntax OK
/usr/local/redmine-4.0.1-0/apache2/scripts/ctl.sh : httpd stopped
/usr/local/redmine-4.0.1-0/mysql/scripts/ctl.sh : mysql stopped
/usr/local/redmine-4.0.1-0/mysql/scripts/ctl.sh : mysql started at port 3307
Syntax OK
/usr/local/redmine-4.0.1-0/apache2/scripts/ctl.sh : httpd started at port 4041
-
访问 127.0.0.1:9999
效果如下图
安全配置
毕竟我们不是做开源项目,所以还是希望只有授权用户才能访问我们的项目和代码,所以需要在配置中打开认证访问控制。操作如下图。