install redmine on ubuntu
切換成 root 身份執(zhí)行安裝
sudo -s
首先安裝最新的 Ruby 和開發(fā)環(huán)境
apt-get install ruby rubygems ruby-pkg-tools ruby1.8-dev irb ri rdoc rake build-essential
安裝 Subversion,更新 redmine 的代碼庫需要用到
apt-get install subversion
安裝 Apache,正式的Web服務(wù)環(huán)境還是在這里穩(wěn)定一些
apt-get install apache2
安裝 MySQL,作為首選的 redmine 數(shù)據(jù)庫
apt-get install mysql-server libmysql-ruby
Ruby On Rails Ubuntu 配置參考
安裝必須的 Gems
- Rails 2.1.2 (Ruby)
- Mongrel Web Server 1.1.3
- Mongrel_Cluster 1.0.5
- Daemons 1.0.9
gem install rails -v=2.1.2
gem install mongrel mongrel_cluster daemons --include-dependencies
獲得最新的 redmine 穩(wěn)定版本代碼,默認(rèn)把網(wǎng)站放在 /var/www/ 下面
cd /var/www
mkdir redmine
svn co http://redmine.rubyforge.org/svn/branches/0.8-stable redmine
創(chuàng)建默認(rèn)數(shù)據(jù)庫
mysql -u root -p
create database redmine
exit
修改 redmine 的默認(rèn)數(shù)據(jù)庫配置
cd /var/www/redmin/config
cp database.example.yml database.yml
vi database.yml
production:
adapter: mysql
database: redmine
host: localhost
username: root
password: <
your password>
初始化 redmine 數(shù)據(jù)庫
cd /var/www/redmine
rake db:migrate RAILS_ENV="production"
讀取 redmine 默認(rèn)配置
rake redmine:load_default_data RAILS_ENV="production"
啟動測試
ruby script/server -e production
訪問 http://localhost:3000 如果看到 redmine 的默認(rèn)首頁,表示安裝成功!
使用默認(rèn)的 admin 帳戶登錄,密碼也是 admin
配置 Apache 與 Mongrel,讓 redmine 運(yùn)行在 Apache 服務(wù)器里面
生成 monrel_cluster 配置文件
cd /var/www/redmine
mongrel_rails cluster::configure -e production -p 8000 -N 2 -c /var/www/redmine --user root --group root
啟動 mongrel 代理服務(wù)
mongrel_rails cluster::start
訪問 http://localhost:8000 如果看到 redmine 的默認(rèn)首頁,表示 mongrel 代理安裝成功!
安裝并激活一些 Apache 模塊
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_balancer
a2enmod rewrite
創(chuàng)建一個 Apache 的虛擬站點(diǎn)文件,路徑如下:
/etc/apache2/sites-available/redmine.yourdomain
虛擬站點(diǎn)配置內(nèi)容
<VirtualHost *:80>
ServerAdmin admin@yoursite.com
DocumentRoot /var/www/redmine
ServerName yoursite.com
ErrorLog /var/www/redmine/log/error.log
ProxyPass /images !
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass /favicon.ico !
ProxyPass /static !
ProxyPass /holding !
ProxyPass /templates !
ProxyPass / balancer://redmine_cluster
ProxyPreserveHost On
<Proxy balancer://redmine_cluster>
Order allow,deny
Allow from all
BalancerMember http://127.0.0.1:8000
BalancerMember http://127.0.0.1:8001
</Proxy>
RewriteEngine On
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://redmine_cluster%{REQUEST_URI} [P,QSA,L]
</VirtualHost>
激活虛擬站點(diǎn),并重啟 Apache 服務(wù)
ln -s /etc/apache2/sites-available/
redmine.yourdomain /etc/apache2/sites-enabled/
redmine.yourdomain
/etc/init.d/apache2 restart
成功安裝完成!
問題:
運(yùn)行redmine的服務(wù)器無法連接遠(yuǎn)程https的SVN庫
得到的錯誤:The entry or revision was not found in the repository
解決辦法:在服務(wù)器上用 svn 命令連接一下遠(yuǎn)程SVN庫,確認(rèn)一下 SSL 連接信任的授權(quán)就可以了!