`
xiaoheliushuiya
  • 浏览: 399990 次
文章分类
社区版块
存档分类
最新评论

Ubuntu12.04上安装redmine2.4.3

 
阅读更多

2.4.3的安装细节和2.1.4稍有不同,把折腾了几天的安装过程记录下,仅供自行浏览使用。


  1. 先安装LAMP(Apache2, MySQL,PHP)
  2. apt-get install ruby1.8
  3. apt-get install rubygems
  4. apt-get install libmysqlclient-dev
  5. apt-get install apache2-threaded-dev
  6. 下载redmine-2.4.3.tar.gz
    1. wget -ihttp://www.redmine.org/releases/redmine-2.4.3.tar.gz
  7. tar zxfredmine-2.4.3.tar.gz
  8. chmod 777redmine-2.4.3
  9. gem install bundler
  10. bundle install --without development test postgresql sqlite rmagick
  11. mysql -uroot -p
    1. create database redmine character set utf8;
    2. create user 'redmine'@'localhost' identified by 'redmine';
    3. grant all privileges on redmine.* to 'redmine'@'localhost';
  12. 修改数据库配置文件
    1. cd config
    2. cp database.yml.example database.yml
    3. vim database.yml (修改database.yml文件如下:)
      production:
      adapter: mysql2
      database: redmine
      host: localhost
      username: redmine
      password: redmine
      encoding: utf8
  13. 修改configuration文件
    1. cp configuration.yml.example configuration.yml
    2. vim configuration.yml(修改configuration.yml文件如下:)
      #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:复制相关的内容即可)
      production:
      email_delivery:
      delivery_method: :smtp
      smtp_settings:
      address: 127.0.0.1
      port: 25
      domain: localhost
  14. Session store secret generation
    1. cd ..
    2. rake generate_secret_token #生成config/initializers/secret_token.rb文件,在redmine-2.4.3中,这个文件事先是不存在的,如果事先有,删除。
  15. 初始化数据库,创建表
    1. RAILS_ENV=production rake db:migrate #创建表
    2. RAILS_ENV=production rake redmine:load_default_data #插入缺省数据,选择zh
  16. 在redmine中创建以下目录并赋予读写权限
    1. mkdir tmp tmp/pdf public/plugin_assets
    2. chmod 777 files log tmp public/plugin_assets
  17. 跟apache整合
    1. 安装Passenger的nginx的模块:
      1. sudo apt-get install libcurl3-dev
    2. gem install passenger
    3. passenger-install-apache2-module(安装成功后提示见附1)
    4. touch/etc/apache2/sites-enabled/redmine.conf
    5. redmine.conf的内容如下:
      LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
      <IfModule mod_passenger.c>
      PassengerRoot /var/lib/gems/1.8/gems/passenger-4.0.37
      PassengerDefaultRuby /usr/bin/ruby1.8
      </IfModule>

      Listen 3000
      <VirtualHost *:3000>
      ServerName localhost
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /home/hkr/Downloads/redmine-2.4.3/public
      <Directory /home/hkr/Downloads/redmine-2.4.3/public >
      # This relaxes Apache security settings.
      AllowOverride all
      # MultiViews must be turned off.
      Options -MultiViews
      </Directory>
      </VirtualHost>
  18. 重启Apache:
    /etc/init.d/apache2 restart
  19. 浏览测试:浏览器中输入:http://localhost:3000(默认登录用户名:admin,登录密码:admin)





附1:passenger-install-apache2-module安装成功后提示:
Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /var/lib/gems/1.8/gems/passenger-4.0.37
PassengerDefaultRuby /usr/bin/ruby1.8
</IfModule>

After you restart Apache, you are ready to deploy any number of web
applications on Apache, with a minimum amount of configuration!

Press ENTER to continue

附2:常见问题:
1.Could not find gem 'mysql2 (~> 0.3.11) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
root@hkr-VirtualBox:~/Downloads/redmine-2.4.3# apt-get install libmysqlclient-dev
解决:apt-get install libmysqlclient-dev

2.passenger-install-apache2-module遇到还未支持的组件:
解决:apt-get install apache2-threaded-dev


附3:参考资料:








分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics