POSTS
FreeBSD 架設 redmine
redmine 安裝:
1.先更新本機的port tree
$ portsnap fetch update
2.安裝
cd /usr/ports/www/redmine; make install clean
3.mysql 建立使用者:(密碼請自行變更)
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)
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: password
encoding: utf8
6.起始化資料庫:
$ 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:
redmine_enable="YES"
redmine_flags="-a 127.0.0.1 -p 3000 -e production"
redmine_user="www"
redmine_group="www"
- NGINX 設定檔:
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;