Redmine搭建

# 命令

1、连接服务器

ssh root@ 192.168.0.250

2.下载Redmine

wget http://www.redmine.org/releases/redmine-3.4.3.tar.gz

3.首先启动MariaDB

systemctl start mariadb


查看MariaDB的状态

systemctl status mariadb

4.设置开机启动

systemctl enable mariadb

5.登陆mysql

mysql -u root -p

6.创建数据库

CREATE DATABASE redmine CHARACTER SET utf8;

CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';

GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';


7.解压redmine包

tar -zxvf redmine-3.4.3.tar.gz

8.拷贝 config/database.yml.example 为 config/database.yml

9.cp database.yml.example database.yml

10.编辑文件

vi database.yml

## 安装Ruby

1.安装开发工具

yum groupinstall "Development tools"

yum -y install zlib-devel curl-devel openssl-devel mysql-devel

2.上传到服务器上

打开ruby-2.4.2

sudo ./configure

sudo make

sudo make install


3.配置gem源

gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/

gem sources -l

## 安装Redmine

http://www.redmine.org/projects/redmine/wiki/RedmineInstall

安装bundle

gem install bundler

配置bundler源

bundle config mirror.https://rubygems.org https://gems.ruby-china.org

安装redmine依赖

bundle install --without development test rmagick

生成秘钥

bundle exec rake generate_secret_token

// 初始化数据库

RAILS_ENV=production bundle exec rake db:migrate

用以下命令配置为中文,输入zh

RAILS_ENV=production bundle exec rake redmine:load_default_data

设置权限

mkdir -p tmp tmp/pdf public/plugin_assets

sudo chown -R redmine:redmine files log tmp public/plugin_assets

sudo chmod -R 755 files log tmp public/plugin_assets

运行redmine

bundle exec rails server webrick -e production

添加gem puma到Gemfile

gem 'puma'

重新运行安装依赖

bundle install --without development test rmagick

参考:

https://github.com/puma/puma

##  安装Nginx

> 参考:blog.csdn.net/u012486840/article/details/52610320

添加Nginx到YUM源

sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

安装nginx

sudo yum install -y nginx

启动Nginx

sudo systemctl start nginx.service

开机启动

sudo systemctl enable nginx.service

设置启动80端口

firewall-cmd --zone=public --add-port=80/tcp --permanent

重启防火墙

systemctl restart firewalld.service

重载配置文件

nginx -s reload

unix:///develop/redmine-3.4.3/tmp/sockets/puma.sock

bundle exec puma -C config/puma.rb

bundle exec pumactl --state tmp/pids/puma.state stop

bundle exec pumactl --state tmp/pids/puma.state restart

## Docker 使用

安装Mysql

docker run -d --name some-mysql -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=redmine mysql

docker run -d --name some-redmine --link some-mysql:mysql redmine

你可能感兴趣的:(Redmine搭建)