安装 Redmine
- cd /usr/ports/www/redmine && make install clean
设置 rc.conf
- /usr/local/etc/rc.d/redmine rcvar | sed s/NO/YES/ >> /etc/rc.conf
创建 PostgreSQL 数据库角色“redmine”和数据库“redmine”
- psql -U pgsql postgres
psql (9.0.4, server 9.0.3)
Type “help” for help.
postgres=# CREATE ROLE redmine LOGIN PASSWORD ‘redmine’;
CREATE ROLE
postgres=# CREATE DATABASE redmine OWNER = redmine;
CREATE DATABASE
设置数据库连接信息
- vi /usr/local/www/redmine/config/database.yml
production: adapter: postgresql database: redmine host: localhost username: redmine password: "redmine"
初始化数据库
# cd /usr/local/www/redmine/
# rake generate_session_store
# rake db:migrate RAILS_ENV=”production”
# rake redmine:load_default_data RAILS_ENV=”production”
Select language: bg, bs, ca, cs, da, de, el, en, en-GB, es, eu, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] zh
====================================
Default configuration data loaded.
# chown -R www:www files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
启动 Redmine
# /usr/local/etc/rc.d/redmine start
设定 Apache HTTP Server 作为 Balancer(可选)
# vi /usr/local/etc/apache22/Includes/redmine.conf
<VirtualHost *:80> ServerName redmine.example.org DocumentRoot /usr/local/www/redmine/public <Directory /usr/local/www/redmine/public> Order allow,deny allow from all </Directory> <Proxy balancer://redmine> BalancerMember http://127.0.0.1:3000 </Proxy> ProxyRequests Off ProxyPass /favicon.ico ! ProxyPass /404.html ! ProxyPass /500.html ! ProxyPass /help ! ProxyPass /images ! ProxyPass /javascripts ! ProxyPass /stylesheets ! ProxyPass /themes ! ProxyPass / balancer://redmine/ ProxyPassReverse / balancer://redmine/ </VirtualHost>
重启动 Apache HTTP Server(可选)
- apachectl restart