Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-16 Thread Magnus Holm
This bug is actually Apache's fault. The problem occurs when you use mod_rewrite to hide that you're using dispatch.cgi. When you use RewriteRule ^(.*)$ dispatch.cgi the following happens: * SCRIPT_NAME is set to /dispatch.cgi (since that's the actual script which gets ran) * REDIRECT_SCRIPT_NAME

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-16 Thread Eric Mill
Magnus, this is terrific information, thank you for looking into this. I'm trying to follow your example - you use ApacheFixer to make a TestingFixed class, but never use that class anywhere else. Do you mean for the lines in dispatch.* to use TestingFixed instead of Testing? I'm trying to use

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-16 Thread Magnus Holm
Simply replace Testing with TestingFixed in dispatch.cgi:11 and dispatch.fcgi:13 to see the diffenrence :-) On Wed, Jul 16, 2008 at 11:28 PM, Eric Mill [EMAIL PROTECTED] wrote: Magnus, this is terrific information, thank you for looking into this. I'm trying to follow your example - you use

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-16 Thread Eric Mill
Unfortunately this isn't working. I'm checking my ENV and REDIRECT_SCRIPT_NAME isn't set to anything. I'm using the Rack spec to try to figure out an alternative. Right now, requests to / go to a Camping error page which says /index.html not found! and requests to /login (which should go to a

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-16 Thread Julian Tarkhanov
On 16 jul 2008, at 23:40, Eric Mill wrote: Unfortunately this isn't working. I'm checking my ENV and REDIRECT_SCRIPT_NAME isn't set to anything. I'm using the Rack spec to try to figure out an alternative. Rails resolves this somehow, they mount dispatch.fcgi as / dispatch.fcgi and use it

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-16 Thread Eric Mill
The 500-handling I'm used to appears to be gone. What's the best approach here? -- Eric On Wed, Jul 16, 2008 at 6:08 PM, Eric Mill [EMAIL PROTECTED] wrote: I think I've got it working, with this as the 'fixer' call: def call(env) env['SCRIPT_NAME'] = '/' env['PATH_INFO'] =

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-16 Thread Eric Mill
I think I've got it working, with this as the 'fixer' call: def call(env) env['SCRIPT_NAME'] = '/' env['PATH_INFO'] = env['REDIRECT_URL'] @app.call(env) end I think you might have meant REDIRECT_URL and not REDIRECT_SCRIPT_NAME? Thank you Magnus! -- Eric On Wed, Jul 16, 2008

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Magnus Holm
What about dropping the idea of config.ru and just create a dispatch.cgi like this? #!/usr/bin/env ruby require 'app' Rack::Handler::CGI.run(App) On Fri, Jul 11, 2008 at 7:33 AM, Eric Mill [EMAIL PROTECTED] wrote: Some progress: I put most of the code from dispatch.cgi into a

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Bluebie, Jenna
Could you show us the .htaccess please? :) ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Bluebie, Jenna
Also, is it possible that you could simply rename dispatch.cgi to something like 'appname' and use htaccess to grant that file cgi execution type permissions? Or does this need to be on the root of a domain? ___ Camping-list mailing list

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Bluebie, Jenna
can you please try adding to htaccess SetEnv SCRIPT_NAME /path/to/app Assuming your dispatch is in /path/to/app/dispatch.cgi Let us know what happens! ___ Camping-list mailing list Camping-list@rubyforge.org

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Bluebie, Jenna
No wait, this is even better, at the end of your RewriteRule, put: [env=SCRIPT_NAME:/path/to/app] Let us know what happens! ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Eric Mill
I'm not able to get this working, I can't seem to affect the environment, either using the SetEnv approach, or by including that at the end of RewriteRule. How does Camping use the env in forming its understanding of its base URI? Forming URLs using the R method does not pre-pend /dispatch.cgi/,

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Bluebie, Jenna
I really do think we should build in the SCRIPT_URL || SCRIPT_NAME thingo. This is going to be a relatively common situation. Totally worth the bytes. ___ Camping-list mailing list Camping-list@rubyforge.org

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Julik Tarkhanov
On Jul 15, 2008, at 12:58 AM, Bluebie, Jenna wrote: I really do think we should build in the SCRIPT_URL || SCRIPT_NAME thingo. This is going to be a relatively common situation. Totally worth the bytes. You might, but this is a can of worms. See, right now for example, if you need to

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-14 Thread Bluebie, Jenna
We are talking about cgi here, not fast cgi. Specifically CGI's interactions with mod_rewrite in apache. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list

Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-10 Thread Eric Mill
Specifically, Dreamhost. I'm trying to figure out how to get this to work the standard dispatch.cgi or dispatch.fcgi setup. I've been using the instructions that Magnus sent out when he first announced his plan for Camping 2.0, but they either no longer apply, or I'm an edge case. I've been

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

2008-07-10 Thread Eric Mill
Some progress: I put most of the code from dispatch.cgi into a config.ru, and dispatch.cgi now uses backticks to literally call '/usr/bin/env rackup'. This works, yet now calls to / redirect to /dispatch.cgi/ (this is truly the path in my browser location bar), and it messes with my routing.