|
Redmine是用Ruby开发的基于web的项目管理软件,当前版本是1.4,发布于2012-4-20。类似的系统有JIRA,BUGZILLA 等。
最初尝试Redmine 1.3时,用的Centos,但是Centos下的 gem insall 实在蛋疼,后在Ubuntu Server中安装配置成功。Redmine 1.4 的安装方式改进了,使用gembundler辅助,过程更加舒适,嘿嘿,但是不要高兴的太早,准备工作要做足。
本文摘录整理自 http://www.redmine.org/projects/redmine/wiki/RedmineInstall ,随着时间推移,此页面可能会更新,原始内容我会另外翻译一份。
Redmine 1.4 依赖的ruby软件包版本:
ruby
1.8.7 / 1.9.2 / 1.9.3 / jruby-1.6.7
Rails
2.3.14
RubyGems
create database redminedb character set utf8;
mysql> create user 'redmineuser'@'%'>
mysql> grant all privileges on redminedb.* to 'redmineuser'@'%';
3、下载redmine 1.4
本段内容摘录整理自 http://www.redmine.org/projects/redmine/wiki/Download
直接下载:
http://rubyforge.org/frs/download.php/76033/redmine-1.4.1.tar.gz
如果已经安装了svn,可以在命令行执行:
cares@ubuntu:~$ svn co http://redmine.rubyforge.org/svn/branches/1.4-stable redmine-1.4
Checked out revision 9530.
cares@ubuntu:~$ ls -l
total 8
-rwxr-xr-x 1 cares cares 178 2012-04-26 16:08 pre.sh
drwxrwxr-x 16 cares cares 4096 2012-04-26 10:42 redmine-1.4
二、配置redmine
1、把redmine复制到运行目录,我选择 /opt
cares@ubuntu:~$ sudo cp -r redmine-1.4 /opt
cares@ubuntu:~$ cd /opt/redmine-1.4
cares@ubuntu:/opt/redmine-1.4$ ll
total 84
drwxr-xr-x 16 root root 4096 2012-04-26 11:46 ./
drwxr-xr-x 3 root root 4096 2012-04-26 11:46 ../
drwxr-xr-x 8 root root 4096 2012-04-26 11:46 app/
drwxr-xr-x 6 root root 4096 2012-04-26 11:46 config/
drwxr-xr-x 4 root root 4096 2012-04-26 11:46 db/
drwxr-xr-x 3 root root 4096 2012-04-26 11:46 doc/
drwxr-xr-x 6 root root 4096 2012-04-26 11:46 extra/
drwxr-xr-x 3 root root 4096 2012-04-26 11:46 files/
-rw-r--r-- 1 root root 1898 2012-04-26 11:46 Gemfile
-rw-r--r-- 1 root root 531 2012-04-26 11:46 .gitignore
-rw-r--r-- 1 root root 530 2012-04-26 11:46 .hgignore
drwxr-xr-x 8 root root 4096 2012-04-26 11:46 lib/
drwxr-xr-x 3 root root 4096 2012-04-26 11:46 log/
drwxr-xr-x 8 root root 4096 2012-04-26 11:46 public/
-rw-r--r-- 1 root root 360 2012-04-26 11:46 Rakefile
-rw-r--r-- 1 root root 205 2012-04-26 11:46 README.rdoc
drwxr-xr-x 5 root root 4096 2012-04-26 11:46 script/
drwxr-xr-x 6 root root 4096 2012-04-26 11:46 .svn/
drwxr-xr-x 9 root root 4096 2012-04-26 11:46 test/
drwxr-xr-x 7 root root 4096 2012-04-26 11:46 tmp/
drwxr-xr-x 4 root root 4096 2012-04-26 11:46 vendor/
2、安装redmine需要的gem,可以用类似以下指令:
bundle install --without development test
--without 参数后面填入要排除的gem,最好打开 Gemfile,看看哪些是不需要的。我这里只用MYSQL,需要排除的是postgresql,sqlite,rmagick(用于将甘特图导出为png,因为安装失败,我也排除了)。另一方面,后续的操作需要 RDoc 2.4.2以上,所以没有排除development。
添加其他需要的gem,可以编辑一个文件来指定,我选了mongrel,这样就不需要apache了。
cares@ubuntu:/opt/redmine-1.4$ sudo vi Gemfile.local
gem "mongrel"
我的安装指令:
cares@ubuntu:/opt/redmine-1.4$ sudo bundle install --without test postgresql sqlite rmagick
Fetching gem metadata from http://rubygems.org/.......
Installing rake (0.9.2.2)
Installing activesupport (2.3.14)
Installing rack (1.1.3)
Installing actionpack (2.3.14)
Installing actionmailer (2.3.14)
Installing activerecord (2.3.14)
Installing activeresource (2.3.14)
Installing coderay (1.0.6)
Installing fastercsv (1.5.4)
Installing i18n (0.4.2)
Installing json (1.6.6) with native extensions
Installing mongrel (1.1.5) with native extensions
Installing mysql (2.8.1) with native extensions
Installing net-ldap (0.3.1)
Installing rails (2.3.14)
Installing rdoc (3.12)
Installing ruby-openid (2.1.8)
Installing tzinfo (0.3.33)
Using bundler (1.1.3)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
= 1.9.2 : nothing to do! Yay!
最后的提示可以忽略。
3、配置数据库参数
在redmine目录,复制 config/database.yml.example 为 config/database.yml 并编辑,填上数据库参数。
如果ruby版本为1.9,则 adapter: mysql2
如果mysql端口不是默认的,则 port: [your_mysql_port]
如下:
cares@ubuntu:/opt/redmine-1.4$ sudo cp config/database.yml.example config/database.yml
cares@ubuntu:/opt/redmine-1.4$ sudo vi config/database.yml
production:
adapter: mysql
database: redminedb
host: 192.168.0.100
port: 3306
username: redmineuser
password: 12345678
encoding: utf8
4、生成 session store secret
cares@ubuntu:/opt/redmine-1.4$ sudo rake generate_session_store
5、创建数据库结构
cares@ubuntu:/opt/redmine-1.4$ sudo RAILS_ENV=production rake db:migrate
[一大堆结果]
6、向库中插入默认配置数据,非必须,但高度推荐这么做。选择语言时,一定要用en,否则呢,,,,嘿嘿嘿,我就不告诉你会有乱码
。
cares@ubuntu:/opt/redmine-1.4$ sudo RAILS_ENV=production rake redmine:load_default_data
Select language: ar, bg, bs, ca, cs, da, de, el, en, en-GB, es, et, eu, fa, fi, fr, gl, he, hr, hu,>
====================================
Default configuration data loaded.
7、设置目录权限(public/plugin_assets 目录在运行了RAILS_ENV=production rake db:migrate 之后会自动创建。
cares@ubuntu:/opt/redmine-1.4$ sudo chown -R cares:cares files log tmp public/plugin_assets
cares@ubuntu:/opt/redmine-1.4$ sudo chmod -R 755 files log tmp public/plugin_assets
8、用mongrel 运行 redmine
cares@ubuntu:/opt/redmine-1.4$ ruby /opt/redmine-1.4/script/server mongrel -e production
=> Booting Mongrel
=> Rails 2.3.14 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
这时,用浏览器访问 http://192.168.0.99:3000 ,默认用户名admin,密码admin
9、为了开机自动运行,将以下指令加入到 /etc/rc.local,别忘了里面还有个 -d,
ruby /opt/redmine-1.4/script/server mongrel -d -e production
exit 0
Now, reboot and good Luck.
|
|
|