チェックアウト(チェックアウトだとアップデートが楽)
$ svn co svn://rubyforge.org/var/svn/redmine/trunk ./
エクスポート
$ svn export svn://rubyforge.org/var/svn/redmine/trunk ./
$ vi config/environment.rb RAILS_GEM_VERSION = '2.1.0' ↓ RAILS_GEM_VERSION = '2.1.x' ← 環境に合わせる railsのバージョンを調べる方法は、 $ rails -v
$ cp config/database.yml.example config/database.yml
# vi config/database.yml
production: adapter: mysql host: localhost database: redmine username: db_user password: db_password socket: /var/lib/mysql/mysql.sock ← 指定しない場合は、/tmp/mysql.sockが指定される encoding: utf8
mysql> create database redmine; Query OK, 1 row affected (0.01 sec) mysql> grant all on redmine.* to db_user@localhost identified by 'db_password': Query OK, 0 rows affected (0.10 sec)
$ rake db:migrate RAILS_ENV="production"
$ rake load_default_data RAILS_ENV="production" (in /home/redmine) 言語の選択 Select language: bg, ca, cs, da, de, en, es, fi, fr, he, hu, it, ja, ko, lt, nl, no, pl, pt, pt-br, ro, ru, sr, sv, th, tr, uk, zh, zh-tw [en] ja [Enter]
$ cp config/email.yml.example config/email.yml
$ vi config/email.yml
production:
delivery_method: :smtp
smtp_settings:
address: Mail Server Address
port: 25
domain: localdomain
authentication: :login ← おそらくSMTPの認証用だと思われる
user_name: redmine@example.net ← おそらくSMTPの認証用だと思われる
password: redmine ← おそらくSMTPの認証用だと思われる
# yum --enablerepo=rpmforge -y install ImageMagic-devel
# wget http://www.zacharywhitley.com/linux/rpms/fedora/core/6/i386/msttcorefonts-2.0-1.noarch.rpm
# rpm -Uhv msttcorefonts-2.0.1.noarch.rpm
# ln -s /usr/share/fonts/msttcorefonts /usr/share/fonts/default/TrueType
# gem install RMagick
$ ./script/server -e production Internal error が表示される場合は、データベースへの接続、テーブルのセットアップが うまくいっていないことがあるので、テーブルデータ・接続設定を確認 うまくいっている場合は、http://ServerAddr:3000/で接続することができます。 初期の管理者のログインID/PWはadmin/admin
# gem install passenger
# passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v2.0.3.
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.
[Enter]
Checking for required software...
* GNU C++ compiler... found at /usr/bin/g++
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /usr/bin/rake
* Apache 2... found at /usr/sbin/httpd
* Apache 2 development headers... not found ← httpd-develが必要らしい
* Apache Portable Runtime (APR) development headers... found
* fastthread... found
* rack... 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.
# yum -y install httpd-devel
# passenger-install-apache2-module
Checking for required software...
* GNU C++ compiler... found at /usr/bin/g++
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /usr/bin/rake
* 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
* fastthread... found
* rack... found
The Apache 2 module was successfully installed.
インストールが進んでいくとApacheでの設定方法が表示される
Please edit your Apache configuration file, and add these lines:
▼ここから
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /usr/bin/ruby
▲ここまでの設定をApacheの設定ファイルに書き込む
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!
Deploying a Ruby on Rails application: an example
Suppose you have a Ruby on Rails application in /somewhere. Add a virtual host
to your Apache configuration file, and set its DocumentRoot to
/somewhere/public, like this:
<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public
</VirtualHost>
And that's it! You may also want to check the Users Guide for security and
optimization tips and other useful information:
/usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/doc/Users guide.html
Enjoy Phusion Passenger,
# vi /etc/httpd/conf.d/passenger.conf
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /usr/bin/ruby
参考URL