sub uri problem

135 views
Skip to first unread message

tamara6

unread,
Mar 25, 2009, 2:20:05 AM3/25/09
to Phusion Passenger Discussions
I've been trying to deploy my app using a sub uri, like it says in the
users guide, but I am running into problems.

I am running Mac 10.5.3, with the apache 2 server that it came with.
I'm using the ruby that it came with, also. I've upgraded rails to
2.3.2. I installed passenger today, so it is at 2.1.2. The
installation seemed to go fine - no errors were reported.

Currently I have two virtual hosts running on this machine. This is a
computer on a university campus. The university runs the dns, and
there are two names that come to this computer. I am not allowed to
run my own dns software, and getting a new domain name is not trivial,
so I would like to avoid that. I'd like to run my app in a sub-
directory of one of my current domains.

I've moved my rails app to this machine, and I've set up the
database. All of the production mode information is in config files,
and I am able to run my app, in production mode, with mongrel. I can
see it by going to my main domain:3000.

I can adjust my virtual host so that it points to the public directory
of my app, and my app runs fine then, too. I can't leave it set up
that way because then I can't see any of the other files on my server.

So I set up the virtual host so that it would use a sub uri, and my
application does not work. I get a nice phusion error screen that
tells me "The directory "/Library/WebServer/Documents" does not appear
to be a valid Ruby on Rails application root."

I am not really sure what to do next, and I am looking for a little
bit of help.

I have my app elsewhere on the computer. I have symlinked the public
directory from it to /Library/WebServer/Documents/rails. I am hoping
to contact the rails app by going to http://blah.blah.edu/rails

Here is my virtual host info:

<VirtualHost *:80>
DocumentRoot /Library/WebServer/Documents
ServerName blah.blah.edu
RailsBaseURI /rails
<Directory /Library/WebServer/Documents/rails>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Does anybody have any idea why this isn't working? Any tips or
suggestions? What have I done wrong?

Thanks!

Tamara

Hongli Lai

unread,
Mar 25, 2009, 3:12:23 AM3/25/09
to phusion-...@googlegroups.com
You need to symlink to the 'public' folder.
--
Phusion | The Computer Science Company

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

tamara6

unread,
Mar 25, 2009, 8:15:00 AM3/25/09
to Phusion Passenger Discussions
I have symlinked to the public folder.

/Library/WebServer/Documents/rails contains a symlink to /tamara/
railsapps/myapp/public

so it looks like /Library/WebServer/Documents/rails/public

Is this not correct?

Thanks,

Tamara
> > to contact the rails app by going tohttp://blah.blah.edu/rails
>
> > Here is my virtual host info:
>
> > <VirtualHost *:80>
> >    DocumentRoot /Library/WebServer/Documents
> >    ServerName blah.blah.edu
> >    RailsBaseURI /rails
> >    <Directory /Library/WebServer/Documents/rails>
> >        Options FollowSymLinks
> >        AllowOverride None
> >        Order allow,deny
> >        Allow from all
> >    </Directory>
> > </VirtualHost>
>
> > Does anybody have any idea why this isn't working?  Any tips or
> > suggestions?  What have I done wrong?
>
> > Thanks!
>
> > Tamara
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

tamara6

unread,
Mar 25, 2009, 4:47:50 PM3/25/09
to Phusion Passenger Discussions
Answering my own question here. The answer is that the symlink should
*be* the rails directory, not in it. So my Library/WebServer/
Documents/rails contains 404.html, favicon.ico, robots.txt,
dispatch.rb, etc (because it is a symlink to the public directory,
which contains all of those files).

and then sticking the line config.action_controller.relative_url_root
= '/rails' in my environment.rb file (like others have said) makes it
all work.

Thanks to anybody who spent time thinking about this for me.
Hopefully this will be helpful to someone in the future.

Tamara

shikarishambu

unread,
May 14, 2009, 10:30:20 PM5/14/09
to Phusion Passenger Discussions
I am running into the same issue. I did the following
ln -s /home/myuser/www/mynewapp/public /var/www/mynewapp

which is what the Ubuntu Community documentation suggests

However, I continue to get the following error when I try and browse
to http://localhost/mynewapp

The directory "/home/myuser/www" does not appear to be a valid Ruby
on Rails application root.

Please help.

Thanks

Hongli Lai

unread,
May 19, 2009, 10:57:33 AM5/19/09
to phusion-...@googlegroups.com
On Fri, May 15, 2009 at 4:30 AM, shikarishambu <roshan....@gmail.com> wrote:
>
> I am running into the same issue. I did the following
> ln -s /home/myuser/www/mynewapp/public /var/www/mynewapp
>
> which is what the Ubuntu Community documentation suggests
>
> However, I continue to get the following error when I try and browse
> to http://localhost/mynewapp
>
> The directory "/home/myuser/www"  does not appear to be a valid Ruby
> on Rails application root.

Please point your DocumentRoot to /home/myuser/www/mynewapp/public
directly, or set the PassengerAppRoot option.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

c0pac371c

unread,
Jun 3, 2009, 9:29:35 AM6/3/09
to Phusion Passenger Discussions
How do you do a sym link for sub domains? I have my subdomain setup
but I keep getting the same error.

On May 19, 10:57 am, Hongli Lai <hon...@phusion.nl> wrote:
> On Fri, May 15, 2009 at 4:30 AM, shikarishambu <roshan.shan...@gmail.com> wrote:
>
> > I am running into the same issue. I did the following
> > ln -s /home/myuser/www/mynewapp/public /var/www/mynewapp
>
> > which is what the Ubuntu Community documentation suggests
>
> > However, I continue to get the following error when I try and browse
> > tohttp://localhost/mynewapp
>
> > The directory "/home/myuser/www"  does not appear to be a valid Ruby
> > on Rails application root.
>
> Please point your DocumentRoot to /home/myuser/www/mynewapp/public
> directly, or set the PassengerAppRoot option.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl
Reply all
Reply to author
Forward
0 new messages