Passenger grabs entire apache site

9 views
Skip to first unread message

matt connolly

unread,
Sep 9, 2010, 5:16:42 PM9/9/10
to Phusion Passenger Discussions
I've installed passenger so I can use a rails app (redmine) on Mac
OSX.

Installation seems fine, and I have the redmine app working. I have
set up an apache config file like this:


LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/
passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-2.2.15
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/
usr/bin/ruby

<VirtualHost *:80>
ServerName redmine
ServerAlias redmine.local
DocumentRoot /Library/WebServer/Sites/redmine/public
<Directory "/Library/WebServer/Sites/redmine/public">
Options Indexes ExecCGI FollowSymLinks -MultiViews
Order allow,deny
Allow from all
AllowOverride all
RailsEnv production
</Directory>
</VirtualHost>

And redmine.local is defined in /etc/hosts as 127.0.0.1. If I point my
web browser at http://redmine.local/ it works as expected.

However, passenger seems to be handling all my web requests for the
entire site now, and pages that used to work with php now come up with
the Rails(redmine) 404 page, eg:

http://localhost/some/other/path/function/argument

Where that other path uses a rewrite like this:
http://localhost/some/other/path/index.php&q=function/argument

How is it possible to restrict passenger to only operate within a
certain VirtualHost/Location/Directory???


Thanks,
Matt

secureguards

unread,
Sep 9, 2010, 8:32:43 PM9/9/10
to Phusion Passenger Discussions
do you have a vhost entry for localhost ? If not add it and check or
create a separate vhost for php site.

When the request comes to apache and if it can't find any vhosts, it
will serve the first vhost. I thinks thats whats happening here.



On Sep 10, 2:16 am, matt connolly <matt.connolly...@gmail.com> wrote:
> I've installed passenger so I can use a rails app (redmine) on Mac
> OSX.
>
> Installation seems fine, and I have the redmine app working. I have
> set up an apache config file like this:
>
> LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/
> passenger-2.2.15/ext/apache2/mod_passenger.so
> PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-2.2.15
> PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/
> usr/bin/ruby
>
> <VirtualHost *:80>
>         ServerName redmine
>         ServerAlias redmine.local
>         DocumentRoot /Library/WebServer/Sites/redmine/public
> <Directory "/Library/WebServer/Sites/redmine/public">
>     Options Indexes ExecCGI FollowSymLinks -MultiViews
>     Order allow,deny
>     Allow from all
>     AllowOverride all
>     RailsEnv production
> </Directory>
> </VirtualHost>
>
> And redmine.local is defined in /etc/hosts as 127.0.0.1. If I point my
> web browser athttp://redmine.local/it works as expected.

matt connolly

unread,
Sep 11, 2010, 7:15:16 AM9/11/10
to Phusion Passenger Discussions
No, I didn't have any other virtual host definitions. The output of
`apachectl -S` was:

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 redmine (/private/etc/apache2/users/
redmine.conf:17)
Syntax OK

After RTFM'ing about vhosts (http://httpd.apache.org/docs/2.2/vhosts/
name-based.html) and adding a VirtualHost for localhost, now
`apachectl -S` is:

[Sat Sep 11 20:51:44 2010] [warn] NameVirtualHost *:80 has no
VirtualHosts
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server localhost (/private/etc/apache2/extra/httpd-
vhosts.conf:46)
port 80 namevhost localhost (/private/etc/apache2/extra/httpd-
vhosts.conf:46)
port 80 namevhost redmine.mattbookpro.local (/private/etc/
apache2/users/redmine.conf:17)
port 80 namevhost localhost (/private/etc/apache2/extra/httpd-
vhosts.conf:46)
Syntax OK

Dunno about that warning, but it seems to work correctly now. Thanks
for the hint!



Still, I'd like to avoid the whole virtual host thing if possible and
just stick the rails app in a Directory, but I can't see how to do
that. In the mod_rails documentation there's instructions for putting
a rails app in a Sub-URI, but only a Sub-URI of a virtual host....


Any ideas?

Thanks,
Matt
> > web browser athttp://redmine.local/itworks as expected.
Reply all
Reply to author
Forward
0 new messages