title: Install Ruby on Rails with Passenger on Centos 6.5 Amazon EC2
body: <p>I'm pretty new to Ruby on Rails, and completely new to Amazon EC2. I was able to setup RoR, Passenger, and Apache on Linode with CentOS 6.5 using the directions found here: <a href="https://www.rosehosting.com/blog/install-ruby-on-rails-with-apache-and-passenger-on-centos-6/" rel="nofollow">https://www.rosehosting.com/blog/install-ruby-on-rails-with-apache-and-passenger-on-centos-6/</a></p>
  
  <p>Everything worked fine, I was able to get it up and running with no problem. But my client uses Amazon EC2, so I have to set it up on their server. When trying it on Amazon EC2, once I get to the <code>rvmsudo passenger-install-apache2-module</code> part, I get the following error:</p>
  
  <pre><code>It looks like you are on a Red Hat or CentOS operating system, with SELinux
  enabled. SELinux is a security mechanism for which special Passenger-specific
  configuration is required. We supply this configuration as part of
  our Passenger RPMs.
  
  However, Passenger is currently installed through gem or tarball and does not
  include any SELinux configuration. Therefore, we recommend that you:
  
   1. Uninstall your current Passenger install.
   2. Reinstall Passenger through the RPMs that we provide:
      https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#installing_or_upgrading_on_red_hat
  </code></pre>
  
  <p>I followed the steps at the URL provided, but it still gives me the same error. I disabled SELinux, and then running the above command again I get an error saying that there is not enough swap space. I run the following commands, as it says to:</p>
  
  <pre><code>sudo dd if=/dev/zero of=/swap bs=1M count=1024
  sudo mkswap /swap
  sudo swapon /swap
  </code></pre>
  
  <p>After running that, I'm able to run <code>rvmsudo passenger-install-apache2-module</code>, and it installs successfully. I added the lines to httpd.conf as it said, and restarted Apache. I have the following for my Virtual Host in httpd.conf:</p>
  
  <pre><code>&lt;VirtualHost *&gt;
     DocumentRoot /home/user/appName/public
     &lt;Directory /home/user/appName/public&gt;
        AllowOverride all
        Options -MultiViews
     &lt;/Directory&gt;
    ErrorLog /var/log/httpd/appName_error.log
    CustomLog /var/log/httpd/appName_access.log common
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>But whenever I try to go to the Public IP address or the Public DNS, I just get a timeout error. Does anyone have any idea where I went wrong? Would using Nginx be better? Anyone who can point me in the right direction would be greatly appreciated!</p>