Let's say I have the simplest single-file Sinatra app. The hello world on their homepage will do. I want to run it under Apache with Phusion Passenger, AKA mod_rails.
app |-- config.ru # <- rackup file |-- hello-app.rb # <- your application |-- public/ # <- static public files (passenger needs this) `-- tmp/ `-- restart.txt # <- touch this file to restart app
<VirtualHost *:80> ServerName app.example.com DocumentRoot /path/to/app/public <Directory /path/to/app/public> Order allow,deny Allow from all </Directory> </VirtualHost>
# encoding: UTF-8 require './hello-app' run Sinatra::Application
#!/usr/bin/env ruby # encoding: UTF-8 require 'rubygems' # for ruby 1.8 require 'sinatra' get '/hi' do "Hello World!" end
restart.txt
is empty.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With