遅々として勉強が進まないので、railsのアプリを公開してみることにした。railsのアプリつってもサンプルなんだけどさ。要は、自分的にテンションをどう上げていくか。これ重要なわけです。
■<Xreaでrailsアプリを公開したい>
自宅サーバーは「スペックがあまりよろしくない」&「そもそも仕組み自体をよく分かっていない」ため、できればXreaで公開したいと考えていた。前回、ググったときはレスポンスとかが厳しそうだったけど、そろそろ何か進展あるかも? てことで期待をしながら再度検索してみたのだが……、。
結論としては、Xreaでrailsアプリを公開してみよーってのは、ちょっと難しいようだ。
さらに、この壮大なるプロジェクトにかけることが出来る予算は、実質的に0円なので、他のレンサバを借りることは出来ない……。=やっぱ、自宅サーバーしかないのか……。
■<自宅サーバーでrailsサンプルを動かしたい>
「Fast CGI」とか全然やったこともないのに、何か良さ気なヤツを発見したので、とりあえず試してみることにする。「Passenger」? 聞いたこともない名前だけど……。
■<サーバ環境>
・Fedora7
・Web&ファイル共有サーバーとして、以前、構築していたもの(スクラップ同然のスペックということもあり、基本的にかなりの放置プレイ中)
▼<Apacheバージョン確認>
・Poderosa―新規接続[ホスト(H)][アカウント(A)][パスフレーズ(P)]
未サポートのエスケープシーケンスを見つけました ESC [?1034h
exit
・Poderosa―新規接続[種類(Y)]プルダウンより、xtermをvt100へと変更
[一般user@]$ httpd -v
-bash: httpd: command not found
[一般user@]$ su -
パスワード:
[root@]# httpd -v
Server version: Apache/2.2.6 (Unix)
▼<一般userに対してsudo コマンドを使用できるよう設定>
・Poderosa―rootで新規接続
visudo
Enter
I―インサートモードへ
最後の行に、sampleuser ALL=(ALL) ALL を追加
Esc―コマンドモードへ
:wq―保存して終了
exit
・Poderosa―一般userで新規接続
試しにroot しか閲覧することのできない/var/log/messageをsudo コマンドを実行してみることにする。
sudo tail /var/log/messages
Password:一般userのパスワード
May 14 10:48:53 一般user ntpd[1691]: kernel time sync status change 0001
▼<「yum-updatesd」サービス停止>
[一般user@]$ /etc/rc.d/init.d/yum-updatesd stop
yum-updates を停止中: [失敗]
rm: cannot remove `/var/lock/subsys/yum-updatesd': 許可がありません
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
Exiting on user cancel.
[一般user@]$ sudo /etc/rc.d/init.d/yum-updatesd stop
yum-updates を停止中:
[ OK ]
▼<rubyインストール>
[一般user@]$ yum -y install ruby
You need to be root to perform this command.
[一般user@]$ sudo yum -y install ruby
Password:
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ruby i386 1.8.6.114-1.fc7 updates 514 k
Updating for dependencies:
ruby-libs i386 1.8.6.114-1.fc7 updates 1.7 M
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 1 Package(s)
Complete!
▼<wgetインストール>
[一般user@]$ yum install wget
You need to be root to perform this command.
[root@]# yum install wget
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
wget i386 1.10.2-15.fc7 fedora 585 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Is this ok [y/N]: y
Installed: wget.i386 0:1.10.2-15.fc7
Complete!
▼<rubygemsインストール>
[一般user@]$ wget http://rubyforge.org/frs/download.php/35283/rubygems-1.1.1.tgz
17:29:11 (134.33 KB/s) - `rubygems-1.1.1.tgz' を保存しました [423308/423308]
[一般user@]$ ls
rubygems-1.1.1.tgz
[一般user@]$ tar xzf rubygems-1.1.1.tgz
[一般user@]$ ls
rubygems-1.1.1 rubygems-1.1.1.tgz
[一般user@]$ cd rubygems-1.1.1
[一般user@ rubygems-1.1.1]$ sudo ruby setup.rb
Password:
./lib/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
from ./lib/rubygems/custom_require.rb:27:in `require'
from setup.rb:51
▼<rdocインストール>
[一般user@ rubygems-1.1.1]$ yum install rdoc
You need to be root to perform this command.
[一般user@アドレス rubygems-1.1.1]$ sudo yum install rdoc
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ruby-rdoc i386 1.8.6.114-1.fc7 updates 342 k
Installing for dependencies:
ruby-irb i386 1.8.6.114-1.fc7 updates 274 k
Transaction Summary
=============================================================================
Install 2 Package(s)
Is this ok [y/N]: y
Installed: ruby-rdoc.i386 0:1.8.6.114-1.fc7
Dependency Installed: ruby-irb.i386 0:1.8.6.114-1.fc7
Complete!
▼<rubygemsインストールに再挑戦>
[一般user@ rubygems-1.1.1]$ sudo ruby setup.rb
Password:
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems
install -c -m 0644 rubygems/gem_path_searcher.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb
install -c -m 0644 rubygems/exceptions.rb /usr/lib/ruby/site_ruby/1.8/rubygems/exceptions.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/digest
install -c -m 0644 rubygems/digest/sha2.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/sha2.rb
install -c -m 0644 rubygems/digest/digest_adapter.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/digest_adapter.rb
install -c -m 0644 rubygems/digest/md5.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/md5.rb
install -c -m 0644 rubygems/digest/sha1.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/sha1.rb
install -c -m 0644 rubygems/validator.rb /usr/lib/ruby/site_ruby/1.8/rubygems/validator.rb
install -c -m 0644 rubygems/defaults.rb /usr/lib/ruby/site_ruby/1.8/rubygems/defaults.rb
install -c -m 0644 rubygems/installer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb
install -c -m 0644 rubygems/user_interaction.rb /usr/lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb
install -c -m 0644 rubygems/dependency_installer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb
install -c -m 0644 rubygems/version.rb /usr/lib/ruby/site_ruby/1.8/rubygems/version.rb
install -c -m 0644 rubygems/command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/command.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/indexer
install -c -m 0644 rubygems/indexer/latest_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/latest_index_builder.rb
install -c -m 0644 rubygems/indexer/master_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/master_index_builder.rb
install -c -m 0644 rubygems/indexer/quick_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/quick_index_builder.rb
install -c -m 0644 rubygems/indexer/marshal_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/marshal_index_builder.rb
install -c -m 0644 rubygems/indexer/abstract_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/abstract_index_builder.rb
install -c -m 0644 rubygems/security.rb /usr/lib/ruby/site_ruby/1.8/rubygems/security.rb
install -c -m 0644 rubygems/config_file.rb /usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb
install -c -m 0644 rubygems/version_option.rb /usr/lib/ruby/site_ruby/1.8/rubygems/version_option.rb
install -c -m 0644 rubygems/source_index.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb
install -c -m 0644 rubygems/command_manager.rb /usr/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb
install -c -m 0644 rubygems/doc_manager.rb /usr/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb
install -c -m 0644 rubygems/require_paths_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/require_paths_builder.rb
install -c -m 0644 rubygems/gem_openssl.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_openssl.rb
install -c -m 0644 rubygems/source_info_cache.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb
install -c -m 0644 rubygems/dependency.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb
install -c -m 0644 rubygems/format.rb /usr/lib/ruby/site_ruby/1.8/rubygems/format.rb
install -c -m 0644 rubygems/server.rb /usr/lib/ruby/site_ruby/1.8/rubygems/server.rb
install -c -m 0644 rubygems/local_remote_options.rb /usr/lib/ruby/site_ruby/1.8/rubygems/local_remote_options.rb
install -c -m 0644 rubygems/remote_fetcher.rb /usr/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb
install -c -m 0644 rubygems/uninstaller.rb /usr/lib/ruby/site_ruby/1.8/rubygems/uninstaller.rb
install -c -m 0644 rubygems/dependency_list.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_list.rb
install -c -m 0644 rubygems/rubygems_version.rb /usr/lib/ruby/site_ruby/1.8/rubygems/rubygems_version.rb
install -c -m 0644 rubygems/install_update_options.rb /usr/lib/ruby/site_ruby/1.8/rubygems/install_update_options.rb
install -c -m 0644 rubygems/package.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package.rb
install -c -m 0644 rubygems/specification.rb /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb
install -c -m 0644 rubygems/source_info_cache_entry.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_info_cache_entry.rb
install -c -m 0644 rubygems/gem_runner.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb
install -c -m 0644 rubygems/custom_require.rb /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/package
install -c -m 0644 rubygems/package/tar_reader.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader
install -c -m 0644 rubygems/package/tar_reader/entry.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader/entry.rb
install -c -m 0644 rubygems/package/tar_input.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb
install -c -m 0644 rubygems/package/f_sync_dir.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/f_sync_dir.rb
install -c -m 0644 rubygems/package/tar_writer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_writer.rb
install -c -m 0644 rubygems/package/tar_header.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_header.rb
install -c -m 0644 rubygems/package/tar_output.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_output.rb
install -c -m 0644 rubygems/timer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/timer.rb
install -c -m 0644 rubygems/indexer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer.rb
install -c -m 0644 rubygems/platform.rb /usr/lib/ruby/site_ruby/1.8/rubygems/platform.rb
install -c -m 0644 rubygems/requirement.rb /usr/lib/ruby/site_ruby/1.8/rubygems/requirement.rb
install -c -m 0644 rubygems/ext.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/commands
install -c -m 0644 rubygems/commands/generate_index_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/generate_index_command.rb
install -c -m 0644 rubygems/commands/fetch_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/fetch_command.rb
install -c -m 0644 rubygems/commands/contents_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/contents_command.rb
install -c -m 0644 rubygems/commands/help_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/help_command.rb
install -c -m 0644 rubygems/commands/sources_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/sources_command.rb
install -c -m 0644 rubygems/commands/list_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/list_command.rb
install -c -m 0644 rubygems/commands/query_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/query_command.rb
install -c -m 0644 rubygems/commands/search_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/search_command.rb
install -c -m 0644 rubygems/commands/dependency_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/dependency_command.rb
install -c -m 0644 rubygems/commands/which_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/which_command.rb
install -c -m 0644 rubygems/commands/update_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/update_command.rb
install -c -m 0644 rubygems/commands/uninstall_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/uninstall_command.rb
install -c -m 0644 rubygems/commands/environment_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/environment_command.rb
install -c -m 0644 rubygems/commands/build_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/build_command.rb
install -c -m 0644 rubygems/commands/unpack_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/unpack_command.rb
install -c -m 0644 rubygems/commands/server_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/server_command.rb
install -c -m 0644 rubygems/commands/cert_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/cert_command.rb
install -c -m 0644 rubygems/commands/mirror_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/mirror_command.rb
install -c -m 0644 rubygems/commands/rdoc_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/rdoc_command.rb
install -c -m 0644 rubygems/commands/lock_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/lock_command.rb
install -c -m 0644 rubygems/commands/pristine_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
install -c -m 0644 rubygems/commands/check_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/check_command.rb
install -c -m 0644 rubygems/commands/cleanup_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/cleanup_command.rb
install -c -m 0644 rubygems/commands/specification_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/specification_command.rb
install -c -m 0644 rubygems/commands/outdated_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/outdated_command.rb
install -c -m 0644 rubygems/commands/install_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb
install -c -m 0644 rubygems/builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/builder.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/ext
install -c -m 0644 rubygems/ext/rake_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/rake_builder.rb
install -c -m 0644 rubygems/ext/configure_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/configure_builder.rb
install -c -m 0644 rubygems/ext/builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/builder.rb
install -c -m 0644 rubygems/ext/ext_conf_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/ext_conf_builder.rb
install -c -m 0644 rubygems/old_format.rb /usr/lib/ruby/site_ruby/1.8/rubygems/old_format.rb
install -c -m 0644 ubygems.rb /usr/lib/ruby/site_ruby/1.8/ubygems.rb
install -c -m 0644 rubygems.rb /usr/lib/ruby/site_ruby/1.8/rubygems.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rbconfig
install -c -m 0644 rbconfig/datadir.rb /usr/lib/ruby/site_ruby/1.8/rbconfig/datadir.rb
cp gem /tmp/gem
install -c -m 0755 /tmp/gem /usr/bin/gem
rm /tmp/gem
rm -f /usr/lib/ruby/gems/1.8/source_cache
Removing old RubyGems RDoc and ri
Installing rubygems-1.1.1 ri into /usr/lib/ruby/gems/1.8/doc/rubygems-1.1.1/ri
Installing rubygems-1.1.1 rdoc into /usr/lib/ruby/gems/1.8/doc/rubygems-1.1.1/rdoc
As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a while)
...done.
No library stubs found.
▼<yum update>
[一般ユーザ@ rubygems-1.1.1]$
Transaction Summary
=============================================================================
Install 7 Package(s)
Update 231 Package(s)
Remove 1 Package(s)
Total download size: 386 M
Is this ok [y/N]: y
Downloading Packages:
(1/238): libraw1394-1.2.1 100% |=========================| 43 kB 00:06
(238/238): qt-3.3.8b-1.fc 100% |=========================| 3.6 MB 00:16
Removed: kernel.i686 0:2.6.21-1.3194.fc7
Installed: kernel.i686 0:2.6.23.15-80.fc7
Complete!
▼<ImageMagick-devel・ruby-devel・rubygems・ghostscript-devel・lcms-develインストール/ruby・IMgageMagickがインストール済であることを確認>
[root@]# yum install ruby ruby-devel rubygems ImageMagick ImageMagick-devel ruby-mysql httpd
Package ruby - 1.8.6.114-1.fc7.i386 is already installed.
Package ImageMagick - 6.3.2.9-3.fc7.i386 is already installed.
No package ruby-mysql httpd available.
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ImageMagick-devel i386 6.3.2.9-3.fc7 fedora 76 k
ruby-devel i386 1.8.6.114-1.fc7 updates 770 k
rubygems noarch 0.9.4-1.fc7 updates 498 k
Installing for dependencies:
ghostscript-devel i386 8.15.4-4.fc7 updates 41 k
lcms-devel i386 1.16-3 fedora 51 k
Transaction Summary
=============================================================================
Install 5 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Is this ok [y/N]: y
Installed: ImageMagick-devel.i386 0:6.3.2.9-3.fc7 ruby-devel.i386 0:1.8.6.114-1.fc7 rubygems.noarch 0:0.9.4-1.fc7
Dependency Installed: ghostscript-devel.i386 0:8.15.4-4.fc7 lcms-devel.i386 0:1.16-3
Complete!
▼<mysql-serverインストール済であることを確認>
[一般ユーザ@]$ yum -y install mysql-server
You need to be root to perform this command.
[一般ユーザ@]$ sudo yum -y install mysql-server
Password:
Package mysql-server - 5.0.45-6.fc7.i386 is already installed.
Nothing to do
▼<railsインストール>
[一般ユーザ@ rubygems-1.1.1]$ sudo gem install -y rails
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Bulk updating Gem source index for: http://gems.rubyforge.org/
Successfully installed rails-2.0.2
1 gem installed
▼<passengerインストール>
[一般ユーザ@]$ sudo gem install passenger
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.1
Successfully installed passenger-1.0.5
2 gems installed
Installing ri documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
Installing ri documentation for passenger-1.0.5...
Installing RDoc documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
Installing RDoc documentation for passenger-1.0.5...
./doc/template/horo.rb:17: warning: already initialized constant FONTS
./doc/template/horo.rb:19: warning: already initialized constant STYLE
./doc/template/horo.rb:213: warning: already initialized constant XHTML_PREAMBLE
./doc/template/horo.rb:221: warning: already initialized constant HEADER
./doc/template/horo.rb:272: warning: already initialized constant FILE_PAGE
./doc/template/horo.rb:300: warning: already initialized constant CLASS_PAGE
./doc/template/horo.rb:338: warning: already initialized constant METHOD_LIST
./doc/template/horo.rb:486: warning: already initialized constant FOOTER
./doc/template/horo.rb:491: warning: already initialized constant BODY
./doc/template/horo.rb:503: warning: already initialized constant SRC_PAGE
./doc/template/horo.rb:531: warning: already initialized constant FR_INDEX_BODY
./doc/template/horo.rb:535: warning: already initialized constant FILE_INDEX
./doc/template/horo.rb:583: warning: already initialized constant CLASS_INDEX
./doc/template/horo.rb:584: warning: already initialized constant METHOD_INDEX
./doc/template/horo.rb:586: warning: already initialized constant INDEX
▼<fastthreadインストール>
[一般ユーザ@]$ sudo gem install fastthread
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.1
1 gem installed
Installing ri documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
Installing RDoc documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
▼<Apache 2 moduleインストール>
[一般ユーザ@]$ sudo passenger-install-apache2-module
Welcome to the Passenger Apache 2 module installer, v1.0.5.
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.
1
Checking for required software...
* GNU C++ compiler... found at /usr/lib/ccache/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
* Apache Portable Runtime (APR) development headers... found
* fastthread... 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.
--------------------------------------------
Installation instructions for required software
* To install Apache 2 development headers:
Please run yum install httpd-devel as root.
▼<Apache 2 development headersインストール>
[一般ユーザ@]$ sudo yum install httpd-devel
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
httpd-devel i386 2.2.8-1.fc7 updates 144 k
Installing for dependencies:
apr-devel i386 1.2.8-6 fedora 170 k
apr-util-devel i386 1.2.10-1.fc7 updates 54 k
Transaction Summary
=============================================================================
Install 3 Package(s)
Is this ok [y/N]: y
Installed: httpd-devel.i386 0:2.2.8-1.fc7
Dependency Installed: apr-devel.i386 0:1.2.8-6 apr-util-devel.i386 0:1.2.10-1.fc7
Complete!
[一般ユーザ@]$ sudo passenger-install-apache2-module
Password:
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.
Press Enter to continue, or Ctrl-C to abort.
2
Checking for required software...
* GNU C++ compiler... found at /usr/lib/ccache/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
--------------------------------------------
--------------------------------------------
Compiling and installing Apache 2 module...
cd /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5
rake clean apache2
(in /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5)
### In ext/apache2:
rm -rf Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o mod_passenger.so
### In ext/passenger:
make clean
rm -f Makefile
### In ext/boost/src:
rm -f libboost_thread.a *.o
### In test:
rm -f Apache2ModuleTests *.o
### In benchmark:
rm -f DummyRequestHandler
### In ext/boost/src:
g++ -O2 -fPIC -I../.. -D_REENTRANT -DNDEBUG -c *.cpp
ar cru libboost_thread.a *.o
ranlib libboost_thread.a
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c mod_passenger.c
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c Utils.cpp
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c Logging.cpp
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c Configuration.cpp
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c Hooks.cpp
### In ext/apache2:
g++ -shared Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o -fPIC -o mod_passenger.so -lstdc++ -lpthread ../boost/src/libboost_thread.a -lapr-1
### In ext/passenger:
ruby extconf.rb
creating Makefile
### In ext/passenger:
make
gcc -I. -I/usr/lib/ruby/1.8/i386-linux -I/usr/lib/ruby/1.8/i386-linux -I. -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -fPIC -c native_support.c
gcc -shared -o native_support.so native_support.o -L"." -L"/usr/lib" -L. -rdynamic -Wl,-export-dynamic -lruby -lpthread -ldl -lcrypt -lm -lc
--------------------------------------------
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server
RailsRuby /usr/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!
--------------------------------------------
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-1.0.5/doc/Users guide.html
Enjoy Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/
▼<httpd.conf 編集>
cd /etc/httpd/conf
vi httpd.conf
下記行追加
LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /opt/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /opt/local/bin/ruby
RailsEnv development
▼で、今はここ。
疲れたので、休憩中。
これからどうする?
▼メモ
・Mongrel
・Thin
・Passenger
▼参考url
▽今週の話題 : Passenger (mod_rails for Apache) - Apache で簡単に Rails を運用など - WebOS Goodies
http://webos-goodies.jp/archives/51320129.html
▽MOONGIFT: » チェック必須!Rails新時代の到来か?「Passenger(mod_rails for Apache)」:オープンソースを毎日紹介
http://www.moongift.jp/2008/04/passenger/
▽Rails 2.0 » ホスティングサービスでもRailsが利用できるようになるかも、な「Passenger」
http://rails20.jp/2008/04/passenger/
▽サーバのIPアドレス/PROGRAMMIN3G/ウェブプログラミング
http://inwr2.ifdef.jp/linux/homeserver/0/index.html
▽未サポートのエスケープシーケンスを見つけました ESC [?1034h/端っこなひとの備忘録: Fedora7のネットワークインストールメモ
http://animemo.seesaa.net/article/92542363.html
▽Apacheのバージョンを調べるには
http://www.ksknet.net/apache/apache_1.html
▽sudoコマンドは、なにも設定していない状態では一般ユーザはデフォルトで使用できないようになっています/sudo による管理者権限の付与
http://linux.kororo.jp/cont/intro/sudo.php
▽visudoコマンド/root用コマンドを特定ユーザーが実行できるようにするには
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/221rootcomuse.html
▽rubygemsとは - はてなダイアリー
http://d.hatena.ne.jp/keyword/rubygems
▽コマンド名がgemであるRuby のパッケージ管理システムRubyGemsをインストール/PROGRAMMIN3G/ウェブプログラミング
http://inwr2.ifdef.jp/linux/vmware2/vmfile3/index.html
▽Another app is currently holding the yum lock; waiting for it to exit.../FC8のアップデートが出来なくなりました。
http://kajuhome.com/cgi-bin/patio/patio.cgi?mode=view&no=1480
▽wget command not found/コマンドがないと言われています。 - 教えて!goo
http://oshiete1.goo.ne.jp/qa2107370.html
▽`gem_original_require': no such file to load -- rdoc/rdoc (LoadError)/CentOS5にRailsインストール - Get crazy
http://d.hatena.ne.jp/mtbtaizo/20070909
■<Xreaでrailsアプリを公開したい>
自宅サーバーは「スペックがあまりよろしくない」&「そもそも仕組み自体をよく分かっていない」ため、できればXreaで公開したいと考えていた。前回、ググったときはレスポンスとかが厳しそうだったけど、そろそろ何か進展あるかも? てことで期待をしながら再度検索してみたのだが……、。
結論としては、Xreaでrailsアプリを公開してみよーってのは、ちょっと難しいようだ。
さらに、この壮大なるプロジェクトにかけることが出来る予算は、実質的に0円なので、他のレンサバを借りることは出来ない……。=やっぱ、自宅サーバーしかないのか……。
■<自宅サーバーでrailsサンプルを動かしたい>
「Fast CGI」とか全然やったこともないのに、何か良さ気なヤツを発見したので、とりあえず試してみることにする。「Passenger」? 聞いたこともない名前だけど……。
■<サーバ環境>
・Fedora7
・Web&ファイル共有サーバーとして、以前、構築していたもの(スクラップ同然のスペックということもあり、基本的にかなりの放置プレイ中)
▼<Apacheバージョン確認>
・Poderosa―新規接続[ホスト(H)][アカウント(A)][パスフレーズ(P)]
未サポートのエスケープシーケンスを見つけました ESC [?1034h
exit
・Poderosa―新規接続[種類(Y)]プルダウンより、xtermをvt100へと変更
[一般user@]$ httpd -v
-bash: httpd: command not found
[一般user@]$ su -
パスワード:
[root@]# httpd -v
Server version: Apache/2.2.6 (Unix)
▼<一般userに対してsudo コマンドを使用できるよう設定>
・Poderosa―rootで新規接続
visudo
Enter
I―インサートモードへ
最後の行に、sampleuser ALL=(ALL) ALL を追加
Esc―コマンドモードへ
:wq―保存して終了
exit
・Poderosa―一般userで新規接続
試しにroot しか閲覧することのできない/var/log/messageをsudo コマンドを実行してみることにする。
sudo tail /var/log/messages
Password:一般userのパスワード
May 14 10:48:53 一般user ntpd[1691]: kernel time sync status change 0001
▼<「yum-updatesd」サービス停止>
[一般user@]$ /etc/rc.d/init.d/yum-updatesd stop
yum-updates を停止中: [失敗]
rm: cannot remove `/var/lock/subsys/yum-updatesd': 許可がありません
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
Exiting on user cancel.
[一般user@]$ sudo /etc/rc.d/init.d/yum-updatesd stop
yum-updates を停止中:
[ OK ]
▼<rubyインストール>
[一般user@]$ yum -y install ruby
You need to be root to perform this command.
[一般user@]$ sudo yum -y install ruby
Password:
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ruby i386 1.8.6.114-1.fc7 updates 514 k
Updating for dependencies:
ruby-libs i386 1.8.6.114-1.fc7 updates 1.7 M
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 1 Package(s)
Complete!
▼<wgetインストール>
[一般user@]$ yum install wget
You need to be root to perform this command.
[root@]# yum install wget
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
wget i386 1.10.2-15.fc7 fedora 585 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Is this ok [y/N]: y
Installed: wget.i386 0:1.10.2-15.fc7
Complete!
▼<rubygemsインストール>
[一般user@]$ wget http://rubyforge.org/frs/download.php/35283/rubygems-1.1.1.tgz
17:29:11 (134.33 KB/s) - `rubygems-1.1.1.tgz' を保存しました [423308/423308]
[一般user@]$ ls
rubygems-1.1.1.tgz
[一般user@]$ tar xzf rubygems-1.1.1.tgz
[一般user@]$ ls
rubygems-1.1.1 rubygems-1.1.1.tgz
[一般user@]$ cd rubygems-1.1.1
[一般user@ rubygems-1.1.1]$ sudo ruby setup.rb
Password:
./lib/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
from ./lib/rubygems/custom_require.rb:27:in `require'
from setup.rb:51
▼<rdocインストール>
[一般user@ rubygems-1.1.1]$ yum install rdoc
You need to be root to perform this command.
[一般user@アドレス rubygems-1.1.1]$ sudo yum install rdoc
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ruby-rdoc i386 1.8.6.114-1.fc7 updates 342 k
Installing for dependencies:
ruby-irb i386 1.8.6.114-1.fc7 updates 274 k
Transaction Summary
=============================================================================
Install 2 Package(s)
Is this ok [y/N]: y
Installed: ruby-rdoc.i386 0:1.8.6.114-1.fc7
Dependency Installed: ruby-irb.i386 0:1.8.6.114-1.fc7
Complete!
▼<rubygemsインストールに再挑戦>
[一般user@ rubygems-1.1.1]$ sudo ruby setup.rb
Password:
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems
install -c -m 0644 rubygems/gem_path_searcher.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb
install -c -m 0644 rubygems/exceptions.rb /usr/lib/ruby/site_ruby/1.8/rubygems/exceptions.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/digest
install -c -m 0644 rubygems/digest/sha2.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/sha2.rb
install -c -m 0644 rubygems/digest/digest_adapter.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/digest_adapter.rb
install -c -m 0644 rubygems/digest/md5.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/md5.rb
install -c -m 0644 rubygems/digest/sha1.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/sha1.rb
install -c -m 0644 rubygems/validator.rb /usr/lib/ruby/site_ruby/1.8/rubygems/validator.rb
install -c -m 0644 rubygems/defaults.rb /usr/lib/ruby/site_ruby/1.8/rubygems/defaults.rb
install -c -m 0644 rubygems/installer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb
install -c -m 0644 rubygems/user_interaction.rb /usr/lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb
install -c -m 0644 rubygems/dependency_installer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb
install -c -m 0644 rubygems/version.rb /usr/lib/ruby/site_ruby/1.8/rubygems/version.rb
install -c -m 0644 rubygems/command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/command.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/indexer
install -c -m 0644 rubygems/indexer/latest_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/latest_index_builder.rb
install -c -m 0644 rubygems/indexer/master_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/master_index_builder.rb
install -c -m 0644 rubygems/indexer/quick_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/quick_index_builder.rb
install -c -m 0644 rubygems/indexer/marshal_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/marshal_index_builder.rb
install -c -m 0644 rubygems/indexer/abstract_index_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer/abstract_index_builder.rb
install -c -m 0644 rubygems/security.rb /usr/lib/ruby/site_ruby/1.8/rubygems/security.rb
install -c -m 0644 rubygems/config_file.rb /usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb
install -c -m 0644 rubygems/version_option.rb /usr/lib/ruby/site_ruby/1.8/rubygems/version_option.rb
install -c -m 0644 rubygems/source_index.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb
install -c -m 0644 rubygems/command_manager.rb /usr/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb
install -c -m 0644 rubygems/doc_manager.rb /usr/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb
install -c -m 0644 rubygems/require_paths_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/require_paths_builder.rb
install -c -m 0644 rubygems/gem_openssl.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_openssl.rb
install -c -m 0644 rubygems/source_info_cache.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb
install -c -m 0644 rubygems/dependency.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb
install -c -m 0644 rubygems/format.rb /usr/lib/ruby/site_ruby/1.8/rubygems/format.rb
install -c -m 0644 rubygems/server.rb /usr/lib/ruby/site_ruby/1.8/rubygems/server.rb
install -c -m 0644 rubygems/local_remote_options.rb /usr/lib/ruby/site_ruby/1.8/rubygems/local_remote_options.rb
install -c -m 0644 rubygems/remote_fetcher.rb /usr/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb
install -c -m 0644 rubygems/uninstaller.rb /usr/lib/ruby/site_ruby/1.8/rubygems/uninstaller.rb
install -c -m 0644 rubygems/dependency_list.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_list.rb
install -c -m 0644 rubygems/rubygems_version.rb /usr/lib/ruby/site_ruby/1.8/rubygems/rubygems_version.rb
install -c -m 0644 rubygems/install_update_options.rb /usr/lib/ruby/site_ruby/1.8/rubygems/install_update_options.rb
install -c -m 0644 rubygems/package.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package.rb
install -c -m 0644 rubygems/specification.rb /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb
install -c -m 0644 rubygems/source_info_cache_entry.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_info_cache_entry.rb
install -c -m 0644 rubygems/gem_runner.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb
install -c -m 0644 rubygems/custom_require.rb /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/package
install -c -m 0644 rubygems/package/tar_reader.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader
install -c -m 0644 rubygems/package/tar_reader/entry.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader/entry.rb
install -c -m 0644 rubygems/package/tar_input.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb
install -c -m 0644 rubygems/package/f_sync_dir.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/f_sync_dir.rb
install -c -m 0644 rubygems/package/tar_writer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_writer.rb
install -c -m 0644 rubygems/package/tar_header.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_header.rb
install -c -m 0644 rubygems/package/tar_output.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_output.rb
install -c -m 0644 rubygems/timer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/timer.rb
install -c -m 0644 rubygems/indexer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer.rb
install -c -m 0644 rubygems/platform.rb /usr/lib/ruby/site_ruby/1.8/rubygems/platform.rb
install -c -m 0644 rubygems/requirement.rb /usr/lib/ruby/site_ruby/1.8/rubygems/requirement.rb
install -c -m 0644 rubygems/ext.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/commands
install -c -m 0644 rubygems/commands/generate_index_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/generate_index_command.rb
install -c -m 0644 rubygems/commands/fetch_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/fetch_command.rb
install -c -m 0644 rubygems/commands/contents_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/contents_command.rb
install -c -m 0644 rubygems/commands/help_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/help_command.rb
install -c -m 0644 rubygems/commands/sources_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/sources_command.rb
install -c -m 0644 rubygems/commands/list_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/list_command.rb
install -c -m 0644 rubygems/commands/query_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/query_command.rb
install -c -m 0644 rubygems/commands/search_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/search_command.rb
install -c -m 0644 rubygems/commands/dependency_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/dependency_command.rb
install -c -m 0644 rubygems/commands/which_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/which_command.rb
install -c -m 0644 rubygems/commands/update_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/update_command.rb
install -c -m 0644 rubygems/commands/uninstall_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/uninstall_command.rb
install -c -m 0644 rubygems/commands/environment_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/environment_command.rb
install -c -m 0644 rubygems/commands/build_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/build_command.rb
install -c -m 0644 rubygems/commands/unpack_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/unpack_command.rb
install -c -m 0644 rubygems/commands/server_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/server_command.rb
install -c -m 0644 rubygems/commands/cert_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/cert_command.rb
install -c -m 0644 rubygems/commands/mirror_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/mirror_command.rb
install -c -m 0644 rubygems/commands/rdoc_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/rdoc_command.rb
install -c -m 0644 rubygems/commands/lock_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/lock_command.rb
install -c -m 0644 rubygems/commands/pristine_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
install -c -m 0644 rubygems/commands/check_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/check_command.rb
install -c -m 0644 rubygems/commands/cleanup_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/cleanup_command.rb
install -c -m 0644 rubygems/commands/specification_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/specification_command.rb
install -c -m 0644 rubygems/commands/outdated_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/outdated_command.rb
install -c -m 0644 rubygems/commands/install_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb
install -c -m 0644 rubygems/builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/builder.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/ext
install -c -m 0644 rubygems/ext/rake_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/rake_builder.rb
install -c -m 0644 rubygems/ext/configure_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/configure_builder.rb
install -c -m 0644 rubygems/ext/builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/builder.rb
install -c -m 0644 rubygems/ext/ext_conf_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/ext_conf_builder.rb
install -c -m 0644 rubygems/old_format.rb /usr/lib/ruby/site_ruby/1.8/rubygems/old_format.rb
install -c -m 0644 ubygems.rb /usr/lib/ruby/site_ruby/1.8/ubygems.rb
install -c -m 0644 rubygems.rb /usr/lib/ruby/site_ruby/1.8/rubygems.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rbconfig
install -c -m 0644 rbconfig/datadir.rb /usr/lib/ruby/site_ruby/1.8/rbconfig/datadir.rb
cp gem /tmp/gem
install -c -m 0755 /tmp/gem /usr/bin/gem
rm /tmp/gem
rm -f /usr/lib/ruby/gems/1.8/source_cache
Removing old RubyGems RDoc and ri
Installing rubygems-1.1.1 ri into /usr/lib/ruby/gems/1.8/doc/rubygems-1.1.1/ri
Installing rubygems-1.1.1 rdoc into /usr/lib/ruby/gems/1.8/doc/rubygems-1.1.1/rdoc
As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a while)
...done.
No library stubs found.
▼<yum update>
[一般ユーザ@ rubygems-1.1.1]$
Transaction Summary
=============================================================================
Install 7 Package(s)
Update 231 Package(s)
Remove 1 Package(s)
Total download size: 386 M
Is this ok [y/N]: y
Downloading Packages:
(1/238): libraw1394-1.2.1 100% |=========================| 43 kB 00:06
(238/238): qt-3.3.8b-1.fc 100% |=========================| 3.6 MB 00:16
Removed: kernel.i686 0:2.6.21-1.3194.fc7
Installed: kernel.i686 0:2.6.23.15-80.fc7
Complete!
▼<ImageMagick-devel・ruby-devel・rubygems・ghostscript-devel・lcms-develインストール/ruby・IMgageMagickがインストール済であることを確認>
[root@]# yum install ruby ruby-devel rubygems ImageMagick ImageMagick-devel ruby-mysql httpd
Package ruby - 1.8.6.114-1.fc7.i386 is already installed.
Package ImageMagick - 6.3.2.9-3.fc7.i386 is already installed.
No package ruby-mysql httpd available.
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ImageMagick-devel i386 6.3.2.9-3.fc7 fedora 76 k
ruby-devel i386 1.8.6.114-1.fc7 updates 770 k
rubygems noarch 0.9.4-1.fc7 updates 498 k
Installing for dependencies:
ghostscript-devel i386 8.15.4-4.fc7 updates 41 k
lcms-devel i386 1.16-3 fedora 51 k
Transaction Summary
=============================================================================
Install 5 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Is this ok [y/N]: y
Installed: ImageMagick-devel.i386 0:6.3.2.9-3.fc7 ruby-devel.i386 0:1.8.6.114-1.fc7 rubygems.noarch 0:0.9.4-1.fc7
Dependency Installed: ghostscript-devel.i386 0:8.15.4-4.fc7 lcms-devel.i386 0:1.16-3
Complete!
▼<mysql-serverインストール済であることを確認>
[一般ユーザ@]$ yum -y install mysql-server
You need to be root to perform this command.
[一般ユーザ@]$ sudo yum -y install mysql-server
Password:
Package mysql-server - 5.0.45-6.fc7.i386 is already installed.
Nothing to do
▼<railsインストール>
[一般ユーザ@ rubygems-1.1.1]$ sudo gem install -y rails
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Bulk updating Gem source index for: http://gems.rubyforge.org/
Successfully installed rails-2.0.2
1 gem installed
▼<passengerインストール>
[一般ユーザ@]$ sudo gem install passenger
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.1
Successfully installed passenger-1.0.5
2 gems installed
Installing ri documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
Installing ri documentation for passenger-1.0.5...
Installing RDoc documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
Installing RDoc documentation for passenger-1.0.5...
./doc/template/horo.rb:17: warning: already initialized constant FONTS
./doc/template/horo.rb:19: warning: already initialized constant STYLE
./doc/template/horo.rb:213: warning: already initialized constant XHTML_PREAMBLE
./doc/template/horo.rb:221: warning: already initialized constant HEADER
./doc/template/horo.rb:272: warning: already initialized constant FILE_PAGE
./doc/template/horo.rb:300: warning: already initialized constant CLASS_PAGE
./doc/template/horo.rb:338: warning: already initialized constant METHOD_LIST
./doc/template/horo.rb:486: warning: already initialized constant FOOTER
./doc/template/horo.rb:491: warning: already initialized constant BODY
./doc/template/horo.rb:503: warning: already initialized constant SRC_PAGE
./doc/template/horo.rb:531: warning: already initialized constant FR_INDEX_BODY
./doc/template/horo.rb:535: warning: already initialized constant FILE_INDEX
./doc/template/horo.rb:583: warning: already initialized constant CLASS_INDEX
./doc/template/horo.rb:584: warning: already initialized constant METHOD_INDEX
./doc/template/horo.rb:586: warning: already initialized constant INDEX
▼<fastthreadインストール>
[一般ユーザ@]$ sudo gem install fastthread
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.1
1 gem installed
Installing ri documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
Installing RDoc documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
▼<Apache 2 moduleインストール>
[一般ユーザ@]$ sudo passenger-install-apache2-module
Welcome to the Passenger Apache 2 module installer, v1.0.5.
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.
1
Checking for required software...
* GNU C++ compiler... found at /usr/lib/ccache/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
* Apache Portable Runtime (APR) development headers... found
* fastthread... 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.
--------------------------------------------
Installation instructions for required software
* To install Apache 2 development headers:
Please run yum install httpd-devel as root.
▼<Apache 2 development headersインストール>
[一般ユーザ@]$ sudo yum install httpd-devel
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
httpd-devel i386 2.2.8-1.fc7 updates 144 k
Installing for dependencies:
apr-devel i386 1.2.8-6 fedora 170 k
apr-util-devel i386 1.2.10-1.fc7 updates 54 k
Transaction Summary
=============================================================================
Install 3 Package(s)
Is this ok [y/N]: y
Installed: httpd-devel.i386 0:2.2.8-1.fc7
Dependency Installed: apr-devel.i386 0:1.2.8-6 apr-util-devel.i386 0:1.2.10-1.fc7
Complete!
[一般ユーザ@]$ sudo passenger-install-apache2-module
Password:
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.
Press Enter to continue, or Ctrl-C to abort.
2
Checking for required software...
* GNU C++ compiler... found at /usr/lib/ccache/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
--------------------------------------------
--------------------------------------------
Compiling and installing Apache 2 module...
cd /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5
rake clean apache2
(in /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5)
### In ext/apache2:
rm -rf Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o mod_passenger.so
### In ext/passenger:
make clean
rm -f Makefile
### In ext/boost/src:
rm -f libboost_thread.a *.o
### In test:
rm -f Apache2ModuleTests *.o
### In benchmark:
rm -f DummyRequestHandler
### In ext/boost/src:
g++ -O2 -fPIC -I../.. -D_REENTRANT -DNDEBUG -c *.cpp
ar cru libboost_thread.a *.o
ranlib libboost_thread.a
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c mod_passenger.c
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c Utils.cpp
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c Logging.cpp
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c Configuration.cpp
### In ext/apache2:
g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -D_REENTRANT -Wall -g -I/usr/local/include -c Hooks.cpp
### In ext/apache2:
g++ -shared Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o -fPIC -o mod_passenger.so -lstdc++ -lpthread ../boost/src/libboost_thread.a -lapr-1
### In ext/passenger:
ruby extconf.rb
creating Makefile
### In ext/passenger:
make
gcc -I. -I/usr/lib/ruby/1.8/i386-linux -I/usr/lib/ruby/1.8/i386-linux -I. -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -fPIC -c native_support.c
gcc -shared -o native_support.so native_support.o -L"." -L"/usr/lib" -L. -rdynamic -Wl,-export-dynamic -lruby -lpthread -ldl -lcrypt -lm -lc
--------------------------------------------
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server
RailsRuby /usr/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!
--------------------------------------------
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-1.0.5/doc/Users guide.html
Enjoy Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/
▼<httpd.conf 編集>
cd /etc/httpd/conf
vi httpd.conf
下記行追加
LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /opt/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /opt/local/bin/ruby
RailsEnv development
▼で、今はここ。
疲れたので、休憩中。
これからどうする?
▼メモ
・Mongrel
・Thin
・Passenger
▼参考url
▽今週の話題 : Passenger (mod_rails for Apache) - Apache で簡単に Rails を運用など - WebOS Goodies
http://webos-goodies.jp/archives/51320129.html
▽MOONGIFT: » チェック必須!Rails新時代の到来か?「Passenger(mod_rails for Apache)」:オープンソースを毎日紹介
http://www.moongift.jp/2008/04/passenger/
▽Rails 2.0 » ホスティングサービスでもRailsが利用できるようになるかも、な「Passenger」
http://rails20.jp/2008/04/passenger/
▽サーバのIPアドレス/PROGRAMMIN3G/ウェブプログラミング
http://inwr2.ifdef.jp/linux/homeserver/0/index.html
▽未サポートのエスケープシーケンスを見つけました ESC [?1034h/端っこなひとの備忘録: Fedora7のネットワークインストールメモ
http://animemo.seesaa.net/article/92542363.html
▽Apacheのバージョンを調べるには
http://www.ksknet.net/apache/apache_1.html
▽sudoコマンドは、なにも設定していない状態では一般ユーザはデフォルトで使用できないようになっています/sudo による管理者権限の付与
http://linux.kororo.jp/cont/intro/sudo.php
▽visudoコマンド/root用コマンドを特定ユーザーが実行できるようにするには
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/221rootcomuse.html
▽rubygemsとは - はてなダイアリー
http://d.hatena.ne.jp/keyword/rubygems
▽コマンド名がgemであるRuby のパッケージ管理システムRubyGemsをインストール/PROGRAMMIN3G/ウェブプログラミング
http://inwr2.ifdef.jp/linux/vmware2/vmfile3/index.html
▽Another app is currently holding the yum lock; waiting for it to exit.../FC8のアップデートが出来なくなりました。
http://kajuhome.com/cgi-bin/patio/patio.cgi?mode=view&no=1480
▽wget command not found/コマンドがないと言われています。 - 教えて!goo
http://oshiete1.goo.ne.jp/qa2107370.html
▽`gem_original_require': no such file to load -- rdoc/rdoc (LoadError)/CentOS5にRailsインストール - Get crazy
http://d.hatena.ne.jp/mtbtaizo/20070909