title: How to start server running Phusion Passenger
body: <p>I bought some hosting space where I have SSH access. Now I want to deploy a Ruby on Rails apps which works locally to one of the subdomains I made, let's call it subdomain.mywebsite.com. </p>
  
  <p>I have setup SSH access via a public key, installed Ruby on Rails and Passenger on the server, and installed Capistrano locally by following the steps provided on the website and via tutorials. When I run <code>cap production deploy</code> the whole site is uploaded to the production server and via SSH I can see the current, releases, repo and shared folder. Unfortunately, when I go to subdomain.mywebsite.com I get a 404 - not found error.</p>
  
  <p>I am new to setting up my own server and do not know what to do now. All tutorials I have found do not explain how to continue from here, and I hope someone who reads this can help me to actually being able to access the site.</p>
  
  <p>Deploy.rb:</p>
  
  <pre><code>require 'capistrano'
  set :stages, ["staging", "production"]
  set :default_stage, "staging"
  set :application, 'chiachia_store' # application name
  set :repo_url, 'git@github.com:erooijak/chiachia_store.git' # your repo url
  set :deploy_to, '/home/erooijak/chiachia.erooijak.simple-webhosting.eu'
  set :user, "root"
  set :scm, :git
  set :branch, 'master'
  set :keep_releases, 5
  ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
  set :format, :pretty
  set :log_level, :debug
  set :pty, true
  set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
  set :stage, :production
  role :app, %w{root@213.159.6.126}
  role :web, %w{root@213.159.6.126}
  role :db, %w{root@213.159.6.126}
  set :puma_rackup, -&gt; { File.join(current_path, 'config.ru') }
  set :puma_state, "#{shared_path}/tmp/pids/puma.state"
  namespace :deploy do
  
  desc 'Restart application...'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      # Your restart mechanism here, for example:
      execute :touch, release_path.join('tmp/restart.txt')
    end
   end
  
   desc 'Copy database.yml to correct location.'
   task :copy_databaseyml do
     on roles(:app) do
       execute :cp ,'-r', shared_path.join('config/database.yml'), 
         release_path.join('config/database.yml')
     end
   end
  
  after :publishing, :restart
  
  after :restart, :copy_databaseyml
  end
  </code></pre>
  
  <p>Apache.conf:</p>
  
  <p>LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
  PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.49
  PassengerRuby /usr/bin/ruby</p>
  
  <p></p>
  
  <pre><code>  ServerName www.chiachia.erooijak.simple-webhosting.eu
    # !!! Be sure to point DocumentRoot to 'public'!
    DocumentRoot /home/erooijak/chiachia.erooijak.simple-webhosting.eu/current/public
    &lt;Directory /home/erooijak/chiachia.erooijak.simple-webhosting.eu/current/public&gt;
       # This relaxes Apache security settings.
       AllowOverride all
       # MultiViews must be turned off.
       Options -MultiViews
       # Uncomment this if you're on Apache &gt;= 2.4
       #Require all granted
    &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>The effect of running this is the following:</p>
  
  <p><img src="https://i.stack.imgur.com/YbXLb.png" alt="Apache Passenger is running..."></p>
  
  <p>So it kind of works. Unfortunately I get a 404 error on all domains, the PHP application keeps running properly.</p>
  
  <p>The passenger.3000.log has the following information:</p>
  
  <ul>
  <li><a href="https://gist.github.com/erooijak/88bd770643d7eea62e95" rel="nofollow noreferrer">passenger.3000.log</a></li>
  <li><a href="https://gist.github.com/erooijak/4510aedb85ec332374d0" rel="nofollow noreferrer">html error message metnioned in log</a></li>
  </ul>