Hello all,

I am no stranger to web hosting on IIS, but have recently been developing test applications in Rails and Sinatra. I am having a difficult time learing about the Turnkey Rails, or probably more more so, the Apache configuration on the server.

When I create a new Turnkey VM from the ISO image, everything works well. The default rails application in /var/www/railsapp works fine (even though it took me a while to research the example app is the default page). I am developing an application in Sinatra, so I moved all of the files from the railsapp folder and copied my app files into that folder, and it ran my app fine. However, after almost five hours of struggling, and reloading Turnkey rails twice, I've realized I'm not going to get this alone.

Here are the two problems which I am having;

1. I will be hosting multiple sites and cannot get Apache to go to the correct site.

  • If I attempt to create a new virtual host; for example, myhost.com, and I navigate to that address, Apache seems to totally ignore the request header and takes me to the default railsapp site.
  • If I display the header (via request.host) in my program, it shows myhost.com, but is not redirected.
  • I have used Apache in the past with the single http.conf file to host multiple sites, but the new method must have me totally perplexed.

2. I cannot get Ruby to run except in the railsapp folder.

  • I do not want my site to run in /var/www/railsapp, I would like rails to run in /var/www/mysite.com, /var/www/yoursite.com, or wherever else necessary.
  • In order to test where I am failing, I have deleted the default virtual hosts (on the test rails app) and set up my test site to the wildcard (*) listener in my new /var/www/mysite.com site. When I do this, it lists the files rather than running an app.

If someone could please help, it would be greatly appreciated. Here is what I need help with;

  1. From a fresh copy of Turnkey;
  • Instructions on setting up a new hostname-based site in a folder outside of the railsapp folder (e.g. /var/www/mysite.com)
  • Test a Sinatra app inside that folder.
Forum: 

Add new comment