RackBaseURI not working

1,165 views
Skip to first unread message

spovich

unread,
Nov 30, 2009, 5:08:21 PM11/30/09
to Phusion Passenger Discussions
I have some simple rack applications that I want to consolidate on a
single virtual host, however, I can't get apache2/passenger 2.2.7 to
recognize the correct path to config.ru

/Users/john/webapps/test1/config.ru
app = proc do |env|
return [200, { "Content-Type" => "text/html" }, "hello test1"]
end
run app

/Users/john/webapps/test2/config.ru
app = proc do |env|
return [200, { "Content-Type" => "text/html" }, "hello test2"]
end
run app

<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/john/webapps
RackBaseURI /test1
RackBaseURI /test2
</VirtualHost>

So requesting the following: http://localhost/test1 produces this
passenger error:

Error message:
No such file or directory - config.ru
Exception class:
Errno::ENOENT
Application root:
/Users/john/webapps

Seems like passenger is not computing correct application root?
Shouldn't the root be /Users/john/webapps/test1?

What am I doing wrong here?

Thanks,
john

Hongli Lai

unread,
Nov 30, 2009, 5:51:36 PM11/30/09
to phusion-passenger
On Mon, Nov 30, 2009 at 11:08 PM, spovich <spo...@gmail.com> wrote:
> I have some simple rack applications that I want to consolidate on a
> single virtual host, however, I can't get apache2/passenger 2.2.7 to
> recognize the correct path to config.ru

test1 and test2 *must* be symlinks to 'public' directories. The manual
shows an example of setting up an application for sub-URI deployment.
> --
>
> You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
> To post to this group, send email to phusion-...@googlegroups.com.
> To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.
>
>
>



--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

spovich

unread,
Nov 30, 2009, 6:11:48 PM11/30/09
to Phusion Passenger Discussions
> test1 and test2 *must* be symlinks to 'public' directories. The manual
> shows an example of setting up an application for sub-URI deployment.

Hi, Thanks for the quick reply!

I did see the bits about a 'public' directory in the documentation but
was hoping that wasn't a hard requirement. I think you have made a bad
assumption about rack applications with that requirement. Just look
at http://coderack.org/ and you see some great ideas of things to do
with rack that don't have any public assets.

My use case is some very simple web services/rack apps (10-20 lines of
code) that don't have a 'public' folder. They just parse some GET
vars and return some XML.

I have been running these before as follows with no problem:

<VirtualHost *:80>
ServerName foo-test1
DocumentRoot /Users/john/webapps/test1
PassengerAppRoot /Users/john/webapps/test1
</VirtualHost>

<VirtualHost *:80>
ServerName foo-test3
DocumentRoot /Users/john/webapps/test2
PassengerAppRoot /Users/john/webapps/test2
</VirtualHost>

I'd really like to consolidate these into a single virtual host with
sub URI's.

Do you have any ideas how I could get these as sub URI's without
making fake 'public' folders that serve no purpose?

Thanks!
John

spovich

unread,
Nov 30, 2009, 6:29:14 PM11/30/09
to Phusion Passenger Discussions
Ok, well, so I thought about this some more and realized that the
public is probably there to protect other files (config, etc) that
someone might have.

So, I've got this working now with empty 'public' folders.

Sorry for the trouble.

Thanks,
John

On Nov 30, 3:11 pm, spovich <spov...@gmail.com> wrote:
> > test1 and test2 *must* be symlinks to 'public' directories. The manual
> > shows an example of setting up an application for sub-URI deployment.
>
> Hi, Thanks for the quick reply!
>
> I did see the bits about a 'public' directory in the documentation but
> was hoping that wasn't a hard requirement. I think you have made a bad
> assumption about rack applications with that requirement.  Just look
> athttp://coderack.org/and you see some great ideas of things to do
Reply all
Reply to author
Forward
0 new messages