<?xml version="1.0" encoding="UTF-8"?>
<article>
  <body>EC2onRails&#12434;&#20351;&#12387;&#12390;&#12289;&#26082;&#23384;&#12398;Rails&#12450;&#12503;&#12522;&#12434;EC2&#19978;&#12391;&#21205;&#12367;&#12424;&#12358;&#12395;&#12377;&#12427;&#12383;&#12417;&#12398;&#25163;&#38918;&#12398;&#12513;&#12514;&#12391;&#12377;&#12290;
[EC2onRails&#12434;&#35079;&#25968;&#12450;&#12503;&#12522;&#23550;&#24540;&#12395;&#12377;&#12427;&#26041;&#27861;&#12398;&#12513;&#12514;](http://blog.s21g.com/articles/565)
&#12434;&#36969;&#29992;&#12375;&#12383;&#29366;&#24907;&#12434;&#24819;&#23450;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;

 1. config/deploy.rb &#12434;&#29992;&#24847;
&#65288;[&#12469;&#12531;&#12503;&#12523;&#12501;&#12449;&#12452;&#12523;&#12399;&#12371;&#12385;&#12425;](http://ec2onrails.rubyforge.org/svn/trunk/documentation/examples/deploy.rb)&#65289;
`:server_config_files_root`&#12434;&#36969;&#24403;&#12395;&#35373;&#23450;&#12375;&#12289;&#25351;&#23450;&#12375;&#12383;PATH&#12395;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12434;&#20316;&#12427;&#12290;
 2. Capfile&#12434;&#20197;&#19979;&#12398;&#12424;&#12358;&#12394;&#24863;&#12376;&#12391;&#29992;&#24847;&#12290;
rails&gt;&gt;
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'config/deploy'
require 'ec2onrails/recipes'

set :deploy_to, &quot;/mnt/app/&lt;app_name&gt;&quot;

# override default start/stop/restart tasks
namespace :deploy do
  desc &lt;&lt;-&quot;DESC&quot;
    Overrides the default Capistrano deploy:start, directly calls \
    /etc/init.d/mongrel #{application}
  DESC
  task :start, :roles =&gt; :app do
    run &quot;/etc/init.d/mongrel start #{application}&quot;
  end

  desc &lt;&lt;-&quot;DESC&quot;
    Overrides the default Capistrano deploy:stop, directly calls \
    /etc/init.d/mongrel #{application}
  DESC
  task :stop, :roles =&gt; :app do
    run &quot;/etc/init.d/mongrel stop #{application}&quot;
  end

  desc &lt;&lt;-&quot;DESC&quot;
    Overrides the default Capistrano deploy:restart, directly calls \
    /etc/init.d/mongrel #{application}
  DESC
  task :restart, :roles =&gt; :app do
    run &quot;/etc/init.d/mongrel restart #{application}&quot;
  end
end
&lt;&lt;--
EC2onRails&#12364;&#19978;&#26360;&#12365;&#12375;&#12383;&#12487;&#12501;&#12457;&#12523;&#12488;&#12398;&#12479;&#12473;&#12463;&#12434;&#12373;&#12425;&#12395;&#19978;&#26360;&#12365;&#12375;&#12390;&#12289;&#35079;&#25968;&#12450;&#12503;&#12522;&#23550;&#24540;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;
&#12288;3. &#26368;&#24460;&#12395;&#12289;mongrel_cluster&#12434;&#20351;&#12358;&#12398;&#12391;&#12289;`config/mongrel_cluster.yml`
&#12501;&#12449;&#12452;&#12523;&#12434;&#29992;&#24847;&#12375;&#12414;&#12377;&#12290;
yaml&gt;&gt;
---
cwd: /mnt/app/&lt;app_name&gt;/current
port: 8000
environment: production
pid_file: log/mongrel.pid
servers: 3
&lt;&lt;--
&#12509;&#12540;&#12488;&#30058;&#21495;&#12399;&#12469;&#12540;&#12496;&#12434;&#12471;&#12455;&#12450;&#12377;&#12427;&#12450;&#12503;&#12522;&#38291;&#12391;&#36969;&#24403;&#12395;&#21106;&#12426;&#25391;&#12426;&#12414;&#12377;&#12290;

&#12354;&#12392;&#12399;&#12289;&#20197;&#19979;&#12398;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12375;&#12390;&#12487;&#12503;&#12525;&#12452;&#12375;&#12414;&#12377;&#12290;

pre&gt;&gt;
cap ec2onrails:setup
cap deploy:cold
&lt;&lt;--

&#26368;&#24460;&#12395;&#12289;[EC2onRails&#12434;&#35079;&#25968;&#12450;&#12503;&#12522;&#23550;&#24540;&#12395;&#12377;&#12427;&#26041;&#27861;&#12398;&#12513;&#12514;](http://blog.s21g.com/articles/565)&#12395;&#26360;&#12356;&#12390;&#12354;&#12427;&#12424;&#12358;&#12394;&#12289;EC2&#19978;&#12398;Apache&#12398;VirtualHost&#12398;&#35373;&#23450;&#12392;&#12289;ProxyBalancer&#12398;&#35373;&#23450;&#12434;&#34892;&#12356;&#12414;&#12377;&#12290;</body>
  <cached-tag-list>memo EC2 rails</cached-tag-list>
  <comments-count type="integer">0</comments-count>
  <created-at type="datetime">2008-05-21T18:27:38+00:00</created-at>
  <daily-archive-id type="integer">589</daily-archive-id>
  <filter-type>blue_stole</filter-type>
  <id type="integer">590</id>
  <monthly-archive-id type="integer">56</monthly-archive-id>
  <pdf-digest nil="true"></pdf-digest>
  <permalink>/articles/590</permalink>
  <published-at type="datetime">2008-05-21T21:02:08+00:00</published-at>
  <secret>aee157bc-a802-4fe5-9f21-0667add98d13</secret>
  <title>&#26082;&#23384;&#12398;Rails&#12450;&#12503;&#12522;&#12434;EC2onRails&#21270;&#12377;&#12427;&#25163;&#38918;&#12398;&#12513;&#12514;</title>
  <updated-at type="datetime">2008-10-22T20:09:28+00:00</updated-at>
  <user-id type="integer">1</user-id>
</article>
