From: Gale CC Date: 2007-06-29T10:23:07+09:00 Subject: Re: Ajax with Ruby problem I'm sorry to spam the board like this, but I had to correct myself on what I wrote before. I had a new insight which conflicts with what I wrote before. > No, I dont think just pre-pending "/cgi-bin" would do any magic. Yes, adding /cgi-bin does do the magic! I realized this after playing around with Apache and html scripts for a while today. I noticed that the httpd.conf had the line : ScriptAlias /cgi-bin/ /usr/local/apache2/htdocs/cgi-bin/ This means that whatever that is inside /usr/local/apache2/htdocs/cgi-bin/ would now simply be referred to as /cgi-bin no matter where you access it from. So whatever I wrote before is completely wrong - sorry about that. Thanks, Gale Gale CC wrote: >> So the problem was not calling the script with the /cgi-bin >> directory in the path ? >> And the solution was pre-pending that to the path_to_script? > > No, I dont think just pre-pending "/cgi-bin" would do any magic. Here's > what happened from the very beginning: First of all, I've configured > Apache to "execute" anything under /cgi-bin by setting it as the > Script-Alias. And then, for making Ajax work I was testing things inside > /cgi-bin. I created a folder /ajax-test inside /cgi-bin, so my html as > well as ruby scripts lied inside /cgi-bin/ajax-test/. But the Ruby > was'nt being executed and the source code would show up instead of the > output. Now after I put the html script outside the /cgi-bin folder, it > all started working. So the solution to such a problem is keeping the > html file (or whichever file is calling the script) outside the /cgi-bin > folder, or for that matter whichever folder is set as the Script-Alias > in your Apache configuration. > Was I clear enough in explaining the problem and the solution ? Let me > know if otherwise. > > Thanks all of you for all the help, > Gale > > John Joyce wrote: >> John Joyce >> >> >> On Jun 28, 2007, at 2:51 AM, Gale CC wrote: >> >>> >>>>> in this case when its run from inside a javascript script. Any idea >>>> Normally, I would have to reference the cgi-bin directory as well, >>> >>> -- >>> Posted via http://www.ruby-forum.com/. >>> >> >> So the problem was not calling the script with the /cgi-bin >> directory in the path ? >> And the solution was pre-pending that to the path_to_script? >> >> Please post a clear solution, even if it is a link to a blog. this is >> a most interesting problem and solution that should probably be on >> the troubleshooting checklist for lots of people! >> thx -- Posted via http://www.ruby-forum.com/.