FreeBSD 架設 redmine

redmine 安裝:
1.先更新本機的port tree

1
$ portsnap fetch update

2.安裝

1
cd /usr/ports/www/redmine; make install clean


3.mysql 建立使用者:(密碼請自行變更)

1
2
create database redmine character set utf8;
grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'password';

4.編輯設定檔:(/usr/local/www/redmine/config/database.yml)

1
2
3
4
5
6
7
production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: password
  encoding: utf8

6.起始化資料庫:

1
2
3
4
5
6
7
8
9
$ 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-TW <~~~恕入你所要設定的語言
====================================
Default configuration data loaded.
$ chown -R www:www files log tmp public/plugin_assets
$ chmod -R 755 files log tmp public/plugin_assets

7.設定rc.conf:

1
2
3
4
redmine_enable="YES"
redmine_flags="-a 127.0.0.1 -p 3000 -e production"
redmine_user="www"
redmine_group="www"

8. NGINX 設定檔:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
upstream mongrel {
    server 127.0.0.1:3000;
}
server {
    listen          80;
    server_name     redmine.yourser.name;
 
    root /www/redmine/public;
 
        location / {
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header  Host $http_host;                               
            proxy_redirect off;
            proxy_read_timeout 30;
 
                if (-f $request_filename/index.html) {
                    rewrite (.*) $1/index.html break;
                }
 
                if (-f $request_filename.html) {
                    rewrite (.*) $1.html break;
                }
 
                if (-f $request_filename.txt) {
                    rewrite (.*) $1.txt break;
                }
 
                proxy_pass http://mongrel/;
        }
}

啟動:/usr/local/etc/rc.d/redmine start
瀏覽http://redmine.yourser.name/,即可看到 預設帳密admin/admin;

One thought on “FreeBSD 架設 redmine

  1. Pingback: 在 FreeBSD 上安装 Redmine « ♨Sutra's Blog

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *