apache2 - Problem With Routes After Deploying Sinatra Application -
i wrote simple sinatra application 2 "routes": "/show" , "/listshows". when run application on top of webrick, works beautifully both static , non-static routes. here url's use:
today, deployed simple application on top of apache , passenger 2. web server on private network , named millhouse. want access application using following urls:
the probem "slwa" string isn't part of of url's. example, when try visit "http://millhouse/slwa", should automatically redirected "http://millhouse/slwa/listshows". while app redirect, ends sending me "http://millhouse/listshows". "slwa" part missing.
i didn't want create new virtual host, reused "root" virtual host on ubuntu server. here's virtual host:
<virtualhost *:80> serveradmin webmaster@localhost documentroot /var/www <directory /> options followsymlinks allowoverride none </directory> <directory /var/www/> options indexes followsymlinks multiviews allowoverride none order allow,deny allow </directory> scriptalias /cgi-bin/ /usr/lib/cgi-bin/ <directory "/usr/lib/cgi-bin"> allowoverride none options +execcgi -multiviews +symlinksifownermatch order allow,deny allow </directory> errorlog /var/log/apache2/error.log # possible values include: debug, info, notice, warn, error, crit, # alert, emerg. loglevel warn customlog /var/log/apache2/access.log combined alias /doc/ "/usr/share/doc/" <directory "/usr/share/doc/"> options indexes multiviews followsymlinks allowoverride none order deny,allow deny allow 127.0.0.0/255.0.0.0 ::1/128 </directory> ### here's line added default rackbaseuri /slwa </virtualhost>
i created symlink under /var/www points @ public dir app. , finally, here's config.ru:
# straight phusion passnger users guide" require 'rubygems' require 'sinatra' root_dir = file.dirname(__file__) set :environment, env['rack_env'].to_sym set :root, root_dir set :app_file, file.join(root_dir, 'slwa.rb') disable :run require 'slwa' run sinatra::application
what part missing?
thanks in advance help!
tom purl
have tried redirect url(:controller, :action)?
had same problem, solved me... (except css , js public assets...)
Comments
Post a Comment