安装libyaml

[root@ ~]#wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz -O /dist/dist/yaml-0.1.4.tar.gz
[root@ ~]#cd /dist/src/
[root@ ~]#tar zxf /dist/dist/yaml-0.1.4.tar.gz
[root@ ~]#cd yaml-0.1.4
[root@ yaml-0.1.4]#./configure
[root@ yaml-0.1.4]#make
[root@ yaml-0.1.4]#make install

安装 rvm

[root@ ~]#curl -#LO https://rvm.io/mpapis.asc
[root@ ~]#gpg --import mpapis.asc
[root@ ~]#curl -L get.rvm.io | bash -s stable
[root@ ~]#source /etc/profile.d/rvm.sh

rvm使用的简要说明

列出已知的 Ruby 版本

rvm list known

安装一个 Ruby 版本

rvm install 2.2.0 --disable-binary
这里安装了最新的 2.2.0, rvm list known 列表里面的都可以拿来安装。

切换 Ruby 版本

rvm use 2.2.0

设置为默认版本,这样一来以后新打开的控制台默认的 Ruby 就是这个版本

rvm use 2.2.0 --default

查询已经安装的ruby

rvm list

卸载一个已安装版本

rvm remove 1.8.7

在 rvm 控制下ruby版本的情况下,由 rubygem 安装的各种软件(例如:rails),统一在 /usr/local/rvm/gems/ruby-${version}/gems/目录下,由 rvm 命令统一调度。

gem 命令在 rvm install ${ruby version} 安装ruby时,就已经安装了:/usr/local/rvm/rubies/ruby-${version}/bin/gem

至于2.4.x版本的ruby,请先忽略它。


rvm 安装ruby2.2

ruby 错误

ossl_pkey_ec.c:816: error: ‘EC_GROUP_new_curve_GF2m’ undeclared (first use in this function)
ossl_pkey_ec.c:816: error: (Each undeclared identifier is reported only once
ossl_pkey_ec.c:816: error: for each function it appears in.)
make[2]: *** [ossl_pkey_ec.o] Error 1
make[2]: Leaving directory `/dist/src/ruby-1.9.3-p448/ext/openssl'
make[1]: *** [ext/openssl/all] Error 2
make[1]: Leaving directory `/dist/src/ruby-1.9.3-p448'
make: *** [build-ext] Error 2

centos新版本默认openssl的配置变更取消了对EC_xx的支持,取消编译安装ruby,使用rvm

[root@ ~]#rvm install 2.2.0 --disable-binary  # 安装2.2.0 版本的ruby
[root@ ~]#rvm use 2.2.0
Using /usr/local/rvm/gems/ruby-2.2.0
[root@ ~]#rvm list rvm rubies * ruby-1.9.3-p448 [ x86_64 ]
=> ruby-2.2.0 [ x86_64 ] # => - current
# =* - current && default
# * - default [root@ ~]#ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
[root@ ~]#rvm use 2.2.0 --default

Gems 源

taobao Gems 源已停止维护,现由 ruby-china 提供镜像服务

[root@ ~]# gem sources -a http://gems.ruby-china.org
http://gems.ruby-china.org added to sources
[root@ rubygems-2.1.7]# gem sources -l
*** CURRENT SOURCES *** http://gems.ruby-china.org

安装 rails 4.2

[root@ ~]# gem install rails -v=4.2
[root@ ~]# rails -v
Rails 4.2.0
[root@ ~]#

安装mysql模块

[root@ ~]# gem install mysql2

安装bundle

[root@ ~]# gem install bundler

安装Passenger

准备nginx编译环境

[root@ ~]#yum install gcc openssl-devel pcre-devel zlib-devel
[root@ ~]#wget http://pkgs.fedoraproject.org/repo/pkgs/gperftools/gperftools-2.0.tar.gz/13f6e8961bc6a26749783137995786b6/gperftools-2.0.tar.gz -O /dist/dist/gperftools-2.0.tar.gz
[root@ ~]# cd /dist/src/
[root@ src]# tar xf /dist/dist/gperftools-2.0.tar.gz
[root@ src]# cd gperftools-2.0/
[root@ gperftools-2.0]# ./configure
[root@ gperftools-2.0]# make
[root@ gperftools-2.0]# make install
[root@ gperftools-2.0]# echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
[root@ gperftools-2.0]# /sbin/ldconfig

安装passenger+编译nginx

[root@ ~]# gem  install  passenger
[root@ ~]# passenger-install-nginx-module
### 一些输出信息,提示如何安装 ###
Press Enter to continue, or Ctrl-C to abort.
# 回车继续
Which languages are you interested in?
# 要求选择语言
Use <space> to select.
If the menu doesn't display correctly, press '!' ‣ ⬡ Ruby
⬢ Python
⬢ Node.js
⬡ Meteor Do you want this installer to download, compile and install Nginx for you?
# 选择安装方式
1. Yes: download, compile and install Nginx for me. (recommended) The easiest way to get started.
A stock Nginx 1.10.2 with Passenger support, but with no other additional third party modules, will be installed for you to a directory of your choice. 2. No: I want to customize my Nginx installation. (for advanced users) Choose this if you want to
compile Nginx with more third party modules besides Passenger, or if you need to pass additional
options to Nginx's 'configure' script. This installer will 1) ask you for the location of the Nginx source code, 2) run the 'configure' script according to your instructions, and 3) run 'make install'. Whichever you choose, if you already have an existing Nginx configuration file,then it will be preserved. Enter your choice (1 or 2) or press Ctrl-C to abort: 2 -------------------------------------------- Where is your Nginx source code located? Please specify the directory: /dist/src/nginx-1.10.2
# 源码包路径
-------------------------------------------- Where do you want to install Nginx to? Please specify a prefix directory [/opt/nginx]: /usr/local/nginx
# 安装路径 Extra Nginx configure options Extra arguments to pass to configure script: --user=www --group=www --with-http_flv_module --with-google_perftools_module
# 编译选项 Nginx with Passenger support was successfully installed.
# 完成

编辑nginx的配置文件

http {
...
passenger_root /usr/local/rvm/gems/ruby-2.2.0/gems/passenger-5.1.2;
passenger_ruby /usr/local/rvm/gems/ruby-2.2.0/wrappers/ruby;
passenger_user www;
passenger_group www;
...
}

安装配置 redmine 3.2

安装 redmine

[root@ web]# cd /data/web/
[root@ web]# svn co https://svn.redmine.org/redmine/branches/3.2-stable redmine-3.2
[root@ web]# cd redmine-3.2/
[root@ redmine-3.2]# bundle install --without development test postgresql sqlite rmagick

配置数据库

mysql> create database redmine  character set utf8;
mysql> create user 'redmineuser'@'localhost' identified by 'na4#Z**c';
mysql> grant all privileges on `redmine_%`.* to 'redmineuser'@'localhost' ;
mysql> flush privileges; [root@ redmine-3.2]#vi config/database.yml
production:
adapter: mysql2
database: redmine
host: localhost
username: redmineuser
password: "na4#Z**"
encoding: utf8

生成数据库和admin用户

 # 生成秘钥
[root@ redmine-3.2]# rake generate_secret_token
# 初始化数据库
[root@ redmine-3.2]# RAILS_ENV="production" rake db:migrate
# 导入默认数据
[root@ redmine-3.2]# RAILS_ENV=production REDMINE_LANG=zh bundle exec rake redmine:load_default_data

配置nginx站点

[root@ redmine-3.2]# vim /data/conf/nginx/vhost/redmine.conf
server {
listen 80;
server_name redmine.test.com;
root /data/web/redmine-3.2/public;
passenger_enabled on;
access_log /data/logs/redmine.test.com.log main;
}

安装 knowledgebase插件

[root@ ~]# wget https://github.com/alexbevi/redmine_knowledgebase/archive/v3.2.0.tar.gz
[root@ ~]# mv v3.2.0 v3.2.0.tar.gz
[root@ ~]# tar xf v3.2.0.tar.gz
[root@ ~]# cp redmine_knowledgebase-3.2.0/ /data/web/redmine-3.2/plugins/redmine_knowledgebase -r
[root@ ~]# cd data/web/redmine-3.2
[root@ redmine-3.2]# bundle install --without development test postgresql sqlite rmagick
[root@ redmine-3.2]# RAILS_ENV="production" rake redmine:plugins:migrate NAME=redmine_knowledgebase

后台修改admin密码

默认管理员:admin ,密码:admin

[root@ ~]# cd /data/web/redmine-3.2/bin
[root@ bin]# ./rails console production
Loading production environment (Rails 4.2.7.1)
2.2.0 :001 > admin_user = User.find_by_login('admin')
=> #<User id: 1, login: "admin", hashed_password: "6ded810822e4e5ac56b1106dff4ce8ad582865f1", firstname: "Redmine", lastname: "Admin", admin: true, status: 1, last_login_on: nil, language: "", auth_source_id: nil, created_on: "2017-07-24 08:00:57", updated_on: "2017-07-24 08:00:57", type: "User", identity_url: nil, mail_notification: "all", salt: "478ff0cc9c4e8cc967239b5523121fcd", must_change_passwd: false, passwd_changed_on: nil>
2.2.0 :002 > admin_user.password = 'XXXX'
=> "wsjin2039"
2.2.0 :003 > admin_user.save
=> true
2.2.0 :006 > quit

FAQ

问题1:

[root@ ~]# passenger-status
/usr/local/rvm/gems/ruby-2.2.0/gems/bundler-1.14.5/lib/bundler/rubygems_ext.rb:45:in
`full_gem_path': uninitialized constant Bundler::Plugin::API::Source (NameError)

解决方式:

//升级gem
[root@ ~]# gem update --system

问题2:

/usr/local/rvm/gems/ruby-2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"

解决方式:

将/usr/local/rvm/gems/ruby-2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb
中的inodot重复变量注释掉一个

redmine3.2 的部署的更多相关文章

  1. [Redmine] Centos5上安装Redmine3.0+nginx+thin部署

    项目管理的需要所以安装Redmine,其实wiki放在上面也不错的. 首先是安装,ruby应用第一次装,把坑记住. nginx, mysql是已经安装好的,只需要配置, 结合nginx的部署方式很多, ...

  2. centos6.5部署redmine3.2

    ruby 2.1 + rails 4.2+ mysql 5.6 +centos6.5 + rvm 1.29 1.基本的软件环境 yum -y install libyaml-devel zlib-de ...

  3. redmine和svn server的部署

    作为一个程序猿,想要很好的管理自己项目和代码,我们需要一些工具做辅助. 项目管理工具redmine和代码版本管理工具 SVN(Subversion). 我们选择在虚拟机里面安装windows部署这两套 ...

  4. centos6.5搭建redmine3.4

    缺陷管理,对问题的持续跟踪!redmine很棒的基于ruby开发 Redmine部署架构  mysql+nginx+ruby+redmine 3.4.x 部署环境 centos 6.5 x64redm ...

  5. Ubuntu+Ruby+MySQL+Nginx+Redmine部署记录

    (2019年2月19日注:这篇文章原先发在自己github那边的博客,时间是2016年7月26日) 周五的时候老大布置了一个任务下来,要部署一个Redmine用于研发部,同时升级工作室的Redmine ...

  6. [原]CentOS7.2部署node-mapnik

    转载请注明表作者think8848及出处(http://think8848.cnblogs.com) node-mapnik依赖项中要求g++ >= 5, toolchain (>= GL ...

  7. 使用Visual Studio 2015 开发ASP.NET MVC 5 项目部署到Mono/Jexus

    最新的Mono 4.4已经支持运行asp.net mvc5项目,有的同学听了这句话就兴高采烈的拿起Visual Studio 2015创建了一个mvc 5的项目,然后部署到Mono上,浏览下发现一堆错 ...

  8. 通过Jexus 部署 dotnetcore版本MusicStore 示例程序

    ASPNET Music Store application 是一个展示最新的.NET 平台(包括.NET Core/Mono等)上使用MVC 和Entity Framework的示例程序,本文将展示 ...

  9. 结合Jexus + Kestrel 部署 asp.net core 生产环境

    ASP.NET Core 是微软的全新的框架.这一框架的目标 ︰ 跨平台 针对云应用优化 解除 System.Web 的依赖. 获得下面三个方面的优势,你可以把它认为是一个C# 版本的NodeJS: ...

随机推荐

  1. 【LeetCode每天一题】Longest Common Prefix(最长前缀)

    Write a function to find the longest common prefix string amongst an array of strings. If there is n ...

  2. mac xcode 常见配置

    1.报错:There are no schemes in workspace "..." 设置scheme共享,方法: 2.Build 文件夹是中间文件的保存地方,如何设置在工程目 ...

  3. linux 执行远程linux上的shell脚本或者命令以及scp 上传文件到ftp--免密码登陆

    场景:在linux A 上执行Linux B上的shell脚本和命令 步骤1.设置ssh免登陆 1.SSH无密码登录 # 本地服务器执行(A机器):生成密钥对 ssh-keygen -t dsa -P ...

  4. 24-Python3 OS

    24-Python3 OS ''' OS文件/目录方法 ''' ##os.access():检验权限模式 fo1 = open('/Users/ligaijiang/PycharmProjects/f ...

  5. Xgboost调参总结

    一.参数速查 参数分为三类: 通用参数:宏观函数控制. Booster参数:控制每一步的booster(tree/regression). 学习目标参数:控制训练目标的表现. 二.回归 from xg ...

  6. gcc 6.2.0/6.3.0/8.2.0 编译安装

    参考:http://www.linuxfromscratch.org/blfs/view/stable/general/gcc.html 下载地址在这里:https://ftp.gnu.org/gnu ...

  7. Xcode 运行 Signing for "XXXXXX" requires selecting either a development team or a provisioning profile. Select a development team or a provisioning profile in the project editor

    Signing for "XXXXXX" requires selecting either a development team or a provisioning profil ...

  8. sqli-labs(六)

    第十一关: 这关是一个登陆口,也是一个sql注入的漏洞,也就是常说的万能密码. 在输入框账号密码种分别输入 1'  和1'  页面会报错. 后台使用的单引符号进行的拼接.账号输入1' or '1'=' ...

  9. MyBatis基础入门《七》查询参数传入对象

    MyBatis基础入门<七>查询参数传入对象 描述: 在执行查询语句的时候,传入的参数是一个对象,依据对象的属性,进行检索数据.此时,书写SQL语句中的条件时,其参数需要和对象中的属性保持 ...

  10. Hadoop.之.入门部署

    一.课程目标 ->大数据是什么?大数据能做什么? ->什么是Hadoop?Hadoop的设计思想? ->Hadoop如何解决大数据的问题?(什么是hdfs与yarn.MapReduc ...