#pgid
 
 - http://wiki.rubyonrails.com/rails/pages/RailsWebHosts
  As of October 16th 2004, DavidHeinemeierHansson is now also part of
  the team behind Textdrive. See TextDriveUsers
 - http://wiki.rubyonrails.org/rails/pages/TextDrive
 - http://techno.hippy.jp/rorwiki/?TxD%2FInstalling+a+Rails+Application+at+TextDrive
 なんかを見ると、TextDriveはRailsが使える共用ホスティングとして、一番よい選択肢なのかな、と思い、借りることにしました :)
 
 #blikimore
 ** 借りる [#pfb855cf]
 - TextDriveは、joyentという会社(?)のサービスの一部になってるらしい。
 - Joyentは、
 http://joyent.com/about/
 によると、
  communicate and collaborate with email, calendaring, contacts, file sharing, 
  and other shared applications.
 ということで、Web上のグループウェア、ファイル共有などのシステムをやってて、
  In November 2005, Joyent acquired TextDrive, 
 ということで、2005年11月にTextDriveをゲットしたらしい
 - なので、契約すると、Webホスティングだけでなく、グループウェアとかファイル共有のサービスまで利用できるようになります。
 - ここがWebホスティングの紹介
 http://joyent.com/connector/web-hosting/
 - http://www.joyent.com/connector/pricing/ の 「Startup」(月額15$)というところから借りました。
 - 借りるとメールが4通くらい届きます。
 -- ありがとうメール
 -- 支払い関連のメール
 -- グループウェアとか総合コントロールパネルのアカウント情報メール
 -- ファイル共有のアカウントのメール
 - ありがとうメールの中に
  Detailed access information for your TextDrive web hosting
  account will follow shortly.
  Textdrive setup time varies depending on the current queue,
  as we have deliberately not automated the account creation process.
 と書いてあり、TextDriveの接続情報は遅れて届きます。自分の場合は、1日くらい遅れてメールが来ました。
 
 ** TextDriveが提供する管理画面とか、機能とか [#c69d94b7]
 - TextDriveの接続情報のメールの中には次の情報があります。
 -- アカウント情報
 -- ドメイン, DNS, IPアドレス
 -- Webminの情報
 -- Userminの情報
 -- Webmailの情報
 -- phpMyAdminの情報
 -- WebDAVの情報
 - 上記ホストに指定されたID, PWでsshしたらsshできました。
 - root権限が必要なapacheの設定とか、メールの設定とかは、Webminを使うようです。
 - DBは一個ありました。自分のアカウントをprefixにして、新しくDBを作ることもできる、と書いてありました。
  hoge_weblog
 - Webminからsubversionも設定できるみたいです。
 - phpはFastCGIで動かせるのかな? そんなディレクトリがありました。
 
 ** セットアップ [#z306de60]
 - http://techno.hippy.jp/rorwiki/?TxD%2FInstalling+a+Rails+Application+at+TextDrive
 にしたがってやるようです。
 - lighttpdを使うことを推奨するようです。
 ++ サポートにlighttpdを使いたいので、ポート割り当てて下さい、のように依頼して、割り当ててもらう
 ++ 自分のホームディレクトリ配下にlighttpdをインストールする
 ++ lighttpdを割り当ててもらったポートで立ち上げる
 ++ 80番のapacheにmod_rewriteを設定して、lighttpdとのリバースプロキシみたく設定する
 -
 といった手順のようです。
 
 ** サポセンにlighttpdのポート割り当てを依頼 [#q49bb02b]
 - http://help.textdrive.com/index.php?pg=request から依頼するようです。
 - http://help.textdrive.com/ によると、
  If you're actively developing or deploying a custom application at TextDrive,
  as much we'd like to help
 とあるので、一応lighttpdのdeployingの相談ってことで。
 - 依頼フォームでは次のようにしました。
 -- Is this request urgent?
  Yes
 -- How would you categorize this request?
  Shared/Biz Port Requests and Extras
 -- How Can We Help?
 こんな感じ。(恥ずかしい XD )
  Hello. 
  My name is Yuki SHIDA. 
  
  TextDrive is very nice service.
  Thank you very much!
  
  I'm trying to setup Ruby on Rails.
  
  I read following page.
  
    http://help.textdrive.com/index.php?pg=kb.page&id=250
  
  Please give me a port number for Lighttpd.
  
  I'd really appreciate you guys taking a look ASAP.
  
  Best Regards,
  Yuki SHIDA
 -送信するとそのTicketの詳細画面が表示されるので、メモしとけ、といわれます。また、確認メールも届きます。
 - textdriveからは、数時間でメールがきました。
 
 ** lighttpd, Railsのセットアップ [#nbac4544]
 - 説明どおりにすすめていけば特にはまりどころは無いはずですが、いくつかハマリどころあり。
 
 *** gemsに必要なものが入っていない [#m01f3215]
 - http://rubygems.org/read/chapter/3#page83 を参考にユーザー権限でホームディレクトリ配下にgemsを入れてみます。
 TextDriveの場合は、下記のように指定しないと/usr/local/libの方にインストールをしようとしてしまうようでした。
  ruby setup.rb config --prefix=$HOME \
  --libruby=$HOME/lib/ruby \
  --librubyver=$HOME/lib/ruby/1.8 \
  --librubyver=$HOME/lib/ruby/1.8/i386-freebsd5 \
  --siteruby=$HOME/lib/ruby/site_ruby \
  --siterubyver=$HOME/lib/ruby/site_ruby/1.8 \
  --siterubyverarch=$HOME/lib/ruby/site_ruby/1.8/i386-freebsd5
 - で、gemは入ったのですが、
   gem update --system
 とすると、
  Upgrading RubyGems...
  Updating Gem source index for: http://gems.rubyforge.org
  /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:161:in `<<':
     failed to allocate memory (NoMemoryError)
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:161:in `reduce_spec'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:152:in `reduce_spec'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:141:in `convert_spec'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:56:in `source_index'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:313:in `source_index'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:445:in `fetch_source'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:436:in `source_index_hash'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:435:in `source_index_hash'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:415:in `search'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:765:in `execute'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command.rb:49:in `invoke'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:94:in `process_args'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:67:in `run'
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:13:in `run'
 うーん、ここでgemは断念。
 - なので、gemをtarで解凍してlibをそのままコピーして設置、or TextDriveに依頼、のようにしてやってみたいな、と。
 
 *** lighttpdのrails用の設定ファイルはちゃんと自分で書かないと [#j29437b2]
 - 説明にあるrails.shだけじゃうごかないはずですよね? (<- 誰か)
 - こんな感じで、lighttpdの設定ファイルの方に書いて、rails.shは使ってません。
 etc/lighttpd/vhosts.d/APPNAME.conf
  $HTTP["host"] =~ "YOURDOMAIN" {
     server.document-root = base + "/domains/YOURDOMAIN/web/public/"
     accesslog.filename   = base + "/var/log/lighttpd/APPNAME.access.log"
     server.errorlog      = base + "/var/log/lighttpd/APPNAME.error.log"
     server.error-handler-404   = "/dispatch.fcgi"
     fastcgi.server = (
        ".fcgi" => (
           "localhost" => (
           "min-procs" => 10,
           "max-procs" => 10,
           "socket" => base + "/var/run/APPNAME-0.socket",
           "bin-path" => base + "/domains/YOURDOMAIN/web/public/dispatch.fcgi",
           "bin-environment" => ( "RAILS_ENV" => "production" )
           )
        )
     )
  }
 
 ** 感想 [#z69eab32]
 - 実際に入れてみたサイトはそこそこの速さ。
 - ただ、サイトを2つ動かしたんですが、FastCGIのプロセスが10個以上上がってくるとプロセスが殺されてくみたいです。
 - ユーザー数が多い場合に絶えれるかどうか、要注意。
 - この値段でrails + lighttpd + fcgiの環境が手に入るんだからすごーくすばらしいんです。が、sshと、webminが重すぎ ^^;
 - 運用が始まってからの感想もここに書いていくです
 
 tag: [[Ruby on Rails>tag/Ruby on Rails]]
 
 #blikifooter(志田)
 
 

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS

アークウェブのサービスやソリューションはこちら