搭建redmine全攻略——与apache整合(CentOS 5.8 64位)
2012-12-20 21:12
323 查看
前言
redmine(http://www.redmine.org/)是一款项目管理软件,由ruby编写,以网页的形式呈现。正好公司需要单独搭建一套这个系统,与其说是搭建,更应该说是升级。任务:①在阿里云服务器上搭建redmine系统,我用的最新版redmine 2.1.4
②导入之前同事用redmine1.2.0搭建的数据,使用的是MySQL数据库。
安装
Step 1 - Redmine application首先是软件的下载地址:redmine 2.1.4、ruby 1.8.7、rubygems 1.8.24
redmine: http://rubyforge.org/frs/?group_id=1850 rubygems: http://rubyforge.org/frs/?group_id=126&release_id=46730 ruby: ftp://ftp.ruby-lang.org/pub/ruby/1.8/[/code]
需要安装的软件包ruby-1.8.7.tar.gz ruby-libs-1.8.5 #(or later version) ruby的依赖包,虽然ruby版本版本是1.8.7,但是经过我的测试这个可以用1.8.5的,可以用yum安装,命令yum install ruby-libs。 rubygems-1.8.24.tgz redmine-2.1.4.tar.gz
安装Ruby、RubyGemstar zxf ruby-1.8.7.tar.gz cd ruby-1.8.7 ./configure --prefix=/usr/local/rubytar xf rubygems-1.8.24.tgz cd rubygems-1.8.24 ruby setup.rb
加入ruby环境变量(这里有个疑惑是应该加在/root/.bash_profile里还是/etc/bashrc里)vim /root/.bash_profile PATH=$PATH:$HOME/bin:/usr/local/ruby/bin source /root/.bash_profile
安装redminetar zxf redmine-2.1.4.tar.gz chown -R apache.apache redmine-2.1.4 cd redmine-2.1.4
Step 2 - Dependencies installationgem install bundler #安装bundler,好处是不需要使用gem 一个一个的安装模块,坏处的不能控制版本。官网http://gembundler.com/ bundle install --without development test postgresql sqlite rmagick #without就是不安装这几个模块,其他都安装。
Step 3 - Create an empty database and accompanying user
MySQL下执行(MySQL要事先安装好,版本5.0及以上,可以直接使用yum安装,yum install mysql mysql-server mysql-devel)create database redmine character set utf8; create user 'redmine'@'localhost' identified by 'redmine';#在数据库中创建redmine用户,密码也是redmine grant all privileges on redmine.* to 'redmine'@'localhost';
Step 4 - Database connection configurationcd 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
保存退出cp configuration.yml.example configuration.yml vim configuration.yml #配置邮件通知,前提是安装好sendmail或者postfix,同样可以用yum安装
修改:#default 部分 default: # Outgoing emails configuration (see examples above) email_delivery: delivery_method: :smtp smtp_settings: address: 127.0.0.1 port: 25 domain: localhost authentication: :login user_name: "redmine@localhost" password: "redmine"#production 部分 production: email_delivery: delivery_method: :smtp smtp_settings: address: 127.0.0.1 port: 25 domain: localhost
Step 5 - Session store secret generationcd .. rake generate_secret_token #生成config/initializers/secret_token.rb文件,在redmine 2.1.4中,这个文件事先是不存在的,如果事先有,删除掉。
Step 6 - Database schema objects creationRAILS_ENV=production rake db:migrate #初始化数据库,创建表
Step 7 - Database default data setRAILS_ENV=production rake redmine:load_default_data #插入缺省数据,选择zh
Step 8 - File system permissionsmkdir tmp tmp/pdf public/plugin_assets #主要是修改文件夹权限,如果有了可以不创建,只修改权限和属主 chown -R apache:apache files log tmp public/plugin_assets chmod -R 755 files log tmp public/plugin_assets
Step 9 - bind with apache #跟apache整合,需要安装httpd、httpd-develgem install passenger #安装apache模块 passenger-install-apache2-module touch /etc/httpd/conf.d/redmine.conf
在redmine.conf中写入内容(这个根据实际情况复制,passenger-install-apache2-module命令执行成功会有提示)LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.18/ext/apache2/mod_passenger.so PassengerRoot /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.18 PassengerRuby /usr/local/ruby/bin/rubyListen 3000 <VirtualHost *:3000> ServerName server.example.com #换成你自己的主机名 # !!! Be sure to point DocumentRoot to 'public'! DocumentRoot /opt/redmine-2.1.4/public <Directory /opt/redmine-2.1.4/public > # This relaxes Apache security settings. AllowOverride all # MultiViews must be turned off. Options -MultiViews </Directory> </VirtualHost>
启动apache/etc/init.d/httpd restart #启动apache,这样redmine也就启动了
Step 10 - Finish !Visit the URLhttp://server.example.com:3000/
备注,下面的命令可能是以后备份数据库和更行redmine的插件数据库需要的:
导出mysql数据库内容mysqldump -uroot -ppassword redmine --lock-all-tables >redmine.sql
导入数据库内容mysql -uroot -ppassword redmine <redmine.sql
更新redmine数据库rake generate_secret_token rake db:migrate RAILS_ENV=production rake redmine:plugins:migrate RAILS_ENV=production常见问题:
①解决redmine中导出项目问题时候报错。如下
Error with the Atom/PDF/CSV export function
I have find the problem:
Array(Mime[parameters[:format]])
the Array() method is not working, which require
method: to_ary
solution:
1. actionpack (3.2.6) lib/action_dispatch/http/mime_negotiation.rb:55
change from Array(Mime[parameters[:format]])
to Array.wrap(Mime[parameters[:format]])
②插件安装
在官网上下载相关插件,将redmine插件解压,整个目录复制到redmine根目录的plugins目录下
然后执行rake redmine:plugins:migrate RAILS_ENV=production就OK了。它会在数据库中建立相关的表。
相关文章推荐
- 搭建redmine全攻略——与apache整合(CentOS 5.8 64位)
- centos6.3-64位搭建LAMP环境之安装apache2.4.7
- Centos7.3_64位安装Apache2.4_mysql5.7_php5.4(阿里云LAMP php环境搭建图文教程)
- CentOS 6.5搭建Apache整合SVN 1.8.5服务器(多版本库权限配置)
- CentOS6.5 64位 下 搭建 Java+Apache-Tomcat+MongoDB的环境
- CentOS6.6下安装Redmine2.6(整合Apache2.4)
- 在centos6.4上安装redmine 整合apache
- centos 5.8 64位 安装apache+mysql+php 笔记
- CentOS6.5系统搭建Apache服务器
- subversion+apache+mysql环境搭建(centOS5.2)(一)
- centos5.6下 PHP5.4.0 安装笔记--整合apache 与php
- centos apache服务器搭建
- SVN搭建CentOS + Subversion + Apache + Jsvnadmin
- 在CentOS下企图整合Apache和Tomcat依然失败
- CentOS Apache+Tomcat 整合配置(两种办法)
- CentOS,Apache和Resin的整合
- centos6.0 下apache+tomcat整合笔记
- Centos 下搭建SVN + Apache 服务器(转载)
- centos7 搭建lamp(Apache PHP Mysql环境)
- centos6.2-x86_64-bin整合apache和tomcat构建Web服务器