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 ...
随机推荐
- python - 安装/解释器/变量
python的官网: https://www.python.org/ Python环境安装 Windows 安装https://www.python.org/downloads/windows/ Wi ...
- 棋盘格 测量 相机近似精度 (像素精度&物理精度)
像素精度计算 像素精度——一像素对应多少毫米——距离不同像素精度也不同 将棋盘格与相机CCD平面大致平行摆放,通过[每个点处的近似像素精度=相邻两个角点之间的实际距离(棋盘格尺寸已知)/ 棋盘格上检出 ...
- openresty跑定时任务配置、ngx.timer.every接口使用
openresty的定时任务是要跟worker绑定的.如果不绑定特定的worker,那么所有启动的woker都会去执行定时任务. 一般情况下默认绑定worker_id=0的,这样在nginx整个进程里 ...
- HBase 二次开发 java api和demo
1. 试用thrift python/java以及hbase client api.结论例如以下: 1.1 thrift的安装和公布繁琐.可能会遇到未知的错误,且hbase.thrift的版本 ...
- .htaccees什么鬼?怎么用?
.htaccess文件全称Hypertext Access(超文本入口).提供了针对目录改变配置的方法, 即,在一个特定的文档目录中放置一个包含一个或多个指令的文件, 以作用于此目录及其所有子目录.作 ...
- git pull和git merge区别&&Git冲突:commit your changes or stash them before you can merge. 解决办法
http://blog.csdn.net/sidely/article/details/40143441 原文: http://www.tech126.com/git-fetch-pull/ Git中 ...
- php集成财付通支付接口
<?phpif(!defined('DEDEINC')) exit('Request Error!');/** *财付通接口类 */class tenpay{ var $dsql; var $m ...
- centos7使用中文输入法
centos7自带中文输入法,可能我们在安装时会跳过选择汉语拼音,我们来重新设置一下吧 假如你在命令行界面,输入Ctrl+Alt+F1进入图形界面 点击左上角系统工具 --> 设置 --&g ...
- Tfs更新 TfsConfig
Start TfsJobAgent TfsServiceControl unquiesce 更新serviving状态 TfsConfig diagnose /scope:updates TfsCon ...
- 一个App项目设计开发完整流程
作为一个PHP程序猿想转行APP开发可不是件容易的事情,话说隔行如隔山,这隔着一层语言也是多东西需要学习啊,一直对APP开发很感兴趣,最近请教了几个做移动开发的朋友,看了很多的资料,决定把自己学到的东 ...