Redmine部署

发布时间:2020-07-22 13:48:53 作者:freeterman
来源:网络 阅读:1029

系统环境(最小化安装):

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.8 (Final)
Release:        6.8
Codename:       Final


系统更新
yum update

安装依赖包
yum install -y make apr-devel apr-util-devel \
zlib-devel curl-devel expat-devel gettext-devel \
openssl-devel httpd httpd-devel mysql mysql-server \
mysql-devel libxml2-devel libxslt-devel ImageMagick-devel

Redmine部署

部署ruby

wget http://zy-res.oss-cn-hangzhou.aliyuncs.com/ruby/ruby-2.3.3.tar.gzRedmine部署
tar zxvf ruby-2.3.3.tar.gz
cd ruby-2.3.3
yum install -y gcc*
./configure --prefix=/usr/local/ruby
make
make install

添加环境变量:
vi /etc/profile在未尾添加下面一行:

export PATH=/usr/local/ruby/bin:$PATH


使环境变量生效
source /etc/profile
检查一下安装是否成功,ruby版本号
ruby –v

安装zlib和openssl扩展
cd ruby-2.3.3/ext/zlib/
ruby extconf.rb && make && make install

cd ruby-2.3.3/ext/openssl/
ruby extconf.rb

vim Makefile
在64行添加

top_srcdir = ../..



make
make install

Redmine部署

部署rubygems

wget http://zy-res.oss-cn-hangzhou.aliyuncs.com/ruby/rubygems-2.6.8.tgzRedmine部署
tar zxvf rubygems-2.6.8.tgz
cd rubygems-2.6.8
ruby setup.rb

Redmine部署

部署redmine

wget http://zy-res.oss-cn-hangzhou.aliyuncs.com/redmine/redmine-3.3.1.tar.gzRedmine部署
tar zxvf redmine-3.3.1.tar.gz
mv redmine-3.3.1 /usr/local/redmine
chown -R apache: /usr/local/redmine/

修改database.yml配置文件
cp /usr/local/redmine/config/database.yml.example /usr/local/redmine/config/database.yml
vim /usr/local/redmine/config/database.yml

production:
adapter:mysql2
database:redmine_default //这就是我们后面在mysql里创建的redmine_default数据库
host:localhost
username:redmine  //这是我们为redmine数据库创建的用户
password:"redmine"  //这是用户访问redmine数据库需要的密码
encoding: utf8



看看是什么镜像的,默认的是rubygems.org
gem sources –l

删除原有的镜像
gem sources --remove https://rubygems.org/Redmine部署

将源镜改成ruby-china
gem sources -a https://gems.ruby-china.org/Redmine部署

安装bundler
gem install bindler

安装rdoc
gem install rdoc rdoc-data

安装rbpdf-font
gem install rbpdf-font

安装rails
gem install rails

编辑Gemfile,修改gem源
vim /usr/local/redmine/Gemfile

source 'https://gems.ruby-china.org/'



运行buldle install检查依赖
cd /usr/local/redmine/
bundle install

Redmine部署

建立数据库和用户

启动数据库,进入数据库
service mysqld start
mysql

创建数据库、用户
mysql> create database redmine_default character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'redmine';
mysql> grant all privileges on redmine_default.* to 'redmine'@'localhost';
mysql> flush privileges;

cd /usr/local/redmine/
删除 /usr/local/ruby/lib/ruby/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb 466行
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

启动redmine
ruby /usr/local/redmine/bin/rails server webrick -e production -d

Redmine部署

apache配置代理redmine

apache支持redmine
gem install passenger
passenger-install-apache2-module   一路回车

1、注释掉原有的ServerName,ServerAdmin,DocumentRoot的信息;
2、启用虚拟主机的支持,去掉NameVirtualHost *:80前面的#;
3、在配置文件的末尾加上:
在httpd.conf添加

LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/2.3.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/ruby/lib/ruby/gems/2.3.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/local/ruby/bin/ruby
</IfModule>



添加redmine配置文件
vim /etc/httpd/conf.d/redmine.conf

<VirtualHost *:80>
ServerName www.redmine.comRedmine部署
DocumentRoot /usr/local/redmine/public
ErrorLog logs/redmine_error_log
<Directory "/usr/local/redmine/public">
Allow from all
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>


推荐阅读:
  1. redmine问题集锦02
  2. redmine如何添加qq邮箱功能

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

redmine mi

上一篇:华为防火墙VRRP双机热备的原理及实例配置

下一篇:nginx中出现图片显示过慢,下载不完全的问题怎么办

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》