That doesn’t look correct. Think about it: Webrick is a web server.
Apache is a web server. Rails apps are a collection of Ruby scripts that
(so far) Apache doesn’t understand, but Webrick does. So, you have a
couple choices:
for simple webserving, you don’t need both. Webrick can do everything
(but not necessarily well). So if Webrick is OK for your load, you don’t
need Apache at all.
if you want to use Apache (say, for serving static files), it can’t
point to the Rails app directly. Remember, Apache doesn’t understand
Ruby files. So you need to tell Apache to send the request to Webrick.
However, this usually means setting your httpd.conf file up to tell
Apache to send some (most) requests to Webrick, but handle requests for
static files itself.
I use Mongrel, which is pretty much a seamless switch from Webrick.
Mongrel’s site shows you how to deal with all these issues.
Look at this, and you will see that you are using Apache for virtual
hosting, but more specifically, the virtual host you define will pass
all requests to Mongrel on the port you designate.
a)
Well would there be a way to run webrick on subdomain.mydomain.com for
example? how could I achieve this?
Thought the only way to do this is with apache’s virtual hosts (in my
case).
b)
Where else should it point to? Can you tell me more (or give me
keywords/resources) about this configuration?
Thank you. I think I will also try to deal with mongrel from now on!