Redmine的安装与配置

云消雨歇 贡献于2013-09-12

作者   创建于2018-01-20 02:45:26   修改者  修改于2018-01-20 02:45:26字数5430

文档摘要: Redmine在项目实施中的作用在于作为项目管理的工具。Redmine是一个RubyonRails工程,因此需要先安装RubyonRails环境,另外,可通过Passenger将Redmine通过Apache对外提供服务,因此,需要安装Passenger并在Apache中进行配置。
关键词:

 Redmine的安装与配置     * Redmine的安装与配置     * Purpose     * Requirements     * Operating system     * Software     * Version     * Install Purpose Redmine 在项目实施中的作用在于作为项目管理的工具。Redmine 是一个 Ruby on Rails 工程,因此需要先安装 Ruby on Rails 环境,另外,可通过 Passenger 将Redmine通过Apache对外提供服务,因此,需要安装 Passenger 并在 Apache 中进行配置。可从 这里 下载相关的gem。 Requirements Operating system CentOS 5.3 Software     * Apache     * MySQL Version     * ruby-1.8.7-p174     * rubygems-1.3.5     * actionpack-2.2.2     * activerecord-2.2.2     * activeresource-2.2.2     * activesupport-2.2.2     * actionmailer-2.2.2     * fastthread-1.0.7     * rails-2.2.2     * redmine-0.8.4     * passenger-2.2.2 Install 1. 使用 root 用户登录系统 2. 下载 attachment:ruby-1.8.7-p174.tar.gz 、 attachment:rubygems-1.3.5.tgz 、 attachment:actionpack-2.2.2.gem 、 attachment:activerecord-2.2.2.gem 和 attachment:activeresource-2.2.2.gem 、 attachment:activeresource-2.2.2.gem 、 attachment:activesupport-2.2.2.gem 、 attachment:actionmailer-2.2.2.gem 、 attachment:fastthread-1.0.7.gem 、 attachment:rails-2.2.2.gem 、 attachment:passenger-2.2.2.gem mkdir -p /usr/local/src/redmine/ruby-on-rails cd /usr/local/src/redmine/ruby-on-rails wget http://.../ruby-1.8.7-p174.tar.gz wget http://.../rubygems-1.3.5.tgz wget http://.../actionpack-2.2.2.gem wget http://.../activerecord-2.2.2.gem wget http://.../activeresource-2.2.2.gem wget http://.../activesupport-2.2.2.gem wget http://.../actionmailer-2.2.2.gem wget http://.../fastthread-1.0.7.gem wget http://.../rails-2.2.2.gem wget http://.../passenger-2.2.2.gem cd /usr/local/src/redmine wget http://.../redmine-0.8.4.tar.gz 3. 安装ruby cd /usr/local/src/redmine/ruby-on-rails tar xzvf ruby-1.8.7-p174.tar.gz chown -R root.root ruby-1.8.7-p174 cd ruby-1.8.7-p174 ./configure --prefix=/usr/local/ruby make make install 7. 设置系统路径和手册 编辑 /etc/profile , 加入 RUBY_HOME=/usr/local/ruby PATH=$PATH:$RUBY_HOME/bin export RUBY_HOME PATH 运行下面命令重新载入环境变量 source /etc/profile 编辑 /etc/man.config ,加入mysql的手册路径 MANPATH /usr/local/ruby/share/man 4. 安装gems cd /usr/local/src/redmine/ruby-on-rails tar xzvf rubygems-1.3.5.tgz chown -R root.root rubygems-1.3.5 cd rubygems-1.3.5 ruby setup.rb 5. 安装rails所需插件 gem install rails -v=2.2.2 -V 或者 cd /usr/local/src/redmine/ruby-on-rails gem install actionmailer-2.2.2.gem -V gem install actionpack-2.2.2.gem -V gem install activerecord-2.2.2.gem -V gem install activeresource-2.2.2.gem -V gem install activesupport-2.2.2.gem -V gem install rails-2.2.2.gem -V 6. 安装passenger gem install passenger -v=2.2.2 -V 或者 cd /usr/local/src/redmine/ruby-on-rails gem install fastthread-1.0.7.gem -V gem install passenger-2.2.2.gem -V APXS2=/usr/local/apache/bin/apxs passenger-install-apache2-module 7. 设置环境变量 vi /etc/profile 在其中添加 RUBY_HOME=/usr/local/ruby PATH=$PATH:$ANT_HOME/bin:$MYSQL_HOME/bin:$RUBY_HOME/bin export RUBY_HOME PATH 运行 source /etc/profile 8. 创建mysql数据库 mysql -u root -p mysql mysql>create database redmine character set utf8; mysql>create user 'redmine'@'localhost' identified by '密码'; mysql>grant all on redmine.* to 'redmine'@'localhost'; 9. 创建redmine用户 groupadd -g 5003 redmine useradd -g redmine -s /bin/bash -d /home/redmine -m -u 5003 redmine chown redmine.httpd /home/redmine chmod 750 /home/redmine mkdir /home/redmine/www chown redmine.redmine /home/redmine/www chmod 755 /home/redmine/www 10. 安装redmine cd /home/redmine/www su - redmine -c "svn co http://redmine.rubyforge.org/svn/trunk /home/redmine/www/redmine" 或者 cd /usr/local/src/redmine tar xzvf redmine-0.8.4.tar.gz chown -R redmine.redmine redmine-0.8.4 mv redmine-0.8.4 /home/redmine/www/redmine 11. 配置数据库连接 cd /home/redmine/www/redmine/config cp database.yml.example database.yml chown redmine.redmine database.yml vi database.yml 修改其内容 production:   adapter: mysql   database: redmine   host: localhost   port: 3306   username: redmine   password: 密码   encoding: utf8 12. 配置邮件服务器 cd /home/redmine/www/redmine/config cp email.yml.example email.yml chown redmine.redmine email.yml vi email.yml 修改其内容 production:   delivery_method: :smtp   smtp_settings:     address: smtp.263xmail.com     port: 25     domain: ilantu.com     authentication: :login     user_name: 邮件账号     password: 邮件密码 Notes: 如果需要使用Gmail作为SMTP服务器,需要额外的配置,请参考 在Redmine中配置使用Gmail 。 13. 初始化redmine的数据 sudo su - redmine cd /home/redmine/www/redmine rake db:migrate RAILS_ENV="production" rake redmine:load_default_data RAILS_ENV="production" Notes:     * rake redmine:load_default_data RAILS_ENV="production" 时语言选择 zh 14. 手工启动以测试 使用 redmine 用户登录 cd /home/redmine/www/redmine-0.8.4 ruby script/server webrick -e production     * 服务启动后即可以通过 http://localhost:3000 进行访问     * 注意防火墙设置,启动前检查 3000 端口是否已经被占用 15. 配置通过apache访问redmine ln -s /home/redmine/www/redmine/public /home/httpd/www/redmine vi /usr/local/apache/conf/httpd.conf 加入 LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so     PassengerRoot /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.2     PassengerRuby /usr/local/ruby/bin/ruby     PassengerUserSwitching on     ServerName wxren.dysdns.org     DocumentRoot /home/httpd/www             RailsBaseURI /redmine     Notes:     * 配置apache使用passenger使用redmine后,无须手工启动redmine,服务的启动均由passenger自动完成     * passenger运行redmine时使用的用户由 /home/redmine/www/redmine-0.8.4/config/environment.rb 的 owner 决定,在本配置中,此文件的属主为 redmine ,因此passenger自动使用redmine用户运行redmine     * 如果发现 httpd 启动时无法加载 passenger,原因是无法找到apr的lib,例如 /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/ApplicationPoolServerExecutable: error while loading shared libraries: libapr-1.so.0: cannot open shared object file: No such file or directory,可以 vi /etc/ld.so.conf.d/apr.conf /usr/local/apr/lib /usr/local/apr-util/lib ldconfig 16. 处理redmine的日志 vi /etc/logrotate.d/redmine 其内容为 /home/redmine/www/redmine-0.8.4/log/production.log  {   notifempty   missingok   rotate 30   daily   copytruncate   compress   delaycompress   postrotate     # reset ownership to comply with directory’s permissions     chown redmine.redmine /home/redmine/www/redmine-0.8.4/log/production.log.*   endscript }

下载文档到电脑,查找使用更方便

文档的实际排版效果,会与网站的显示效果略有不同!!

需要 2 金币 [ 分享文档获得金币 ] 1 人已下载

下载文档