<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Ruby on Rails Notes &#187; server</title> <atom:link href="http://railsnotes.com/tag/server/feed/" rel="self" type="application/rss+xml" /><link>http://railsnotes.com</link> <description>A code-heavy brain dump of stuff I come across working on Ruby on Rails projects including Models, ActiveRecord, Views, Controllers, RESTful rails, deployment, server stuff, etc.</description> <lastBuildDate>Sun, 29 Aug 2010 23:45:16 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Blocking an IP with iptables</title><link>http://railsnotes.com/641-blocking-an-ip-with-iptables/</link> <comments>http://railsnotes.com/641-blocking-an-ip-with-iptables/#comments</comments> <pubDate>Wed, 27 May 2009 21:01:35 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[Other]]></category> <category><![CDATA[server]]></category><guid
isPermaLink="false">http://www.railsnotes.com/?p=641</guid> <description><![CDATA[Earlier today, I noticed a bunch of weird requests to one of my Rails apps. I&#8217;m not sure what their intention was but I didn&#8217;t want to take the chance since the IP traced back to somewhere in China which meant if something went bad, I&#8217;d have little recourse. So I decided to block their [...]]]></description> <content:encoded><![CDATA[<p></p><p><img
class="alignleft size-thumbnail wp-image-642" src="http://www.railsnotes.com/wp-content/uploads/2009/05/istock_000000152791xsmall-150x150.jpg" alt="istock_000000152791xsmall" width="150" height="150" />Earlier today, I noticed a bunch of weird requests to one of my Rails apps. I&#8217;m not sure what their intention was but I didn&#8217;t want to take the chance since the IP traced back to somewhere in China which meant if something went bad, I&#8217;d have little recourse.</p><p>So I decided to block their IP. Doing this is pretty easy using iptables on Ubuntu. I just entered this in my terminal after logging in via ssh:</p><pre>iptables -I INPUT -s 59.56.108.202 -j DROP</pre><p>I&#8217;m not sure if this is the best defense but it&#8217;s what was suggested by the support rep at Mosso. And yes, that is the IP I blocked. It was creating requests that looked like this in the access.log:</p><pre>sitespress.com:80 59.56.108.202 - - [27/May/2009:17:32:25 +0000]
"GET http://116.0.22.245/prxjdg.cgi?en HTTP/1.0" 404 947 "-"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)"</pre>]]></content:encoded> <wfw:commentRss>http://railsnotes.com/641-blocking-an-ip-with-iptables/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Rails Server Setup + App Deployment Using Moonshine</title><link>http://railsnotes.com/161-rails-server-setup/</link> <comments>http://railsnotes.com/161-rails-server-setup/#comments</comments> <pubDate>Sun, 26 Apr 2009 11:56:52 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[deployment]]></category> <category><![CDATA[server]]></category><guid
isPermaLink="false">http://www.railsnotes.com/?p=161</guid> <description><![CDATA[Moonshine is an amazing new rails plugin by Rails Machine. It configures your server, gets it ready for your app by installing the necessary gems &#38; native packages and deploys your app. Built on top of Capistrano &#38; Puppet, it really takes most of the pain out of deployment. In this blog post, I&#8217;m going to walk you [...]]]></description> <content:encoded><![CDATA[<p></p><p><a
href="http://www.github.com/railsmachine/moonshine/">Moonshine</a> is an amazing new rails plugin by <a
title="Rails Hosting" href="http://railsmachine.com/">Rails Machine</a>. It configures your server, gets it ready for your app by installing the necessary gems &amp; native packages and deploys your app. Built on top of Capistrano &amp; Puppet, it really takes most of the pain out of deployment.</p><p>In this blog post, I&#8217;m going to walk you through how to use Moonshine to go from a fresh installation of Ubuntu server 8.10 to being live with your app. So let&#8217;s get going:</p><div
class="yellow_notice"><strong>NOTE:</strong> Support this blog by <a
href="http://feeds2.feedburner.com/railsnotes">subscribing to the RSS Feed</a>. <em>It&#8217;s free.</em></div><h2>Step 1. Initial server setup</h2><p>You’ll need an Ubuntu box to get started. After the basic install you’ll need to run a few commands to get the box ready.</p><p>Log into your server via ssh &amp; change your root password</p><pre>ssh root@123.123.123.123
passwd</pre><p>Change 123.123.123.123 with the IP of your server everywhere you see it.</p><p>Add a new user called rails and give it a password</p><pre>adduser rails</pre><p>Give it sudo permissions</p><pre>visudo</pre><p>And add this below “root <span
class="caps">ALL</span>=(ALL) <span
class="caps">ALL</span>”</p><pre>rails   ALL=(ALL) ALL</pre><p>On your local machine:</p><pre>ls ~/.ssh/</pre><p>If it shows you id_rsa.pub, skip this next step (which generates the ssh):</p><pre>ssh-keygen</pre><p>Next, we’re going to copy your public key to your server so you can securely connect to it without having to enter your password. Again on your local machine, run:</p><pre>scp ~/.ssh/id_rsa.pub rails@123.123.123.123:/home/rails/</pre><p>Now on your server, run this:</p><pre>mkdir /home/rails/.ssh
mv /home/rails/id_rsa.pub /home/rails/.ssh/authorized_keys
chown -R rails:rails /home/rails/.ssh
chmod 700 /home/rails/.ssh
chmod 600 /home/rails/.ssh/authorized_keys</pre><p>It’s a good practice to change the <span
class="caps">SSH</span> port for your machine so that’s what we’re going to do next:</p><pre>nano /etc/ssh/sshd_config</pre><p>Change “Port 22” to “Port 2222” or a different number</p><p>Save your file and close it (Ctrl+X, then Y and finally press enter-key)</p><p>Okay, now it’s time to setup IP Table Rules.</p><pre>nano /etc/iptables.test.rules</pre><p>In this file, enter your iptable rules. Here’s a decent I got from<a
href="http://articles.slicehost.com/assets/2007/9/4/iptables.txt">http://articles.slicehost.com/assets/2007/9/4/iptables.txt</a>. IPTables are like your firewall so all info is provided without warrantee. It’s your responsibility to use it wisely.</p><pre>*filter

#  Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT

#  Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#  Allows all outbound traffic
#  You can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT

# Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

#  Allows SSH connections
#
# THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE
#
-A INPUT -p tcp -m state --state NEW --dport 2222 -j ACCEPT

# Allow ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

# Reject all other inbound - default deny unless explicitly allowed policy
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT</pre><p>Save that file and close it. Then run this:</p><pre>iptables-restore &lt; /etc/iptables.test.rules
iptables-save &gt; /etc/iptables.up.rules</pre><p>Now to make this info stay when you restart the server, run:</p><pre>nano /etc/network/interfaces</pre><p>And enter a line below the “iface lo inet loopback” line, as shown below:</p><pre>  ...
  auto lo
  iface lo inet loopback
  pre-up iptables-restore &lt; /etc/iptables.up.rules

  # The primary network interface
  ...</pre><p>Save &amp; close that file and then run:</p><pre>  /etc/init.d/ssh reload</pre><p>Now it’s time to do some stuff on your local machine to make it easy to connect with your server.</p><p>On your local machine, open ~/.ssh/config file with textmate or your fav text editor:</p><pre>mate ~/.ssh/config</pre><p>and add your info using the template below:</p><pre>Host blackbox
Hostname 123.123.123.123
User rails
Port 2222</pre><p><em>Don’t forget to change your port number &amp; IP as well as pick a name for your server that makes sense.</em></p><p>Save &amp; close that file. Now you should be able to connect to your server by just typing:</p><pre>ssh blackbox</pre><p>Okay, we’ve got one final thing we need to get your initial server setup. That’s getting your server access to your github account (which you don’t need but most people have it so you should probably get one, even if it’s just to contribute to open source stuff.)</p><p>Once you’ve ssh’d into your server using the above command, generate your ssh key similar to how to you did it on your local machine:</p><pre>ssh-keygen</pre><p>It will ask you if you want to give it a password. I usually don’t give it one and I don’t know if that’s a good/bad thing. In anycase, when you’re done, you want to output the public key it generates by running this:</p><pre>cat /home/rails/.ssh/id_rsa.pub</pre><p>Copy the key that is outputted and enter it into your github account which you can usually do at:<a
href="https://github.com/account">https://github.com/account</a></p><p>Alright, you’ve now completed step 1, which was getting the initial server ready.</p><h2>Step 2 – Adding moonshine to your project &amp; configuring it.</h2><p>In this step, you’ll add the moonshine plugin to your project &amp; configure it properly so it knows what you want it to do on your server.</p><p>On your local machine, go to your rails project directory and add the plugin:</p><pre>ruby script/plugin install git://github.com/railsmachine/moonshine.git</pre><p>Add all the gems your project needs to your environment.rb file.</p><p>Next, run the moonshine generator to create the necessary files:</p><pre>ruby script/generate moonshine</pre><p>This should make an output like this:</p><pre>  After the Moonshine generator finishes don't forget to:

  - Edit config/moonshine.yml
  Use this file to manage configuration related to deploying and running the app:
  domain name, git repos, package dependencies for gems, and more.

  - Edit app/manifests/application_manifest.rb
  Use this to manage the configuration of everything else on the server:
  define the server 'stack', cron jobs, mail aliases, configuration files

        create  app/manifests
        create  app/manifests/templates
        create  app/manifests/application_manifest.rb
        exists  app/manifests/templates
        create  app/manifests/templates/README
        exists  config
        create  config/moonshine.yml
        create  config/gems.yml</pre><p>As the output suggests, the next thing you should do is edit config/moonshine.yml</p><h3>Edit config/moonshine.yml</h3><p>First give your app a name (such as your_app_name), pick where the files of your app will reside (by setting deploy_to) &amp; tell moonshine where to grab your application from (by setting repository)</p><pre>  :application: your_app_name
  :deploy_to: /srv/your_app_name
  :repository: git@github.com:username/your_app_name.git</pre><p>Next, if your app has directories in the public directory that need to stay persistent, uncomment this:</p><pre>:app_symlinks:
  - uploads</pre><p>If you don’t, the files will be removed every time you deploy since it gets the files from your git repo and it won’t be there.</p><p>You’ll also probably want to uncomment the local_config section, which will upload your local copy of /config/database.yml to the server, while bypassing your git repo.</p><pre>:local_config:
  - config/database.yml</pre><p>You probably want to leave the next section (:shared_children:) alone. It basically keeps everything the same.</p><p>Now save your file and from your terminal/command-line, run this command to generate a /config/gems.yml file, which will contain a list of gems that your app needs (based on what you specified in config/environment.rb)</p><pre>rake moonshine:gems</pre><p>Like the comments say, if your gems depend on native packages, you need to specify it next with :apt_gems. For example:</p><pre>:apt_gems:
  :paperclip:
    - imagemagick</pre><p>Next, change Passenger &amp; MySQL settings to suit your app &amp; hardware. For example, on a 256MB ram box, you might lower the max_pool_size to 2 or increase it to 8 for 1GB ram server.</p><p>Finally, if your app uses <span
class="caps">SSL</span>, you’ll need to set your ssl properties with something like this:</p><pre>:ssl:
  :ip:
  :certificate_file:
  :certificate_key_file:
  :certificate_chain_file:
  :vhost_extra:
  :only:</pre><p>Set the :only: to true if your entire site should be ssl protected. If you are self-signing, can you can use<tt>:self_signed: true</tt> like this:</p><pre>:ssl:
  :self_signed: true</pre><p>When all is done, you might have a file that looks like this:</p><pre>  :ruby: ree
  :application: yourapp
  :user: rails
  :group: rails
  :ssl:
    :self_signed: true
  :deploy_to: /srv/yourapp
  :domain: yourapp.com
  :repository: git@github.com:username/reponame.git
  :app_symlinks:
    - assets
  :local_config:
    - config/database.yml
  :shared_children:
  - system
  - log
  - pids
  - config
  :apt_gems:
    :paperclip:
      - imagemagick
  :passenger:
    :max_pool_size: 3
    :use_global_queue: true
  :mysql:
    :innodb_buffer_pool_size: 128M</pre><h3>Edit app/manifests/application_manifest.rb</h3><p>In the application_manifest.rb, you’ll specify a few things:</p><ol><li>Which recipe(s) you want to use</li><li>Packages you haven’t already specified</li><li>Any rake commands you want run the first time</li></ol><h4>Recipes</h4><p>The file that is generated uses the default_stack recipe. What this means is it will install Apache, Passenger, MySQL, Rails, <span
class="caps">NTP</span>, Cron &amp; Postfix. Checkout vendor/plugins/moonshine/lib/moonshine/manifest/rails.rb to see the actual method. For many apps, the default will work fine.</p><p><span
class="caps">TODO</span>: Add instructions for what to have in place of the default_stack if I want to use sqlite as my database (if my app is really small).</p><h4>Additional Packages</h4><p>If your app needs to have a package installed that hasn’t been specified yet, this is the place to add it. For example, if your app uses BackgroundRB, you’d specify it here.</p><p><span
class="caps">TODO</span>: Add example of how backgroundrb might be installed.</p><h4>Run rake commands</h4><p>You might need to run a rake command after your app has been deployed to initial things. This might be the place to add it.</p><p><span
class="caps">TODO</span>: Add example. Something I might want to do is do a mysql dump before I move forward… but this is just hypothetical.</p><h3>Capify your project</h3><p>Once you’ve got your app configured, capify your app by running the following code while inside your rails app directory:</p><pre>capify .</pre><p>Now open config/deploy.rb and replace it’s content with this:</p><pre>server "blackbox", :app, :web, :db, :primary =&gt; true</pre><p><em>Replace blackbox with the name you give your server in your ~/.ssh/config file.</em>Next, store the files to your repo and push it to your git repo:</p><pre>git add . &amp;&amp; git commit -am "added moonshine" &amp;&amp; git push</pre><h2>Step 3 – Deploy</h2><p>Once all the configuration is done, you’ll see all your hard work pay off.</p><p>First thing you’ll do is setup the server. From your rails app root, run this:</p><pre>cap deploy:setup</pre><p>Once that is done, run this:</p><pre>cap deploy</pre><p>At this point, you should be done and your app should be live.</p><h2>Step 3.5 – Add <span
class="caps">SSL</span></h2><p>If your site uses <span
class="caps">SSL</span>, this next section will get you setup with it. After you’ve deployed your app with the self-signed method as described above, ssh into your server and generate a new certificate request:</p><pre>ssh blackbox
sudo openssl req -new &gt; mynewsite.csr</pre><p>It will ask you to fill in a bunch of info that will need to match the info you provide your <span
class="caps">SSL</span> provider (such as GoDaddy). The key one that you’ll want to pay attention to is Common Name. That needs to be your domain name (without the https://). For my app, i didn’t include the www and I’m not sure if that makes a difference. Next lets move these to a better location:</p><pre>mkdir /home/rails/certs
mv mynewsite.csr /home/rails/certs/mynewsite.csr
mv privkey.pem /home/rails/certs/privkey.pem</pre><p>Once done, output your certificate request by doing this:</p><pre>cd /home/rails/certs/
cat mynewsite.csr</pre><p>Copy that and enter it when your <span
class="caps">SSL</span> provider asks for it.</p><p>Once your <span
class="caps">SSL</span> provider approves your <span
class="caps">SSL</span>, they’ll provide you with two files. One will be the certificate file and the second will be the certificate chain file. For godaddy, they provide a zip file that contains two files: yourdomain.com.crt &amp; gd_bundle.crt. Save these two files in a directory called certs on your local machine. Change into that directory and copy the files to your server by running this on your local machine:</p><pre>scp * blackbox:/home/rails/certs/</pre><p>This should copy the files to /home/rails/certs/ on your server.</p><p>The final step is to update config/moonshine.yml, commit it to the git repo and deploy again. Open up config/moonshine.yml and replace:</p><pre>  :ssl:
    :self_signed: true</pre><p>with</p><pre>:ssl:
  :ip: 123.123.123.123
  :certificate_file: /home/rails/certs/yourdomain.com.crt
  :certificate_key_file: /home/rails/certs/privkey.pem
  :certificate_chain_file: /home/rails/certs/gd_bundle.crt</pre><p>Save &amp; close this file. Next update your git repo.</p><pre>git add config/moonshine.yml
git commit -m "Updated moonshine config file with SSL info"
git push</pre><p>Now it’s time to deploy but we have one more tiny step. When you were creating the certificate request, it asked you to enter a password in. Apache will ask for that password every single time it wants to restart and moonshine won’t be able to enter this in for you. So we’re going to remove that password from the private key. (<a
href="https://support.railsmachine.com/index.php?pg=kb.page&amp;id=144">for more info</a>) So log into your server &amp; remove it by doing:</p><pre>ssh blackbox
cd certs
cp privkey.pem privkey.pem.bak
openssl rsa -in privkey.pem.bak -out privkey.pem</pre><p>This will ask you to enter your password that you entered while generating the certificate request. When you’re done, you’re ready to deploy again:</p><pre>cap deploy</pre><p>That’s it! You should be good to go now. And if you’re in the market for managed hosting, particularly for your Rails apps, definitely check out <a
href="http://www.railsmachine.com/">RailsMachine</a>, creators of moonshine!</p><p>PS: I originally wrote this guide as part of the <a
href="http://wiki.github.com/railsmachine/moonshine/step-by-step-instructions">moonshine wiki</a>. Feel free to head out there and add to it. It&#8217;ll help everyone involved.</p> ]]></content:encoded> <wfw:commentRss>http://railsnotes.com/161-rails-server-setup/feed/</wfw:commentRss> <slash:comments>16</slash:comments> </item> <item><title>Simplify SSH Login</title><link>http://railsnotes.com/138-simplify-ssh-login/</link> <comments>http://railsnotes.com/138-simplify-ssh-login/#comments</comments> <pubDate>Mon, 13 Apr 2009 00:03:17 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[Other]]></category> <category><![CDATA[server]]></category> <category><![CDATA[ssh]]></category><guid
isPermaLink="false">http://railsnotes.wordpress.com/2009/04/13/simplify-ssh-login-dont-you-hate-it-w/</guid> <description><![CDATA[Simplify SSH Login Don&#8217;t you hate it when you want to ssh into a server and you have to type in something like this: ssh 123.456.789.01 -l myusername -p 2222 You can actually simplify this by editing your ~/.ssh/config file and adding something like this: Host box1 Hostname 123.456.789.01 Port 2222 User myusername Once you [...]]]></description> <content:encoded><![CDATA[<p></p><p><strong>Simplify SSH Login</strong></p><p>Don&#8217;t you hate it when you want to ssh into a server and you have to type in something like this: ssh 123.456.789.01 -l myusername -p 2222</p><p>You can actually simplify this by editing your ~/.ssh/config file and adding something like this:</p><pre>Host box1
Hostname 123.456.789.01
Port 2222
User myusername</pre><p>Once you save and close this file, you can now ssh by doing this:</p><pre>ssh box1</pre><p>PS: This only applies to OSX &amp; linux machines.</p> ]]></content:encoded> <wfw:commentRss>http://railsnotes.com/138-simplify-ssh-login/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Turning an existing database to a rails migration</title><link>http://railsnotes.com/97-turning-an-existing-database-to-a-rails-migration/</link> <comments>http://railsnotes.com/97-turning-an-existing-database-to-a-rails-migration/#comments</comments> <pubDate>Wed, 25 Feb 2009 07:23:02 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[deployment]]></category> <category><![CDATA[database]]></category> <category><![CDATA[migration]]></category> <category><![CDATA[server]]></category><guid
isPermaLink="false">http://railsnotes.wordpress.com/?p=97</guid> <description><![CDATA[Q: Is there a way to make a migration from an existing database? A. Yes, but you need to be more specific with this question because there are two ways. The first approach will dump the schema of your existing database into a migration. The second will dump the data as well. Why would you want [...]]]></description> <content:encoded><![CDATA[<p></p><p>Q: Is there a way to make a migration from an existing database?</p><p>A. Yes, but you need to be more specific with this question because there are two ways.</p><p>The first approach will dump the schema of your existing database into a migration.</p><p>The second will dump the data as well. Why would you want to dump the data? If you&#8217;re moving machines or changing from a MySQL to a POSTGREs db, this might be useful.</p><p><strong>Approach 1: Dump schema</strong></p><p>Hint: Type in &#8220;rake -T&#8221; into your terminal. The will show you a list of all the rake tasks available to you. Everything you need is here.</p><p>Step 1: rake db:schema:dump   <em>#this will dump the schema into a file called schema.rb</em></p><p>Step 2: rake db:schema:to_migration <em>#this will turn your schema.rb file into a migration file</em></p><p><strong>Approach 2: Dump schema + data</strong></p><p>You&#8217;re going to need the YAMLdb plugin by Adam Wiggins at Heroku. To grab it from: <a
href="http://github.com/adamwiggins/yaml_db/">http://github.com/adamwiggins/yaml_db/</a></p><p>Follow the instructions on the github page.</p> ]]></content:encoded> <wfw:commentRss>http://railsnotes.com/97-turning-an-existing-database-to-a-rails-migration/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Ruby on Rails Hosting for Your New RoR Super App</title><link>http://railsnotes.com/38-ruby-on-rails-hosting-for-your-new-ror-super-app/</link> <comments>http://railsnotes.com/38-ruby-on-rails-hosting-for-your-new-ror-super-app/#comments</comments> <pubDate>Thu, 02 Oct 2008 01:27:42 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[deployment]]></category> <category><![CDATA[Hosting]]></category> <category><![CDATA[server]]></category><guid
isPermaLink="false">http://railsnotes.wordpress.com/?p=38</guid> <description><![CDATA[I have been hosting my two apps with SliceHost for the last 9 months and can&#8217;t complain about anything. THEY ARE AWESOME! One tiny thing that I do wish they did differently was to offer linux-newbies (like me) an option for a ready-made server that I could use within minutes of signing up. I really don&#8217;t [...]]]></description> <content:encoded><![CDATA[<p></p><p><img
class="alignnone" src="http://hunternuttall.com/blog/wp-content/uploads/2008/01/matrix-bullets.jpg" alt="" width="484" height="206" /></p><p>I have been hosting my two apps with <a
href="https://manage.slicehost.com/customers/new?referrer=e63d0f119fca9a07ca54961baf3c68dc"><span
style="color:#0000ff"><strong>SliceHost</strong></span></a><span
style="color:#0000ff"><strong> </strong></span>for the last 9 months and can&#8217;t complain about anything. THEY ARE AWESOME!</p><p>One tiny thing that I do wish they did differently was to offer linux-newbies (like me) an option for a ready-made server that I could use within minutes of signing up. I really don&#8217;t find tinkering with Ubuntu fun.</p><p>Today I came across something that makes that possible: <a
href="http://blog.fiveruns.com/2008/9/24/rails-automation-at-slicehost">http://blog.fiveruns.com/2008/9/24/rails-automation-at-slicehost</a>. It&#8217;s like being Neo in the Matrix. You can take on 1000&#8242;s of agents with no sweat.</p><p>Mark Andersons&#8217;s script let me create a development server in under 3 minutes. It doesn&#8217;t look like it does anything for security so I wouldn&#8217;t use it as a production server as it is&#8230; but it&#8217;s great for playing around with your app on a live server while still in development.</p><p>Here&#8217;s the steps I followed:</p><ul><li>Create a new slice (sign-up or create new slice in your slice manager if you&#8217;re an existing client)</li><li>Log into your server via ssh (using putty or whatever you prefer)</li><li>Type:  nano serversetup</li><li>Copy/Paste the code from <a
href="http://blog.fiveruns.com/2008/9/24/rails-automation-at-slicehost">Mark&#8217;s Script</a></li><li>Delete the first line where it says &#8220;ssh root@fiveruns.slicehost.com &#8216;&#8221;</li><li>Delete the last line where it has a &#8216;</li><li>Save the file (on your keyboard, press Ctrl + O  followed by Enter )</li><li>Exit Nano (on your keyboard, press Ctrl + X)</li><li>Type: sudo sh serversetup</li><li>Watch a bunch of code fly through on the screen and pretend you&#8217;re reading the Matrix</li><li>Type in a password for MySQL when asked &amp; retype.</li><li>Watch more code fly by and feel smart</li><li>When done, open up FireFox and go to the IP of your new slice</li><li>Say &#8220;Holy Crap!&#8221; when you see that your app is running.</li></ul><div>There are a few other things I&#8217;m going to add to Mark&#8217;s script and submit to him such as added git, firewall security and other things when I get the time but go n enjoy your new slice!</div> ]]></content:encoded> <wfw:commentRss>http://railsnotes.com/38-ruby-on-rails-hosting-for-your-new-ror-super-app/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 2/16 queries in 0.032 seconds using disk

Served from: railsnotes.com @ 2010-09-10 06:47:43 -->