内容へ移動
ほげぴよwiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
トレース:
ubuntu-server-10-04:redmine
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== Redmine ====== Trac が何かとインストールでとらぶるし、開発に勢いがないっぽいことを発見したので、 Redmine に乗り換える。 ===== インストール ===== 前提条件 * Apache2 がインストールされている * MySQL 5.1 がインストールされている 要件 * OpenLDAP で認証する * DB は MysQL ==== Ruby 関連 ==== Ruby、RubyGems、rake をインストール。 <code> $ sudo apt-get install ruby1.8 rubygems rake $ sudo gem install rack -v=1.0.1 </code> オプションモジュールをインストール。 <code> $ sudo apt-get install imagemagick </code> <note important>あとで</note> ==== MySQL の C binding ==== <code> $ sudo gem install mysql </code> エラー出た。 <code> extconf.rb:10:in `require': no such file to load -- mkmf (LoadError) </code> 足りてないパッケージをインストールして再度。 <code> $ sudo apt-get install ruby1.8-dev libmysqlclient-dev $ sudo gem install mysql </code> <code> $ sudo gem install mysql Building native extensions. This could take a while... Successfully installed mysql-2.8.1 1 gem installed Installing ri documentation for mysql-2.8.1... No definition for next_result No definition for field_name : : No definition for error_errno No definition for error_sqlstate </code> と "No definition for ..." が大量に出力されるが、これは大丈夫らしい。 ==== Redmine ==== Redmine 本体をインストール。[[http://www.redmine.jp/download/|アーカイブ]] をダウンロード。 * [[http://rubyforge.org/frs/?group_id=1850|DL ページ]] * [[http://rubyforge.org/frs/download.php/74722/redmine-1.1.3.tar.gz|redmine-1.1.3.tar.gz]] を使用する ダウンロードして解凍する。 <code> $ wget http://rubyforge.org/frs/download.php/74722/redmine-1.1.3.tar.gz $ tar -xzvf ./redmine-1.1.3.tar.gz </code> redmine-1.1.3 ディレクトリを redmine にリネームして任意の位置に移動。以降このディレクトリ内で作業する。 空のDBと接続用のユーザを作成。ユーザ名は何でもよいが、今回は redmine とする。 <code> $ mysql -u root -p </code> <code> mysql> create database redmine character set utf8; mysql> create user 'redmine'@'localhost' identified by 'my_password'; mysql> grant all privileges on redmine.* to 'redmine'@'localhost'; mysql> exit </code> 設定ファイルのテンプレートをコピーして編集する。 <code> $ sudo cp ./config/database.yml.example ./config/database.yml $ sudo vi ./config/database.yml </code> production 部分を変更。 <code> production: adapter: mysql database: redmine host: localhost username: redmine password: <PASSWORD> encoding: utf8 </code> セッションストア秘密鍵を生成。 <code> $ rake config/initializers/session_store.rb </code> <code> Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n` </code> 言われるがままインストール。 <code> $ sudo gem install -v=0.4.2 i18n </code> そして再度。 <code> $ rake config/initializers/session_store.rb </code> データベースに Redmine の管理者アカウントを作成。 <code> $ rake db:migrate RAILS_ENV="production" </code> Ubuntuで以下のエラーが出た場合がある。 <code> Rake aborted! no such file to load -- net/https </code> エラーが出た場合は、以下をインストール。 <code> $ sudo apt-get install libopenssl-ruby1.8 </code> そして再度。 <code> $ rake db:migrate RAILS_ENV="production" </code> デフォルトのデータを DB に登録。 <code> $ rake redmine:load_default_data RAILS_ENV="production" </code> <code> 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] </code> ja を入力。 次に、パーミッションの設定。以下のフォルダに対して書き込み権限を与える。ディレクトリがない場合は作成する。Passenger で Rails アプリケーションを実行した時の実行ユーザーは、 "application/config/environment.rb" のオーナーと同じになる。 * files * log * tmp * public/plugin_assets <code> $ sudo chown -R www-data:www-data files log tmp public/plugin_assets $ sudo chmod -R 775 files log tmp public/plugin_assets </code> <note> オーナ "www-data:www-data" 環境に合わせて変更。\\ おそらくインストール中のユーザになっており、 redmine/config/environment.rb のオーナと同じなので変更する必要はない。 </note> <note important>パーミッションの変更も必要ない気がするが。未検証。</note> Redmine にアクセスできるかを確認。 <code> $ sudo ruby script/server webrick -e production </code> http://localhost:3000/ にアクセスして、 Redmine の画面が表示されればひとまずOK。 デフォルトの管理者アカウント * ID: admin * PW: admin ==== Apache2 に組み込み ==== Passenger をインストール。 <note tip> Ubuntu の場合 Passenger のインストールは、\\ $ sudo apt-get install libapache2-mod-passenger\\ $ sudo a2enmod passenger\\ とするだけでも良いかも。未検証。 </note> <code> $ sudo gem install passenger $ sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module </code> <code> Welcome to the Phusion Passenger Apache 2 module installer, v3.0.7. This installer will guide you through the entire installation process. It shouldn't take more than 3 minutes in total. Here's what you can expect from the installation process: 1. The Apache 2 module will be installed for you. 2. You'll learn how to configure Apache. 3. You'll learn how to deploy a Ruby on Rails application. Don't worry if anything goes wrong. This installer will advise you on how to solve any problems. Press Enter to continue, or Ctrl-C to abort. </code> エンターを押して続ける。 <code> Checking for required software... * GNU C++ compiler... found at /usr/bin/g++ * Curl development headers with SSL support... not found * OpenSSL development headers... not found * Zlib development headers... found * Ruby development headers... found * OpenSSL support for Ruby... found * RubyGems... found * Rake... found at /usr/bin/rake * rack... found * Apache 2... found at /usr/sbin/apache2 * Apache 2 development headers... not found * Apache Portable Runtime (APR) development headers... not found * Apache Portable Runtime Utility (APU) development headers... not found Some required software is not installed. But don't worry, this installer will tell you how to install them. Press Enter to continue, or Ctrl-C to abort. </code> いろいろ足りないらしい。とりあえずエンター押してみた。 <code> Installation instructions for required software * To install Curl development headers with SSL support: Please run apt-get install libcurl4-openssl-dev or libcurl4-gnutls-dev, whichever you prefer. * To install OpenSSL development headers: Please run apt-get install libssl-dev as root. * To install Apache 2 development headers: Please run apt-get install apache2-prefork-dev as root. * To install Apache Portable Runtime (APR) development headers: Please run apt-get install libapr1-dev as root. * To install Apache Portable Runtime Utility (APU) development headers: Please run apt-get install libaprutil1-dev as root. If the aforementioned instructions didn't solve your problem, then please take a look at the Users Guide: /var/lib/gems/1.8/gems/passenger-3.0.7/doc/Users guide Apache.html </code> インストールコマンドを表示してくれる親切設計だった。 言われるがままインストール。 <code> $ sudo apt-get install libcurl4-openssl-dev libssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev </code> 再度 passenger-install-apache2-module を実行。 <code> $ sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module </code> 今度はうまくいき、以下の表示が。 <code> The Apache 2 module was successfully installed. Please edit your Apache configuration file, and add these lines: LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.7 PassengerRuby /usr/bin/ruby1.8 After you restart Apache, you are ready to deploy any number of Ruby on Rails applications on Apache, without any further Ruby on Rails-specific configuration! Press ENTER to continue. </code> Apache2 への設定例が出力される。 <code> <VirtualHost *:80> ServerName www.yourhost.com DocumentRoot /somewhere/public # <-- be sure to point to 'public'! <Directory /somewhere/public> AllowOverride all # <-- relax Apache security settings Options -MultiViews # <-- MultiViews must be turned off </Directory> </VirtualHost> </code> が、これだと Apache2 が Redmine 専用になってしまうので、以下のディレクティブを追加。 <code> Alias "/redmine" "/usr/local/redmine/public/" <Directory /usr/local/redmine/public/> RailsBaseURI /redmine Options -MultiViews AllowOverride all </Directory> </code> お好みで調整。 <note>"/usr/local/redmine/public/" はインストールしたディレクトリに変更。</note> DocumentRoot に設定したフォルダにシンボリックリンクを作成。 <code> $ cd /var/www/dev $ ln -s /usr/local/redmine/public/ ./redmine </code> <note>これは DocumentRoot が "/var/www" で Redmine の公開URLが "<nowiki>http://hostname/dev/redmine</nowiki>" の場合</note> Apache2 を再起動して完了。 あとは admin でログインすれば細かい設定は変更できる。 ===== Subversion との連携 ===== Redmine のインタフェースでリポジトリの設定をしても、チケットとリビジョンを対応付けられるが、コミット後すぐには行われない。コミット後すぐに対応付けられるように、 Subversion のフックを利用する。 "<nowiki>http://[redmine url]/sys/fetch_changesets?id=[project identifier]&key=[your service key]</nowiki>" にアクセスると対応付けが行われる。 <note>"<nowiki>http://[redmine url]/sys/fetch_changesets?key=[your service key]</nowiki>" だと全プロジェクトで行う。\\ [your service key]は Redmine に admin でログインすると、 Settings → Repositories に表示される。</note> 例えば wget を使ってアクセスする場合。 <code> $ wget --no-check-certificate --http-user=USERNAME --http-password=PASSWORD --output-document=- "https://localhost/redmine/sys/fetch_changesets?id=PROJECT_ID?key=BhauwHUkjH786Hq7HG" > /dev/null 2>&1 & </code> オプションはお好みで調整 * --no-check-certificate * サーバ証明書のチェックをしない * --http-user= * --http-password= * 接続に認証が必要な場合はユーザ名とパスワードを指定 * --output-document= * 出力ファイル名を指定。"-" を指定すると標準出力に出力される <note> オフラインで行うコマンドも用意されている。 $ ruby /path_to_redmine/redmine/script/runner "Repository.fetch_changesets" -e production > /dev/null 2>&1 & </note> Subversion のフックを作成する。 <code> $ sudo vi /share/svn/YourProject/hooks/post-commit </code> wget か ruby のコマンドをフックに追加。 <code> #!/bin/sh ruby /path_to_redmine/redmine/script/runner "Repository.fetch_changesets" -e production > /dev/null 2>&1 & </code> post-commit のオーナとパーミッションを変更。 <code> $ sudo chown www-data:www-data /share/svn/YourProject/hooks/post-commit $ sudo chmod 755 /share/svn/YourProject/hooks/post-commit </code> で完了。 ===== プラグイン ===== ==== Mylyn ==== Mylyn のサーバサイドプラグインを導入 インストールに ruby-git バインディングが必要なのでインストール。 <code> $ sudo apt-get install libgit-ruby1.8 </code> Redmine をインストールしたディレクトリに移動して以下のコマンドを実行。 <code> $ ruby script/plugin install git://redmin-mylyncon.git.sourceforge.net/gitroot/redmin-mylyncon/redmine-mylyn-connector </code> アップデートする場合は、 <code> $ ruby script/plugin install --force git://redmin-mylyncon.git.sourceforge.net/gitroot/redmin-mylyncon/redmine-mylyn-connector </code> Redmine の REST web サービスを有効にするとプラグインが利用できる。admin でログインして設定変更。 * [Administration]→[Settings]→[Authentication] * [Enable REST web service]にチェック ちなみに Eclipse 側のコネクタは、「新規ソフトウェアのインストール」を使って以下のURLからインストール。 http://redmin-mylyncon.sourceforge.net/update-site/N/ === 参考URL === * [[http://sourceforge.net/apps/wordpress/redmin-mylyncon/|redmin-mylyncon]] ===== 参考 ===== * [[http://redmine.jp/guide/RedmineInstall/|Redmine インストールガイド]] * [[http://www.redmine.org/projects/redmine/wiki/RedmineInstall|Redmine インストールガイド(英語)]] * [[http://blog.ikemasa.com/2010/04/ubuntu-redmine/|Ubuntu Server 9.10 にRedmineをインストール]] * [[http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu|Ubuntu 10.04 (and 10.04.1) using Passenger]]
ubuntu-server-10-04/redmine.txt
· 最終更新: 2011/05/31 23:12 by
admin
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ