mysql安装配置
 

redmine 部署过程

redmin官方文档写的太烂加上不熟悉ruby搞了半天,回到家后觉得还是记录下好,希望可以帮助有需要的人,少走弯路.

版本说明

下面的版本很重要
redmine 版本 3.3 官方竟然给了个百度云盘

wget http://olvimidkv.bkt.clouddn.com/redmine-3.3.0.tar.gz

系统版本 centos7.2

ruby 版本 2.3.3
gem 版本 2.6.12
rails 版本 4.2.6

准备工作

新装系统的话就更新下吧,不是的话,就尽量不要这样更新

yum update

安装epel源

yum install epel-release 

依赖

yum install curl-devel sqlite-devel libyaml-devel 

开始部署

ruby yum安装版本对不上 源码安装各种报错,应该是openssl版本低 于是不折腾了 直接rvm

安装rvm及ruby

rvm 可以安装管理多个ruby版本

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3    

curl -L https://get.rvm.io | bash -s stable

source /etc/profile.d/rvm.sh  #set up system environment for Ruby, 这步不可少

rvm reload   

rvm install 2.3.3

简单的使用

rvm list 查看ruby

rvm use 2.2.0  使用ruby

rvm install xxxx 安装一个版本的ruby

rvm remove  xxxx   卸载一个版本的ruby

安装rails及rake

上一步安装完成之后,下面的就很简单了.

如果嫌慢可以换阿里的源

gem source -r https://rubygems.org/
gem source -a http://mirrors.aliyun.com/rubygems/

安装

gem install rake -v 12.0.0
gem install rails -v 4.2.6

安装redmine

[root@ihuilian ~]#yum install -y mysql mysql-server
[root@ihuilian ~]#yum install -y mysql*
[root@ihuilian ~]# chkconfig mysqld on
[root@ihuilian ~]# service mysqld start
[root@ihuilian ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL! [root@ihuilian ~]# setenforce 0 [root@ihuilian ~]# mysql -uroot -hlocalhost -phuilian123
mysql> create database redmine_db character set utf8;
Query OK, 1 row affected (0.23 sec) mysql> create user 'redmine_admin'@'localhost' identified by 'redmine_pass'; mysql> grant all privileges on redmine_db.* to "redmine_admin"@"localhost";
Query OK, 0 rows affected (0.14 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) [root@ihuilian redmine]# tar zxf redmine-2.5.0.tar.gz [root@ihuilian redmine]# ln -sv redmine-2.5.0 redmine
[root@ihuilian redmine]# cd redmine/config
[root@ihuilian config]# cp database.yml.example database.yml
修改如下
production:
adapter: mysql2
database: redmine_db
host: 192.168.74.128
username: redmine_admin
password: "redmine_pass"
encoding: utf8 [root@ihuilian redmine]# bundle install

  

redmine 需要用到数据库,所以先装个mysql或者meriadb(centos7默认meriadb)
修改数据库默认字符为utf8
在数据库配置文件/etc/my.cnf(centos7在/etc/my.cnf.d/下面)的[mysqld]下面加上

character-set-server=utf8

然后启动数据库,创建一个数据库 redmine

用户名密码随意
权限如下,如果你用root这个就可以忽略.

grant all on redmine.* to redmine;
grant all on redmine.* to redmine @localhost;
set password for redmine@localhost=password('redmine');

把你下载的redmie解压放到需要放的目录下面,然后进入redmine/config,下面的操作都在这个目录下

cd  database.yml.example  database.yml

修改内容如下,数据库名不要擅自改,无论你用的是mysql还是meriadb

production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "redmine"
encoding: utf8

创建表,这一步会出现各种问题,如果按照上面的装的话,基本就没有什么问题了.

提示缺少ruby扩展,不想一个个装的话,在当前目录下

bundle install

然后

rake db:migrate RAILS_ENV="production"

载入配置

rake redmine:load_default_data RAILS_ENV="production"

这时候会提示你选择语言,输入:zh

为rails生产cookie秘钥

rake generate_secret_token

启动redmine

使用以下命令启动 -d 是把输出打印到后台,ruby使用绝对路径

/usr/local/rvm/rubies/ruby-2.3.3/bin/ruby /home/work/redmine/bin/rails server webrick -e production -d

这样会启动一个监听localhost的3000端口

可以使用

curl http://localhost:3000

检查,没问题的话,使用Nginx做个反向代理就可以了.

server {

    listen 80;
server_name redmine.xxx.com; access_log logs/redmine_access.log main;
error_log logs/redmine_error.log; location / {
proxy_pass http://localhost:3000;
} }

centos7 redmine安装过程的更多相关文章

  1. centos7 redmine安装过程(转载)

    redmine 部署过程 redmin官方文档写的太烂加上不熟悉ruby搞了半天,回到家后觉得还是记录下好,希望可以帮助有需要的人,少走弯路. 版本说明 下面的版本很重要redmine 版本 3.3 ...

  2. centos7 mysql-server 安装过程

    官网下载安装mysql-server # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -i ...

  3. Centos7 ZooKeeper 安装过程

    www.apache.org/dist/上可以下载Hadoop整个生态环境的组件,我下的Zookeeper3.4.6版本 我一般都是在一个虚拟机上将一.二步都做完,然后克隆出来,再到克隆出来的虚拟机上 ...

  4. Centos7 JDK安装过程中 解决java -version 报错: bash: /home/jdk1.8.0_161/bin/java: Permission denied

    1.执行Linux命令 -----vim /etc/profile  编辑profile  文件,在里面添加: #set java enviroment JAVA_HOME=/opt/JavaHome ...

  5. centos7.4安装过程

    开启CPU虚拟化 按到install CentOS7 按下tab 输入net.ifnames=0 biosdevname=0 先来一段文档v1 ============================ ...

  6. Centos7 nginx安装过程

    一.Centos版本: cat /etc/centos-release CentOS Linux release 7.1.1503 (Core) 二.nginx下载 官网:http://nginx.o ...

  7. GIMP(Linux下的Photoshop),Centos7下安装过程

    点当然是上官网:https://www.gimp.org/ 这英语看不懂,果断用谷歌的网页翻译. 点下载,就会有 看到这个,就点 下载一个安装的包 用命令行打上 [root@localhost 下载] ...

  8. RHEL-server-7.0-Linux-centos安装过程

    虚拟机centos7的安装过程 win10 ()vmware软件的时候,1.先关闭防火墙(杀毒软件),在安装vmware虚拟机.2.试着全装一下 vmware-14版本. 1. 打开VMware Wo ...

  9. Linux之centos7 VMware安装教程

    Linux系统安装 下面是centOS7的安装过程 VMware 系统搭建 1 新建虚拟机 2 选择自定义 3 选择稍后安装操作系统 4 选择操作系统的版本Linux centos64位 5 选择处理 ...

随机推荐

  1. Oracle面试题(基础篇)

    1. Oracle跟SQL Server 2005的区别? 宏观上: 1). 最大的区别在于平台,oracle可以运行在不同的平台上,sql server只能运行在windows平台上,由于windo ...

  2. delphi ADOQuery 开启本地缓存

    在开发 C/S 应该程序的时候,有时为了程序的运行提高效率. 需要使用 缓存功能: //ADO组件需要把 ADOQuery1.LockType:=ltBatchOptimistic; ADOQuery ...

  3. windows编程按小时生成日志文件

    这是一个简单的日志记录方法,为了避免单个日志文件过大,所以每个小时生成一个新的日志文件 注意:g_pLogPath 可以带路径,但是必须手动创建好路径,保证目录存在.而且要详细到log文件名,不能带后 ...

  4. BZOJ3261最大异或和——主席树

    题目描述 给定一个非负整数序列{a},初始长度为N. 有M个操作,有以下两种操作类型: 1.Ax:添加操作,表示在序列末尾添加一个数x,序列的长度N+1. 2.Qlrx:询问操作,你需要找到一个位置p ...

  5. BZOJ2124 等差子序列(树状数组+哈希)

    容易想到一种暴力的做法:枚举中间的位置,设该位置权值为x,如果其两边存在权值关于x对称即合法. 问题是如何快速寻找这个东西是否存在.考虑仅将该位置左边出现的权值标1.那么若在值域上若关于x对称的两权值 ...

  6. 网络流Dinic模板

    #include <iostream> #include <cstdio> #include <cstring> #include <queue> #d ...

  7. Debug时含有的子元素,在代码里获取不到的问题

    比如,Debug时如下图展示: 我想要获取的是:ansList.get(i).getComponent().getConnectorId() debug时明明有这个元素,但是当我写出来的时候却发现:a ...

  8. 【比赛】NOIP2018 总结

    一.考试过程 Day1: 先看了一遍题目,得到的结论是没有题是直接秒掉的,然后一道一道认真看. 看T1的时候开始并没想起来有一道原题,只是脑海中有一个印象,好像求差分和可以.然后自测了一下小样例,发现 ...

  9. 点分治模板(洛谷P4178 Tree)(树分治,树的重心,容斥原理)

    推荐YCB的总结 推荐你谷ysn等巨佬的详细题解 大致流程-- dfs求出当前树的重心 对当前树内经过重心的路径统计答案(一条路径由两条由重心到其它点的子路径合并而成) 容斥减去不合法情况(两条子路径 ...

  10. 利用Python攻破12306的最后一道防线

    各位同学大家好,我是强子,好久没跟大家带来最新的技术文章了,最近有好几个同学问我12306自动抢票能否实现,我就趁这两天有时间用Python做了个12306自动抢票的项目,在这里我来带着大家一起来看看 ...