rails plus cgi/php?

13 views
Skip to first unread message

Danimal

unread,
Apr 23, 2008, 4:32:05 PM4/23/08
to Phusion Passenger Discussions
If I use mod_rails, can I still define and use a cgi-bin directory for
perl stuff and/or PHP stuff?

Maybe these should be two separate questions. Ultimately, though, I
can't tell from the docs if a virtual host has to be set for rails
only or if it can run rails in the documentroot but also define a cgi-
bin scriptdir?

-Danimal

Hongli Lai

unread,
Apr 23, 2008, 5:01:47 PM4/23/08
to phusion-...@googlegroups.com
Danimal wrote:
> If I use mod_rails, can I still define and use a cgi-bin directory for
> perl stuff and/or PHP stuff?

Yes, but probably not in the same virtual host as the Rails app.
Otherwise things will conflict with each other.
--
Phusion | The Computer Science Company

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

Ken Collins

unread,
Apr 23, 2008, 6:33:47 PM4/23/08
to phusion-...@googlegroups.com

I dont know about cgi-bin dir, but I use mint (php stats) in my
mephisto blog. My vhost looks something like this:

<VirtualHost *:80>
ServerName metaskills.net
ServerAlias www.metaskills.net
DocumentRoot "/Library/WebServer/hosts/metaskills.net/public"
<Directory "/Library/WebServer/hosts/metaskills.net/public">
Include conf/common/default_options.conf
Include conf/common/expires.conf
</Directory>
<Directory "/Library/WebServer/hosts/metaskills.net/public/mint">
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
DirectoryIndex index.php
</Directory>
RewriteEngine On
# Make sure to stop processing redirects for mint.
RewriteCond %{REQUEST_URI} ^/mint/$
RewriteRule ^/(.*)$ /mint/index.php [L]
RewriteCond %{REQUEST_URI} ^/mint.*
RewriteRule ^/(.*)$ %{REQUEST_URI} [L]
Include conf/common/deflates.conf
</VirtualHost>

> --~--~---------~--~----~------------~-------~--~----~
> 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-
> pass...@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
> -~----------~----~----~----~------~----~------~--~---
>

Danimal

unread,
Apr 23, 2008, 7:38:51 PM4/23/08
to Phusion Passenger Discussions
Hongli,

Thanks for the response. I guess I'm wondering, particularly in light
of Ken's post, why it wouldn't work to define a cgi-bin via a
Directory directive then set it to use the Perl handler.

For example, I have a ScriptAlias for cgi-bin and a Directory
directive but I also have proxy and reverseproxy directives to pass on
to a mongrel instance.

This all works well, but it's Apache 1.3 + Mongrel.

I'd love to jsut have Apache 2 + mod_rails. I'm asking only because
I'm still trying to get a server set up with Apache 2 so I can test
mod_rails. I'll try it out soon, though, and let you know.

-Danimal

Eric Berry

unread,
Apr 24, 2008, 10:38:02 AM4/24/08
to Phusion Passenger Discussions
We had a similar issue come up where we have sub-directories of the
rails application point to php code. The way we got around this is by
setting up a ProxyPass in the virtual host. I don't know if this
helps, but if so, :D

Eric Berry

craig....@gmail.com

unread,
Apr 24, 2008, 11:44:32 AM4/24/08
to Phusion Passenger Discussions
I have this in my apache config, where I use perl/cgi and mod_rails:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

RailsBaseURI /coffee

Danimal

unread,
Apr 24, 2008, 11:47:25 AM4/24/08
to Phusion Passenger Discussions
Craig,

This is perfect!

My rationale for all of this is that I really want to use UberUploader
for uploading large (and possibly multiple) files, but I want to run
it all on mod_rails. So this way, I think I can have both.

Thanks!

-Danimal
Reply all
Reply to author
Forward
0 new messages