■前提
OS: CentOS5.7(64bit)
Ruby: 1.9.2p290
MySQL: 5.0.77(OSバンドルのものを使用)
Apache: 2.2.3(OSバンドルのものを使用)
passenger: 3.0.9
■Redmineを実行するために必要なgemパッケージおよびそのバージョンをインストール
⇒Rack 1.1.1、rake 0.8.7、i18n 0.4.2 (最新バージョンだと動かないため)
⇒バージョン確認
[root@redmine02 ~]# gem list | grep -e rack -e rake -e i18n
i18n (0.6.0)
rack (1.3.3)
rack-cache (1.0.3)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.1)
rake (0.9.2, 0.8.7)
⇒Rack 1.1.1インストール
[root@redmine02 ~]# gem install rack -v=1.1.1 --no-rdoc --no-ri
Successfully installed rack-1.1.1
1 gem installed
[root@redmine02 ~]#
⇒i18n 0.4.2
[root@redmine02 ~]# gem install i18n -v=0.4.2 --no-rdoc --no-ri
Successfully installed i18n-0.4.2
1 gem installed
[root@redmine02 ~]#
■MySQLのデフォルトキャラクタセットをutf8に設定
[root@redmine02 ~]# mysql --version
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
[root@redmine02 ~]# cat /etc/my.cnf
[root@redmine02 ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
# 20110930 for redmine ←追記
default-character-set=utf8 ←追記
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# 20110930 for redmine ←追記
[mysql] ←追記
default-character-set=utf8 ←追記
[root@redmine02 ~]#
⇒MySLQ再起動
[root@redmine02 ~]# /etc/init.d/mysqld restart
MySQL を停止中: [ OK ]
MySQL を起動中: [ OK ]
⇒キャラクタセット設定確認
[root@redmine02 ~]# mysql -u root
mysql> show variables like 'character_set%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
■MySQLデータベース準備
⇒匿名ユーザー削除
mysql> use mysql
Database changed
mysql> delete from user where user = '';
Query OK, 2 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
⇒Redmine用データベースとユーザーの作成
mysql> create database db_redmine default character set utf8;
Query OK, 1 row affected (0.06 sec)
mysql> grant all on db_redmine.* to user_redmine identified by 'ienaiyo';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
⇒自動起動設定
[root@redmine02 ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@redmine02 ~]# chkconfig mysqld on
[root@redmine02 ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
■Redmineのダウンロード
http://rubyforge.org/frs/?group_id=1850
上記サイトよりredmine-1.2.1.tar.gzをダウンロード
/home/public/src/に配置
■Redmineの配置先のディレクトリに解凍
[root@redmine02 ~]# tar -zxf /home/public/src/redmine-1.2.1.tar.gz -C /rails_projects/
[root@redmine02 ~]# cd /rails_projects/redmine-1.2.1/
■Redmine設定
⇒database.ymlの設定
[root@redmine02 redmine-1.2.1]# vi config/database.yml
[root@redmine02 redmine-1.2.1]# cat config/database.yml
production:
adapter: mysql2
database: db_redmine
host: localhost
username: user_redmine
password: ienaiyo
encoding: utf8
[root@redmine02 redmine-1.2.1]#
⇒configuration.ymlの設定
[root@redmine02 redmine-1.2.1]# cp config/configuration.yml.example config/configuration.yml
[root@redmine02 redmine-1.2.1]# vi config/configuration.yml
[root@redmine02 redmine-1.2.1]# tail -11 config/configuration.yml
production:
email_delivery: ←追記
delivery_method: :smtp ←追記
smtp_settings: ←追記
address: "localhost" ←追記
port: 25 ←追記
domain: 'dynalias.net' ←追記(環境により異なる)
# specific configuration options for development environment
# that overrides the default ones
development:
[root@redmine02 redmine-1.2.1]#
⇒Redmineの初期設定とデータベースのテーブル作成
[root@redmine02 redmine-1.2.1]# rake generate_session_store
(in /rails_projects/redmine-1.2.1)
[root@redmine02 redmine-1.2.1]# rake db:migrate RAILS_ENV=production
(in /rails_projects/redmine-1.2.1)
rake aborted!
undefined method `map' for nil:NilClass
/usr/local/lib/ruby/1.9.1/rubygems.rb:228:in `activate'
/usr/local/lib/ruby/1.9.1/rubygems.rb:1119:in `try_activate'
:32:in `rescue in require'
:29:in `require'
/rails_projects/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `block in require'
/rails_projects/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
/rails_projects/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
■エラー対応
最新バージョンをアンインストール
[root@redmine02 ~]# gem uninstall rack
Select gem to uninstall:
1. rack-1.1.1
2. rack-1.3.3
3. All versions
> 2
You have requested to uninstall the gem:
rack-1.3.3
sprockets-2.0.0 depends on [rack (~> 1.0)]
actionpack-3.1.0 depends on [rack (~> 1.3.2)]
rack-mount-0.8.3 depends on [rack (>= 1.0.0)]
passenger-3.0.9 depends on [rack (>= 0)]
rack-test-0.6.1 depends on [rack (>= 1.0)]
rack-ssl-1.3.2 depends on [rack (>= 0)]
rack-cache-1.0.3 depends on [rack (>= 0.4)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] y
Successfully uninstalled rack-1.3.3
[root@redmine02 redmine-1.2.1]# gem uninstall i18n
Select gem to uninstall:
1. i18n-0.4.2
2. i18n-0.6.0
3. All versions
> 2
You have requested to uninstall the gem:
i18n-0.6.0
mail-2.3.0 depends on [i18n (>= 0.4.0)]
actionpack-3.1.0 depends on [i18n (~> 0.6)]
activemodel-3.1.0 depends on [i18n (~> 0.6)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] y
Successfully uninstalled i18n-0.6.0
[root@redmine02 redmine-1.2.1]#
⇒environment.rbに追記
[root@redmine02 redmine-1.2.1]# head -30 config/environment.rb
# Be sure to restart your web server when you modify this file.
# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
# add 20110930
if Gem::VERSION >= "1.3.6"
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end
# Load Engine plugin if available
begin
require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
rescue LoadError
# Not available
end
⇒エラー解消せず。(T-T)
結局Redmine1.2.1は現時点で最新のruby1.9.2には対応していないことが原因の模様。
2011年10月1日土曜日
Ruby1.9.2p290にRedmine1.2.1インストールしてみたが…
2011年9月27日火曜日
Redmineとgitの連携
■クライアントPCおよびRedmineの両方からアクセスできるように所有者変更 [root@redmine01 git_repos]# chown -R public:apache sample ■configuration.yml設定 ⇒gitモジュールのパス確認 [root@redmine01 ~]# ll /usr/local/bin/git -rwxr-xr-x 109 root root 4977962 9月 25 14:56 /usr/local/bin/git ⇒configuration.yml設定 [root@redmine01 ~]# vi /opt/redmine-1.2.1/config/configuration.yml [root@redmine01 ~]# grep -n git /opt/redmine-1.2.1/config/configuration.yml 116: # scm_git_command: /usr/local/bin/git # (default: git) 122: scm_git_command: /usr/local/bin/git ←修正 [root@redmine01 ~]# ■Redmine画面から設定 ⇒gitの使用可能確認 管理 > 設定 > リポジトリタブ 使用するバージョン管理システム: gitのバージョンが表示され使用可能になっている ⇒gitリポジトリ設定 プロジェクト選択 > 設定 > リポジトリ バージョン管理システム: Git リポジトリのパス: /opt/git_repos/sample →プロジェクトに"リポジトリ"タブが表示される。
2011年9月26日月曜日
CentOS5.7にgit1.7.6.1インストール
■インストーラダウンロード
https://github.com/git/git/downloads
[root@redmine01 ~]# ll /usr/local/
合計 80
drwxr-xr-x 2 root root 4096 9月 25 00:19 bin
drwxr-xr-x 2 root root 4096 5月 11 20:58 etc
drwxr-xr-x 2 root root 4096 5月 11 20:58 games
drwxr-xr-x 2 root root 4096 5月 11 20:58 include
drwxr-xr-x 3 root root 4096 9月 24 23:27 lib
drwxr-xr-x 2 root root 4096 5月 11 20:58 lib64
drwxr-xr-x 2 root root 4096 5月 11 20:58 libexec
drwxr-xr-x 2 root root 4096 5月 11 20:58 sbin
drwxr-xr-x 4 root root 4096 9月 24 05:19 share
drwxr-xr-x 2 root root 4096 5月 11 20:58 src
[root@redmine01 ~]# cd /home/public/src/
[root@redmine01 src]# tar -zxf git-git-v1.7.6.1-0-gccef604.tar.gz
[root@redmine01 src]# cd git-git-ce54b9b/
⇒./configureがないので、いきなりmake
[root@redmine01 git-git-ce54b9b]# make prefix=/usr/local
GIT_VERSION = 1.7.6.1
* new build flags or prefix
CC daemon.o
* new link flags
CC abspath.o
(中略)
GEN bin-wrappers/test-svn-fe
GEN bin-wrappers/test-treap
[root@redmine01 git-git-ce54b9b]#
⇒make install
[root@redmine01 git-git-ce54b9b]# make prefix=/usr/local install
* new build flags or prefix
CC daemon.o
CC abspath.o
(中略)
cp "$execdir/git-remote-http" "$execdir/$p" || exit; \
done && \
./check_bindir "z$bindir" "z$execdir" "$bindir/git-add"
[root@redmine01 git-git-ce54b9b]#
■bareリポジトリ(共有リポジトリ)作成
[root@redmine01 ~]# mkdir -p /opt/git_repos/sample
[root@redmine01 ~]# cd /opt/git_repos/sample
[root@redmine01 sample]# git init --bare --shared=true
Initialized empty shared Git repository in /opt/git_repos/sample/
[root@redmine01 sample]# git branch
[root@redmine01 sample]#
※作成直後はブランチは存在しない。
⇒所有者変更
[root@redmine01 ~]# chown -R public: /opt/git_repos/sample
[root@redmine01 ~]# ll /opt/git_repos/sample
合計 32
-rw-rw-r-- 1 public public 23 9月 25 21:35 HEAD
drwxrwsr-x 2 public public 4096 9月 25 21:35 branches
-rw-rw-r-- 1 public public 126 9月 25 21:35 config
-rw-rw-r-- 1 public public 73 9月 25 21:35 description
drwxrwsr-x 2 public public 4096 9月 25 21:35 hooks
drwxrwsr-x 2 public public 4096 9月 25 21:35 info
drwxrwsr-x 4 public public 4096 9月 25 21:35 objects
drwxrwsr-x 4 public public 4096 9月 25 21:35 refs
[root@redmine01 ~]#
-----------------------------------------------------------
◆クライアントPC(Windows7)にて、msysgitインストール
⇒msysgitダウンロード
http://code.google.com/p/msysgit/downloads/list
Git-1.7.6-preview20110708.exe
⇒インストール
ウィザードに従ってインストール。選択肢は下記を選択
・Use Git Bash only
・Ceckout Windows-style, commit Unix-style line endings
◆クライアントPC(Windows7)にて、msysgitを利用し対象ディレクトリをバージョン管理する
Welcome to Git (version 1.7.6-preview20110708)
Run 'git help git' to display the help index.
Run 'git help ' to display help for specific commands.
admin@TANYAO-PC /E/git_reops/test
⇒対象ディレクトリをgitでソース管理
$ git init
Initialized empty Git repository in e:/git_reops/test/.git/
admin@TANYAO-PC /E/git_reops/test (master)
⇒リモートの共有リポジトリをoriginという名前で定義
$ git remote add origin ssh://public@192.168.1.15/opt/git_repos/sample
admin@TANYAO-PC /E/git_reops/test (master)
⇒ユーザ名とメールアドレスを設定
$ git config --global user.name "tanyao"
admin@TANYAO-PC /E/git_reops/test (master)
$ git config --global user.email admin@tanyao.dynalias.net
admin@TANYAO-PC /E/git_reops/test (master)
⇒全ファイルをステージングに追加
$ git add .
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.
(後略)
admin@TANYAO-PC /E/git_reops/test (master)
⇒コミット
$ git commit -m "initial import"
[master (root-commit) 40b0767] initial import
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.
The file will have its original line endings in your working directory.
(後略)
admin@TANYAO-PC /E/git_reops/test (master)
⇒共有リポジトリにプッシュ
$ git push origin master
public@192.168.1.15's password:
Counting objects: 87, done.
Compressing objects: 100% (74/74), done.
Writing objects: 100% (87/87), 29.65 KiB, done.
Total 87 (delta 2), reused 0 (delta 0)
To ssh://public@192.168.1.15/opt/git_repos/sample
* [new branch] master -> master
admin@TANYAO-PC /E/git_reops/test (master)
-----------------------------------------------------------
■クライアントPC(Windows7)からpush後、再確認
[root@redmine01 sample]# git branch
* master
[root@redmine01 sample]# ll
合計 32
-rw-rw-r-- 1 public public 23 9月 25 21:35 HEAD
drwxrwsr-x 2 public public 4096 9月 25 21:35 branches
-rw-rw-r-- 1 public public 126 9月 25 21:35 config
-rw-rw-r-- 1 public public 73 9月 25 21:35 description
drwxrwsr-x 2 public public 4096 9月 25 21:35 hooks
drwxrwsr-x 2 public public 4096 9月 25 21:35 info
drwxrwsr-x 79 public public 4096 9月 25 21:46 objects ←ファイルが増えている
drwxrwsr-x 4 public public 4096 9月 25 21:35 refs
[root@redmine01 sample]# ll objects/
合計 308
drwxrwsr-x 2 public public 4096 9月 25 21:46 04
drwxrwsr-x 2 public public 4096 9月 25 21:46 05
drwxrwsr-x 2 public public 4096 9月 25 21:46 08
drwxrwsr-x 2 public public 4096 9月 25 21:46 0a
drwxrwsr-x 2 public public 4096 9月 25 21:46 11
(後略)
■devブランチ作成
[root@redmine01 sample]# git branch dev
[root@redmine01 sample]# git branch
dev
* master
[root@redmine01 sample]# git checkout dev
fatal: This operation must be run in a work tree
[root@redmine01 sample]#
※bareリポジトリではmaster以外のブランチに移動できないようだ。
-----------------------------------------------------------
◆クライアントPC(Windows7)にて、共有リポジトリをプル
$ git pull
public@192.168.1.15's password:
From ssh://192.168.1.15/opt/git_repos/sample
* [new branch] dev -> origin/dev
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull ').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "master"]
remote =
merge =
[remote ""]
url =
fetch =
See git-config(1) for details.
admin@TANYAO-PC /E/git_reops/test (master)
⇒リモートブランチからローカルブランチを生成
$ git branch -a
* master
remotes/origin/dev
remotes/origin/master
admin@TANYAO-PC /E/git_reops/test (master)
$ git checkout -b dev origin/dev
Branch dev set up to track remote branch dev from origin.
Switched to a new branch 'dev'
admin@TANYAO-PC /E/git_reops/test (dev)
$ git branch -a
* dev
master
remotes/origin/dev
remotes/origin/master
admin@TANYAO-PC /E/git_reops/test (dev)
2011年9月25日日曜日
Redmine1.2.1構築メモ(4)
■構成情報 ・OS: CentOS5.7(64bit) ・MySQL: 5.0.77(OSバンドル) ・Ruby: 1.8.7(Ruby Enterprise Editionを利用) ・rack: 1.1.1 ・rake: 0.8.7 ・i18n: 0.4.2 ・Apache: 2.2.3(OSバンドル) ・Passenger: 3.0.9 ・Redmine: 1.2.1(4) ApacheにPassengerを組み込み
■パッケージを準備 [root@redmine01 ~]# rpm -q httpd-devel パッケージ httpd-devel はインストールされていません。 [root@redmine01 ~]# yum -y install httpd-devel Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package httpd-devel.i386 0:2.2.3-53.el5.centos.1 set to be updated --> Processing Dependency: httpd = 2.2.3-53.el5.centos.1 for package: httpd-devel --> Processing Dependency: apr-util-devel for package: httpd-devel --> Processing Dependency: apr-devel for package: httpd-devel ---> Package httpd-devel.x86_64 0:2.2.3-53.el5.centos.1 set to be updated --> Running transaction check ---> Package apr-devel.x86_64 0:1.2.7-11.el5_6.5 set to be updated ---> Package apr-util-devel.x86_64 0:1.2.7-11.el5_5.2 set to be updated --> Processing Dependency: httpd = 2.2.3-53.el5.centos for package: mod_ssl --> Processing Dependency: httpd = 2.2.3-53.el5.centos for package: httpd-manual ---> Package httpd.x86_64 0:2.2.3-53.el5.centos.1 set to be updated --> Running transaction check ---> Package httpd-manual.x86_64 0:2.2.3-53.el5.centos.1 set to be updated ---> Package mod_ssl.x86_64 1:2.2.3-53.el5.centos.1 set to be updated --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================================== Package Arch Version Repository Size ========================================================================================================================== Installing: httpd-devel i386 2.2.3-53.el5.centos.1 updates 151 k httpd-devel x86_64 2.2.3-53.el5.centos.1 updates 151 k Installing for dependencies: apr-devel x86_64 1.2.7-11.el5_6.5 base 238 k apr-util-devel x86_64 1.2.7-11.el5_5.2 base 53 k Updating for dependencies: httpd x86_64 2.2.3-53.el5.centos.1 updates 1.2 M httpd-manual x86_64 2.2.3-53.el5.centos.1 updates 815 k mod_ssl x86_64 1:2.2.3-53.el5.centos.1 updates 94 k Transaction Summary ========================================================================================================================== Install 4 Package(s) Upgrade 3 Package(s) Total download size: 2.7 M Downloading Packages: (1/7): apr-util-devel-1.2.7-11.el5_5.2.x86_64.rpm | 53 kB 00:00 (2/7): mod_ssl-2.2.3-53.el5.centos.1.x86_64.rpm | 94 kB 00:00 (3/7): httpd-devel-2.2.3-53.el5.centos.1.x86_64.rpm | 151 kB 00:00 (4/7): httpd-devel-2.2.3-53.el5.centos.1.i386.rpm | 151 kB 00:00 (5/7): apr-devel-1.2.7-11.el5_6.5.x86_64.rpm | 238 kB 00:00 (6/7): httpd-manual-2.2.3-53.el5.centos.1.x86_64.rpm | 815 kB 00:00 (7/7): httpd-2.2.3-53.el5.centos.1.x86_64.rpm | 1.2 MB 00:00 --------------------------------------------------------------------------------------------------------------------------- Total 1.2 MB/s | 2.7 MB 00:02 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : httpd 1/10 Installing : apr-devel 2/10 Updating : mod_ssl 3/10 Installing : apr-util-devel 4/10 Updating : httpd-manual 5/10 Installing : httpd-devel 6/10 Installing : httpd-devel 7/10 Cleanup : httpd-manual 8/10 Cleanup : httpd 9/10 Cleanup : mod_ssl 10/10 Installed: httpd-devel.i386 0:2.2.3-53.el5.centos.1 httpd-devel.x86_64 0:2.2.3-53.el5.centos.1 Dependency Installed: apr-devel.x86_64 0:1.2.7-11.el5_6.5 apr-util-devel.x86_64 0:1.2.7-11.el5_5.2 Dependency Updated: httpd.x86_64 0:2.2.3-53.el5.centos.1 httpd-manual.x86_64 0:2.2.3-53.el5.centos.1 mod_ssl.x86_64 1:2.2.3-53.el5.centos.1 Complete! [root@redmine01 ~]# ■Passengerのインストール [root@redmine01 ~]# gem install passenger --no-rdoc --no-ri Fetching: fastthread-1.0.7.gem (100%) Building native extensions. This could take a while... Fetching: daemon_controller-0.2.6.gem (100%) Fetching: passenger-3.0.9.gem (100%) Successfully installed fastthread-1.0.7 Successfully installed daemon_controller-0.2.6 Successfully installed passenger-3.0.9 3 gems installed [root@redmine01 ~]# ■PassengerのApache用モジュールのインストール [root@redmine01 ~]# passenger-install-apache2-module Welcome to the Phusion Passenger Apache 2 module installer, v3.0.9. 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. -------------------------------------------- Checking for required software... * GNU C++ compiler... found at /usr/bin/g++ * Curl development headers with SSL support... found * OpenSSL development headers... found * Zlib development headers... found * Ruby development headers... found * OpenSSL support for Ruby... found * RubyGems... found * Rake... found at /usr/local/bin/rake * rack... found * Apache 2... found at /usr/sbin/httpd * Apache 2 development headers... found at /usr/sbin/apxs * Apache Portable Runtime (APR) development headers... found at /usr/bin/apr-1-config * Apache Portable Runtime Utility (APU) development headers... found at /usr/bin/apu-1-config -------------------------------------------- Compiling and installing Apache 2 module... cd /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9 /usr/local/bin/ruby /usr/local/bin/rake apache2:clean apache2 RELEASE=yes (中略) -------------------------------------------- The Apache 2 module was successfully installed. Please edit your Apache configuration file, and add these lines: LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9 PassengerRuby /usr/local/bin/ruby 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. -------------------------------------------- Deploying a Ruby on Rails application: an example Suppose you have a Rails application in /somewhere. Add a virtual host to your Apache configuration file and set its DocumentRoot to /somewhere/public:お手数をおかけして恐縮ですが、広告サイトクリックにご協力いただけるとありがたいです。m(_ _)mServerName www.yourhost.com DocumentRoot /somewhere/public # <-- be sure to point to 'public'! And that's it! You may also want to check the Users Guide for security and optimization tips, troubleshooting and other useful information: /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/doc/Users guide Apache.html Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-) http://www.modrails.com/ Phusion Passenger is a trademark of Hongli Lai & Ninh Bui. [root@redmine01 ~]# ■Apacheの設定 ⇒worker MPMに切り替える [root@redmine01 ~]# vi /etc/sysconfig/httpd [root@redmine01 ~]# grep httpd.worker /etc/sysconfig/httpd #HTTPD=/usr/sbin/httpd.worker HTTPD=/usr/sbin/httpd.worker ←追記 ⇒passnger.conf作成 [root@redmine01 ~]# vi /etc/httpd/conf.d/passnger.conf [root@redmine01 ~]# cat /etc/httpd/conf.d/passnger.conf # output of "passenger-install-apache2-module" LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9 PassengerRuby /usr/local/bin/ruby # rails settings RailsBaseURI /redmine # Passengerが追加するHTTPヘッダを削除するための設定 Header always unset "X-Powered-By" Header always unset "X-Rack-Cache" Header always unset "X-Content-Digest" Header always unset "X-Runtime" # 必要に応じてPassengerのチューニングのための設定を追加。 PassengerMaxPoolSize 20 PassengerMaxInstancesPerApp 4 PassengerPoolIdleTime 3600 PassengerUseGlobalQueue on PassengerHighPerformance on PassengerStatThrottleRate 10 RailsSpawnMethod smart RailsAppSpawnerIdleTime 86400 RailsFrameworkSpawnerIdleTime 0 [root@redmine01 ~]# ⇒Apache自動起動設定 [root@redmine01 ~]# chkconfig --list httpd httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@redmine01 ~]# chkconfig httpd on ⇒Redmineディレクトリの所有者変更 [root@redmine01 ~]# chown -R apache: /opt/redmine-1.2.1 ⇒サブディレクトリでRedmineを実行(シンボリックリンク作成) [root@redmine01 ~]# ln -s /opt/redmine-1.2.1/public /var/www/html/redmine ⇒Apacheを起動 [root@redmine01 ~]# /etc/init.d/httpd configtest Syntax OK [root@redmine01 ~]# /etc/init.d/httpd graceful httpd not running, trying to start [root@redmine01 ~]# ⇒ブラウザからアクセス http://192.168.1.15/redmine/ ログイン:admin/adminAllowOverride all # <-- relax Apache security settings Options -MultiViews # <-- MultiViews must be turned off
2011年9月24日土曜日
Redmine1.2.1構築メモ(3)
■構成情報 ・OS: CentOS5.7(64bit) ・MySQL: 5.0.77(OSバンドル) ・Ruby: 1.8.7(Ruby Enterprise Editionを利用) ・rack: 1.1.1 ・rake: 0.8.7 ・i18n: 0.4.2 ・Apache: 2.2.3(OSバンドル) ・Passenger: 3.0.9 ・Redmine: 1.2.1(3) Redmineインストール
■インストーラダウンロード&解凍
http://rubyforge.org/frs/?group_id=1850
redmine-1.2.1.tar.gzをダウンロードしてサーバにUP
⇒/optに解凍
[root@redmine01 src]# tar -zxf redmine-1.2.1.tar.gz -C /opt
■Redmine関連ファイル設定
[root@redmine01 ~]# cd /opt/redmine-1.2.1/
⇒database.yml作成
[root@redmine01 redmine-1.2.1]# vi config/database.yml
[root@redmine01 redmine-1.2.1]# cat config/database.yml
production:
adapter: mysql
database: db_redmine
host: localhost
username: user_redmine
password: ienaiyo
encoding: utf8
[root@redmine01 redmine-1.2.1]#
⇒configuration.ymlの設定
[root@redmine01 redmine-1.2.1]# cp config/configuration.yml.example config/configuration.yml
[root@redmine01 redmine-1.2.1]# vi config/configuration.yml
[root@redmine01 redmine-1.2.1]# tail -11 config/configuration.yml
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25
domain: 'foo.com'
# specific configuration options for development environment
# that overrides the default ones
development:
[root@redmine01 redmine-1.2.1]#
⇒Redmineの初期設定とデータベースのテーブル作成
[root@redmine01 redmine-1.2.1]# rake generate_session_store
(in /opt/redmine-1.2.1)
[root@redmine01 redmine-1.2.1]# rake db:migrate RAILS_ENV=production
(in /opt/redmine-1.2.1)
== Setup: migrating ==========================================================
-- create_table("attachments", {:force=>true})
-> 0.0072s
-- create_table("auth_sources", {:force=>true})
(中略)
== AddRepositoriesExtraInfo: migrating =======================================
-- add_column(:repositories, :extra_info, :text)
-> 0.0092s
== AddRepositoriesExtraInfo: migrated (0.0095s) ==============================
[root@redmine01 redmine-1.2.1]#
登録:
投稿 (Atom)