2.4.3的安装细节和2.1.4稍有不同,把折腾了几天的安装过程记录下,仅供自行浏览使用。
- 先安装LAMP(Apache2, MySQL,PHP)
- apt-get install ruby1.8
- apt-get install rubygems
- apt-get install libmysqlclient-dev
- apt-get install apache2-threaded-dev
- 下载 redmine-2.4.3.tar.gz
- wget -i http://www.redmine.org/releases/redmine-2.4.3.tar.gz
- tar zxf redmine-2.4.3.tar.gz
- chmod 777 redmine-2.4.3
- gem install bundler
- bundle install --without development test postgresql sqlite rmagick
- mysql -uroot -p
- create database redmine character set utf8;
- create user 'redmine'@'localhost' identified by 'redmine';
- grant all privileges on redmine.* to 'redmine'@'localhost';
- 修改数据库配置文件
- cd config
- cp database.yml.example database.yml
- vim database.yml (修改database.yml文件如下:)
production:adapter: mysql2
database: redmine
host: localhost
username: redmine
password: redmine
encoding: utf8
- 修改configuration文件
- cp configuration.yml.example configuration.yml
- vim configuration.yml(修改configuration.yml文件如下:)
#default 部分default:# Outgoing emails configuration (see examples above)email_delivery:delivery_method: :smtpsmtp_settings:address: 127.0.0.1port: 25domain: localhostauthentication: :loginuser_name: "redmine@localhost"password: "redmine"
#production 部分 (如果内容被注释,在文档地方找到production:复制相关的内容即可)production:email_delivery:delivery_method: :smtpsmtp_settings:address: 127.0.0.1port: 25domain: localhost
- Session store secret generation
- cd ..
- rake generate_secret_token #生成config/initializers/secret_token.rb文件,在redmine-2.4.3中,这个文件事先是不存在的,如果事先有,删除。
- 初始化数据库,创建表
- RAILS_ENV=production rake db:migrate #创建表
- RAILS_ENV=production rake redmine:load_default_data #插入缺省数据,选择zh
- 在redmine中创建以下目录并赋予读写权限
- mkdir tmp tmp/pdf public/plugin_assets
- chmod 777 files log tmp public/plugin_assets
- 跟apache整合
- 安装Passenger的nginx的模块:
- sudo apt-get install libcurl3-dev
- gem install passenger
- passenger-install-apache2-module(安装成功后提示见附1)
- touch /etc/apache2/sites-enabled/redmine.conf
- 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>
- 安装Passenger的nginx的模块:
- 重启Apache:
/etc/init.d/apache2 restart - 浏览测试:浏览器中输入: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>
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:参考资料: