Sinatra Ruby web app server on NetBSD 9

Then we need to add a virtualhost section to point to our sinatra application on webappruby folder.

<VirtualHost *:80>
    ServerName www.dswsis.my.id
    DocumentRoot /usr/pkg/share/httpd/htdocs/webappruby/public
    <Directory /usr/pkg/share/httpd/htdocs/webappruby/public>
        Require all granted
        Allow from all
        Options -MultiViews
    </Directory>
</VirtualHost>

On webappruby folder we create public and tmp folder. On tmp folder, create a file with name restart.txt. Public folder will be used to store static content of our application.

The entry of our sinatra web app will be config.ru, a rack up config file containing short code to our real application app.rb file.

require 'rubygems'
require 'sinatra'
require File.expand_path '../app.rb', __FILE__

run Sinatra::Application

Leave a Reply

Your email address will not be published. Required fields are marked *