Ubuntu+apache安装redmin
公司要迁移redmin,本来以为是一个很简单的项目,想不到整整搞了一天加一个晚上。
首先是对ruby的安装不熟悉,现在明白了ruby的安装顺序是先安装rvm版本管理,然后用rvm安装ruby,安装好后会自动安装上版本管理软件gem,用gem安装passenger之后再安装bundler,用bunde安装其他的依赖包,实际上bundle也是在调用gem,不过比手动执行gem方便多了,不得不说ruby这rvm版本管理是挺先进的,可以自由安装任何版本的ruby,bundle可以自动根据gem文件安装软件的依赖包。
奈何redmine这个软件的版本兼容性太差了,redmin只能在老版本ruby下运行,第一次装的2.3版本ruby下redmine无法运行,只能倒回去用rvm list找出来当前的ruby版本,用rvm remove 2.3.0卸载掉ruby和一连串的gem、bundle然后重新装。官网上的建议是使用ruby 2.0.0安装,可是那是两年前的issue了,现在nokogiri 1.7.1必须在ruby2.1.2以上安装,最新的passenger5.0.8依赖的rack,会自动安装最新的2.0.1版本,要求ruby2.2.2以上,看似这就是一个死结,最后是安装ruby 2.1.2和老版本的passenger rack来解决的。
顺便说一句redmine是一个日本人写的,看来果然是日本人喜欢用ruby,中国人喜欢用python。而且日本人做事太认真,版本卡得这么死我们想马虎一下都不行……
redmine的下载地址请点击这里
以下是安装过程
0 切换到root
sudo su
1 依赖包
sudo apt-get install git-core subversion imagemagick libmagickwand-dev libcurl4-openssl-dev curl
sudo apt-get install apache2 libapache2-mod-passenger
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
2 安装ruby
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
curl -L https://get.rvm.io | bash -s stable --ruby=2.0.0
如果不成功就执行下两条,如果成功了就跳过
curl -sSL https://rvm.io/mpapis.asc | sudo gpg2 --import -
curl -L https://get.rvm.io | bash -s stable --ruby=2.0.0
然后安装ruby
source /usr/local/rvm/scripts/rvm
//这样就安装好rvm了
echo '[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"' >> ~/.bashrc
//这一步是改成国内的源
sed -i .bak 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
//然后安装ruby
rvm requirements
rvm install 2.1. //必须是这个版本
3 安装redmine
tar -xvf redmine-2.5.
cd redmine-2.5.
gem install bundler //安装bundler,好处是不需要使用gem 一个一个的安装模块,坏处的不能控制版本。官网http://gembundler.com/
bundle install
如果觉得bundle太慢,可以使用国内源
bundle config 'mirror.https://rubygems.org' 'https://ruby.taobao.org'
//或者在gem file中添加
source 'https://ruby.taobao.org'
4 准备数据库
create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'redmine';//在数据库中创建redmine用户,密码也是redmine
grant all privileges on redmine.* to 'redmine'@'localhost';
5 配置数据库连接
cd config
cp database.yml.example database.yml //配置redmine连接MySQL
vim database.yml
//修改为:
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: redmine
encoding: utf8
//其他参考此项
6 Session store secret generation(放到最后再做也行)
cd ..
rake generate_secret_token //生成config/initializers/secret_token.rb文件,在redmine 2.1.4中,这个文件事先是不存在的,如果事先有,删除掉。
7 Database schema objects creation(没有亲测过,我直接以前安装的拷贝的表)
RAILS_ENV=production rake db:migrate //初始化数据库,创建表
8 Database default data set(没有亲测过,我直接以前安装的拷贝的表)
RAILS_ENV=production rake redmine:load_default_data //插入缺省数据,选择zh
9 File system permissions
这一步根据实际情况来
mkdir tmp tmp/pdf public/plugin_assets //主要是修改文件夹权限,如果有了可以不创建,只修改权限和属主
chown -R apache:apache files log tmp public/plugin_assets
chmod -R files log tmp public/plugin_assets
10 安装passenger并和apache整合
安装passenger
gem install passenger
如果安装passenger失败了,提示ruby版本不对,就按照以下操作安装老版本
gem install rack -v 1.6.
gem install passenger -v 5.0.
整合apache
passenger-install-apache2-module
//安装passenger时会提示,以下内容是根据提示安装的
//在/etc/apache2/mods-available/passenger.conf中覆盖
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-5.0.8
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby</IfModule>
//在/etc/apache2/mods-available/passenger.load中覆盖
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-5.0.8/buildout/apache2/mod_passenger.so
11 配置web目录
sudo ln -s /redmine安装目录/public /var/www/html/redmine
//在 /etc/apache2/sites-available/000-default.conf中配置
<Directory /var/www/html/redmine>
Options -MultiViews
PassengerAppEnv development
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
Order deny,allow
allow from all
</Directory>
12 启动apache
如果这一步失败了,提示PassengerAppEnv RailsBaseURI找不到,看看第一步的apt-get libapache2-mod-passenger安装好了没有
13 注意事项
执行 touch /redmin安装目录/tmp/restart.txt就是重启passenger
如果后台报错
ActionView::Template::Error (The single-table inheritance mechanism failed to locate the subclass: 'GroupNonMember'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Principal.inheritance_column to use another column for that information.):
那这个是因为数据库表结构和版本不兼容导致的,重新导一下表结构吧
如果在日志中提示ArgumentError (A secret is required to generate an integrity hash for cookie session data. Use config.secret_token = "some secret phrase of at least 30 characters"in config/initializers/secret_token.rb):
那就生成secret key
在redmine目录中执行
bundle exec rake generate_secret_token
14 Congratulations!

Ubuntu+apache安装redmin的更多相关文章
- Ubuntu apache安装,配置,卸载
阿里云服务器等记得到控制台开启防火墙 安装 sudo apt-get update sudo apt-get install apache2 配置 apache2 默认的几个配置文件 /etc/apa ...
- ubuntu apache 安装awstats 流量分析工具(命令方式)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...
- 转:CentOS/Debian/Ubuntu一键安装LAMP(Apache/MySQL/PHP)环境
CentOS/Debian/Ubuntu一键安装LAMP(Apache/MySQL/PHP) 今天遇到一个网友提到需要在Linux VPS服务器中安装LAMP(Apache/MySQL/PHP)网站环 ...
- 在Ubuntu下安装Apache
在Ubuntu下安装软件其实非常方便,Ubuntu提供了apt-get工具,可以使用该工具直接下载安装软件. 在Linux里,系统最高权限账户为root账户,而默认登录的账户并非root账户,例如不具 ...
- Ubuntu 下Apache安装和配置
在Ubuntu上安装Apache,有两种方式:1 使用开发包的打包服务,例如使用apt-get命令:2 从源码构建Apache.本文章将详细描述这两种不同的安装方式. 方法一:使用开发包的打包服务—— ...
- 基于Ubuntu Server 16.04 LTS版本安装和部署Django之(二):Apache安装和配置
基于Ubuntu Server 16.04 LTS版本安装和部署Django之(一):安装Python3-pip和Django 基于Ubuntu Server 16.04 LTS版本安装和部署Djan ...
- Ubuntu 下Apache安装和配置2
在Ubuntu上安装Apache,有两种方式:1 使用开发包的打包服务,例如使用apt-get命令:2 从源码构建Apache.本文章将详细描述这两种不同的安装方式. 方法一:使用开发包的打包服务—— ...
- Ubuntu中安装配置 JDK与apache
一,前期准备: 1.下载apach网址:https://tomcat.apache.org/download-90.cgi 3.下载:jdk网址:http://www.oracle.com/techn ...
- Ubuntu 14.04 apache安装配置
http://jingyan.baidu.com/article/6d704a130c8a0d28da51ca5f.html Ubuntu 14.04 apache安装配置 1.安装 ~# apt-g ...
随机推荐
- PHP Ajax跨域解决
PHP Ajax 跨域问题最佳解决方案 本文通过设置Access-Control-Allow-Origin来实现跨域. 例如:客户端的域名是client.runoob.com,而请求的域名是serve ...
- ActiveMQ 详解
1. 如何同步索引库 方案一: 在taotao-manager中,添加商品的业务逻辑中,添加一个同步索引库的业务逻辑; 缺点:业务逻辑耦合度高,业务拆分不明确; 方案二: 业务逻辑在taotato-s ...
- 【chainer框架】【pytorch框架】
教程: https://bennix.github.io/ https://bennix.github.io/blog/2017/12/14/chain_basic/ https://bennix.g ...
- django-网页视屏播放
基本都基于第三方: -cc视频 -播放免费视频 -收费视频 -需要做认证,cc视频会给你发消息,你返回,携带数据 -在前端页面中添加响应的视屏框的代码 -功能实现,有相关接口文档,配置即可
- Linux安装Java开发环境
一.JDK安装 安装JDK的实现步骤(使用root用户登录安装,避免需要对文件授权) (1)下载JDK,JDK的存放目录一般存放于 /opt目录下(Oracle官网下载jdk,需要accept lic ...
- PHP 语言结构(Language constructs)和函数的区别
相信大家经常看到对比一些PHP应用中,说用isset() 替换 strlen(),isset比strlen执行速度快等. 例子: if ( isset($username[5]) ) { // The ...
- vue的项目结构
一. 准备工作 1. 初始化项目 vue init webpack itany cd itany cnpm install cnpm install less less-loa ...
- Embedding SQLite in a c programm
Embedding SQLite in a c programm The following program demonstrates how to embed SQLite into ...
- Full List of NMD R1 Singapore 2017
The initial adidas NMD Singapore, which sparked a sneaker craze larger than the Three Stripes could' ...
- vue工程权限怎么配置?
vue工程权限怎么配置? router.beforeEach((to, from, next) => { }):方法的to参数能拿到router设置的对象信息,如: { path: " ...