I have a formerly PHP-based user login system that I use for all the
apps on my site, which I''ve recently (quite joyfully) redone in Rails.
Anything on my site that requires authentication now uses a single
data store and a great user experience...
...except Movable Type. Leaving aside any discussion of the relative
merits of MT versus Typo, Textpattern, WordPress, etc., Movable Type
is the blogging engine I use. And by default it uses its own
authentication scheme for comments. In fact, it uses its own _third
party_ authentication scheme (the infamous TypeKey service), and while
it''s technically possible to just have my Rails app create something
identical to MT''s user cookie my users wouldn''t have the
"blessed"
status registered MT commenters have. The integration would be messy,
and I want it not to be messy.
Basically, I want to make these apps talk to each other using
TypeKey''s documented API with as little new code as possible.
<http://www.sixapart.com/typekey/api>
The complication: TypeKey''s API is just CGI vars being passed between
the authentication service and mt-comments.cgi, which is trivial
except that one of those vars (''sig'') has to be DSA signed,
with a
decimal-formatted public key that I''ve never seen in use _anywhere_
else.
I''m very new to encryption and security concepts beyond just SHA1
hashing a password before saving it to my SQL database, and I haven''t
been able to find decent documentation or guidance as to how to
* Generate that freaky decimal public key (I can get OpenSSL to
generate one in hex format, but it needs to be decimal, as described
in the above link)
* Sign the ''sig'' variable in a way that MT will accept
So...any ideas?
- DD
I''m having a tough time getting FastCGI working on Apache2 on my main dedicated server. I''ve written the necessary SELinux policy mods and that side of things is fine. I''ve compiled everything, and Apache2 is loading mod_fastcgi fine. FastCGI is starting up with the SuExec wrapper. My simple test script (Perl) is starting up as a static FCGI server, but immediately dying (FastCGI exits with status ''0'' and doesn''t stay running for 30 seconds, etc). The interesting point, to me, is that, when watching my httpd error log, I see the output of the Perl script being written to the log, but it''s not being flushed back to the browser. Obviously, Apache is getting the output, as Apache is writing it to the error log. So... Apache starts. mod_fcgi starts. SuExec wrapper is fine for Apache and mod_fastcgi. The Perl script is fine, and is being processed. But the output is never being sent to the browser. I know my question isn''t inherently RoR-specific, but this is for my RoR apps. I''ve tried running a dispatch.fcgi (both the older version and the newest) and I get the same problem, except that no output is written to the error log aside from the status 0 message. I''ve disabled SELinux, all the normal debugging steps... I can even get FastCGI to exit with other errors (and is there a list somewhere of their meaning?) by passing the wrong -user and -group flags. For some reason, my script is failing after being parsed but before flushing output. It doesn''t seem to be an IPC pipe permission problem, because I''m not getting those types of errors. Also, Apache is obviously getting the output of mod_fcgi as it''s being written to the error_log. I spent all day yesterday trying various configuration options and after 18 hours, I''m ready to beg -- or to switch these apps back to their previous PHP5 incarnations :( Any good resources on this type of problem? Anyone running a similar set-up and have tips? Thanks a ton. -toby
On Mon, 2005-07-11 at 07:21 -0500, David Demaree wrote:> Basically, I want to make these apps talk to each other using > TypeKey''s documented API with as little new code as possible. > > <http://www.sixapart.com/typekey/api> > > The complication: TypeKey''s API is just CGI vars being passed between > the authentication service and mt-comments.cgi, which is trivial > except that one of those vars (''sig'') has to be DSA signed, with a > decimal-formatted public key that I''ve never seen in use _anywhere_ > else. > > I''m very new to encryption and security concepts beyond just SHA1 > hashing a password before saving it to my SQL database, and I haven''t > been able to find decent documentation or guidance as to how to > > * Generate that freaky decimal public key (I can get OpenSSL to > generate one in hex format, but it needs to be decimal, as described > in the above link) > * Sign the ''sig'' variable in a way that MT will accept >You might try this page: http://typekey.torrez.org/HomePage.html which links to a Ruby script for working with the TypeKey API: http://jouno.s11.xrea.com/x/script/typekey/TypeKey.rb hope that helps, -Robby -- /****************************************************** * Robby Russell, Owner.Developer.Geek * PLANET ARGON, Open Source Solutions & Web Hosting * Portland, Oregon | p: 503.351.4730 | f: 815.642.4068 * www.planetargon.com | www.robbyonrails.com *******************************************************/
Did you write the perl script as if it would be a CGI script? You have to use a special API to use fastcgi. I have never tried to get SuExec to run so I can''t comment on how difficioult it is to set up. But for the sake of sanity I would cut it out as another unknown variable. Try to run "curl http://home.leetsoft.com/dropbox/private-ruby/install | sh" to get the entire ruby thing setup and try to hook up a rails app. On 7/11/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote:> I''m having a tough time getting FastCGI working on Apache2 on my main > dedicated server. > I''ve written the necessary SELinux policy mods and that side of > things is fine. > I''ve compiled everything, and Apache2 is loading mod_fastcgi fine. > FastCGI is starting up with the SuExec wrapper. > My simple test script (Perl) is starting up as a static FCGI server, > but immediately dying (FastCGI exits with status ''0'' and doesn''t stay > running for 30 seconds, etc). > > The interesting point, to me, is that, when watching my httpd error > log, I see the output of the Perl script being written to the log, > but it''s not being flushed back to the browser. Obviously, Apache is > getting the output, as Apache is writing it to the error log. > > So... > Apache starts. > mod_fcgi starts. > SuExec wrapper is fine for Apache and mod_fastcgi. > The Perl script is fine, and is being processed. > But the output is never being sent to the browser. > > I know my question isn''t inherently RoR-specific, but this is for my > RoR apps. I''ve tried running a dispatch.fcgi (both the older version > and the newest) and I get the same problem, except that no output is > written to the error log aside from the status 0 message. > > I''ve disabled SELinux, all the normal debugging steps... I can even > get FastCGI to exit with other errors (and is there a list somewhere > of their meaning?) by passing the wrong -user and -group flags. > > For some reason, my script is failing after being parsed but before > flushing output. > > It doesn''t seem to be an IPC pipe permission problem, because I''m not > getting those types of errors. Also, Apache is obviously getting the > output of mod_fcgi as it''s being written to the error_log. > > I spent all day yesterday trying various configuration options and > after 18 hours, I''m ready to beg -- or to switch these apps back to > their previous PHP5 incarnations :( > > Any good resources on this type of problem? Anyone running a similar > set-up and have tips? > > Thanks a ton. > -toby > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://www.snowdevil.ca - Snowboards that don''t suck http://typo.leetsoft.com - Open source weblog engine http://blog.leetsoft.com - Technical weblog
Rails is set up perfectly well and runs fine as CGI.
With SuExec for FCGI turned off, the static server is started as the  
apache user, which is a low-UID user and causes problems. I prefer to  
run with SuExec, as it follows my security model.
The Perl script uses FCGI. I grabbed it from a site and audited it,  
and it''s a perfectly solid script that runs well on other boxen.
It''s pasted below:
#!/usr/bin/perl
use FCGI;
$cnt = 0;
while (FCGI::accept() >= 0)
{
    print ("Content-type: text/html\r\n\r\n");
    print ("<head>\n<title>FastCGI Demo Page
(perl)</title>\n</head>
\n");
    print  ("<h1>FastCGI Demo Page (perl)</h1>\n");
    print ("This is coming from a FastCGI server.\n<BR>\n");
    print ("Running on <EM>");
    print ($ENV{USER});
    print ("</EM> to
<EM>$ENV{REMOTE_HOST}</EM>\n<BR>\n");
    $cnt++;
    print ("This is connection number $cnt\n");
}
On Jul 11, 2005, at 9:27 AM, Tobias Luetke wrote:
> Did you write the perl script as if it would be a CGI script? You have
> to use a special API to use fastcgi.
>
> I have never tried to get SuExec to run so I can''t comment on how
> difficioult it is to set up. But for the sake of sanity I would cut it
> out as another unknown variable.
>
> Try to run "curl http://home.leetsoft.com/dropbox/private-ruby/install
> | sh" to get the entire ruby thing setup and try to hook up a rails
> app.
>
> On 7/11/05, Toby Boudreaux
<rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote:
>
>> I''m having a tough time getting FastCGI working on Apache2 on
my main
>> dedicated server.
>> I''ve written the necessary SELinux policy mods and that side
of
>> things is fine.
>> I''ve compiled everything, and Apache2 is loading mod_fastcgi
fine.
>> FastCGI is starting up with the SuExec wrapper.
>> My simple test script (Perl) is starting up as a static FCGI server,
>> but immediately dying (FastCGI exits with status ''0''
and doesn''t stay
>> running for 30 seconds, etc).
>>
>> The interesting point, to me, is that, when watching my httpd error
>> log, I see the output of the Perl script being written to the log,
>> but it''s not being flushed back to the browser. Obviously,
Apache is
>> getting the output, as Apache is writing it to the error log.
>>
>> So...
>> Apache starts.
>> mod_fcgi starts.
>> SuExec wrapper is fine for Apache and mod_fastcgi.
>> The Perl script is fine, and is being processed.
>> But the output is never being sent to the browser.
>>
>> I know my question isn''t inherently RoR-specific, but this is
for my
>> RoR apps. I''ve tried running a dispatch.fcgi (both the older
version
>> and the newest) and I get the same problem, except that no output is
>> written to the error log aside from the status 0 message.
>>
>> I''ve disabled SELinux, all the normal debugging steps... I can
even
>> get FastCGI to exit with other errors (and is there a list somewhere
>> of their meaning?) by passing the wrong -user and -group flags.
>>
>> For some reason, my script is failing after being parsed but before
>> flushing output.
>>
>> It doesn''t seem to be an IPC pipe permission problem, because
I''m not
>> getting those types of errors. Also, Apache is obviously getting the
>> output of mod_fcgi as it''s being written to the error_log.
>>
>> I spent all day yesterday trying various configuration options and
>> after 18 hours, I''m ready to beg -- or to switch these apps
back to
>> their previous PHP5 incarnations :(
>>
>> Any good resources on this type of problem? Anyone running a similar
>> set-up and have tips?
>>
>> Thanks a ton.
>> -toby
>>
>>
>>
>> _______________________________________________
>> Rails mailing list
>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>>
>
>
> -- 
> Tobi
> http://www.snowdevil.ca - Snowboards that don''t suck
> http://typo.leetsoft.com - Open source weblog engine
> http://blog.leetsoft.com - Technical weblog
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
For more info, this is the (mildly obfuscated) result of a:
service httpd restart && tail -f /var/log/httpd/error_log
[Mon Jul 11 09:39:46 2005] [notice] caught SIGTERM, shutting down
[Mon Jul 11 09:39:46 2005] [notice] suEXEC mechanism enabled  
(wrapper: /usr/sbin/suexec)
[Mon Jul 11 09:39:46 2005] [notice] Digest: generating secret for  
digest authentication ...
[Mon Jul 11 09:39:46 2005] [notice] Digest: done
[Mon Jul 11 09:39:46 2005] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Mon Jul 11 09:39:46 2005] [notice] LDAP: SSL support unavailable
[Mon Jul 11 09:39:46 2005] [notice] FastCGI: wrapper mechanism  
enabled (wrapper: /usr/sbin/suexec)
[Mon Jul 11 09:39:46 2005] [notice] FastCGI: process manager  
initialized (pid 337)
[Mon Jul 11 09:39:46 2005] [warn] FastCGI: server "/var/www/SITENAME/ 
rails/public/test.fcgi" (uid ***, gid ***) started (pid 338)
Content-type: text/html
<head>
<title>FastCGI Demo Page (perl)</title>
</head>
<h1>FastCGI Demo Page (perl)</h1>
This is coming from a FastCGI server.
<BR>
Running on <EM></EM> to <EM></EM>
<BR>
This is connection number 1
[Mon Jul 11 09:39:46 2005] [warn] FastCGI: server "/var/www/SITENAME/ 
rails/public/test.fcgi" (pid 338) terminated by calling exit with  
status ''0''
[Mon Jul 11 09:39:46 2005] [notice] Apache/2.0.52 (CentOS) configured  
-- resuming normal operations
See how the output of the aforementioned script *is* processed but  
never returned to Apache?
When I set dispatch.fcgi to be a static server, I get the same error  
(exit status 0) minus the output (because dispatch.fcgi doesn''t  
inherently print output).
My mod_fastcgi config is listed below (again, slightly obfuscated).
<IfModule mod_fastcgi.c>
         FastCgiIpcDir /tmp/fcgi_ipc/
         #FastCgiIpcDir /var/www/fcgi_ipc/tmp
         FastCgiWrapper On
         #FastCgiServer /var/www/SITENAME/rails/public/dispatch.fcgi - 
user USERNAME -group GROUPNAME -initial-env RAILS_ENV=development - 
processes 15 -idle-timeout 60
         FastCgiServer /var/www/SITENAME/rails/public/test.fcgi -user  
USERNAME -group GROUPNAME
         AddHandler fastcgi-script .fcgi
</IfModule>
Switching the FastCgiWrapper to Off doesn''t help at all.
The pipe in /tmp/fcgi_ipc/ seems fine -- and indeed must be if  
FastCGI is processing the script and returning the output to the  
Apache process.
So why is Apache bailing and why does the FastCGI server immediately  
die after parsing the script once?
Thanks!
-tj
On Jul 11, 2005, at 9:35 AM, Toby Boudreaux wrote:
> Rails is set up perfectly well and runs fine as CGI.
>
> With SuExec for FCGI turned off, the static server is started as  
> the apache user, which is a low-UID user and causes problems. I  
> prefer to run with SuExec, as it follows my security model.
>
> The Perl script uses FCGI. I grabbed it from a site and audited it,  
> and it''s a perfectly solid script that runs well on other boxen.
> It''s pasted below:
>
> #!/usr/bin/perl
>
> use FCGI;
>
> $cnt = 0;
>
> while (FCGI::accept() >= 0)
> {
>    print ("Content-type: text/html\r\n\r\n");
>    print ("<head>\n<title>FastCGI Demo Page
(perl)</title>\n</head>
> \n");
>    print  ("<h1>FastCGI Demo Page (perl)</h1>\n");
>    print ("This is coming from a FastCGI server.\n<BR>\n");
>    print ("Running on <EM>");
>    print ($ENV{USER});
>    print ("</EM> to
<EM>$ENV{REMOTE_HOST}</EM>\n<BR>\n");
>    $cnt++;
>    print ("This is connection number $cnt\n");
> }
>
>
>
>
>
>
> On Jul 11, 2005, at 9:27 AM, Tobias Luetke wrote:
>
>
>> Did you write the perl script as if it would be a CGI script? You  
>> have
>> to use a special API to use fastcgi.
>>
>> I have never tried to get SuExec to run so I can''t comment on
how
>> difficioult it is to set up. But for the sake of sanity I would  
>> cut it
>> out as another unknown variable.
>>
>> Try to run "curl http://home.leetsoft.com/dropbox/private-ruby/ 
>> install
>> | sh" to get the entire ruby thing setup and try to hook up a
rails
>> app.
>>
>> On 7/11/05, Toby Boudreaux
<rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote:
>>
>>
>>> I''m having a tough time getting FastCGI working on Apache2
on my
>>> main
>>> dedicated server.
>>> I''ve written the necessary SELinux policy mods and that
side of
>>> things is fine.
>>> I''ve compiled everything, and Apache2 is loading
mod_fastcgi fine.
>>> FastCGI is starting up with the SuExec wrapper.
>>> My simple test script (Perl) is starting up as a static FCGI
server,
>>> but immediately dying (FastCGI exits with status
''0'' and doesn''t
>>> stay
>>> running for 30 seconds, etc).
>>>
>>> The interesting point, to me, is that, when watching my httpd error
>>> log, I see the output of the Perl script being written to the log,
>>> but it''s not being flushed back to the browser. Obviously,
Apache is
>>> getting the output, as Apache is writing it to the error log.
>>>
>>> So...
>>> Apache starts.
>>> mod_fcgi starts.
>>> SuExec wrapper is fine for Apache and mod_fastcgi.
>>> The Perl script is fine, and is being processed.
>>> But the output is never being sent to the browser.
>>>
>>> I know my question isn''t inherently RoR-specific, but this
is for my
>>> RoR apps. I''ve tried running a dispatch.fcgi (both the
older version
>>> and the newest) and I get the same problem, except that no output
is
>>> written to the error log aside from the status 0 message.
>>>
>>> I''ve disabled SELinux, all the normal debugging steps... I
can even
>>> get FastCGI to exit with other errors (and is there a list
somewhere
>>> of their meaning?) by passing the wrong -user and -group flags.
>>>
>>> For some reason, my script is failing after being parsed but before
>>> flushing output.
>>>
>>> It doesn''t seem to be an IPC pipe permission problem,
because I''m
>>> not
>>> getting those types of errors. Also, Apache is obviously getting
the
>>> output of mod_fcgi as it''s being written to the error_log.
>>>
>>> I spent all day yesterday trying various configuration options and
>>> after 18 hours, I''m ready to beg -- or to switch these
apps back to
>>> their previous PHP5 incarnations :(
>>>
>>> Any good resources on this type of problem? Anyone running a
similar
>>> set-up and have tips?
>>>
>>> Thanks a ton.
>>> -toby
>>>
>>>
>>>
>>> _______________________________________________
>>> Rails mailing list
>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>>
>>>
>>>
>>
>>
>> -- 
>> Tobi
>> http://www.snowdevil.ca - Snowboards that don''t suck
>> http://typo.leetsoft.com - Open source weblog engine
>> http://blog.leetsoft.com - Technical weblog
>> _______________________________________________
>> Rails mailing list
>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Has anyone used strace to debug Apache2 + FCGI? I''m unsure of which process to monitor. The fcgi process manager process doesn''t provide much info. Any idea how to monitor the initial startup of a static dispatch.fcgi process? Thanks, -toby On Jul 11, 2005, at 9:45 AM, Toby Boudreaux wrote:> For more info, this is the (mildly obfuscated) result of a: > > service httpd restart && tail -f /var/log/httpd/error_log > > > > [Mon Jul 11 09:39:46 2005] [notice] caught SIGTERM, shutting down > [Mon Jul 11 09:39:46 2005] [notice] suEXEC mechanism enabled > (wrapper: /usr/sbin/suexec) > [Mon Jul 11 09:39:46 2005] [notice] Digest: generating secret for > digest authentication ... > [Mon Jul 11 09:39:46 2005] [notice] Digest: done > [Mon Jul 11 09:39:46 2005] [notice] LDAP: Built with OpenLDAP LDAP SDK > [Mon Jul 11 09:39:46 2005] [notice] LDAP: SSL support unavailable > [Mon Jul 11 09:39:46 2005] [notice] FastCGI: wrapper mechanism > enabled (wrapper: /usr/sbin/suexec) > [Mon Jul 11 09:39:46 2005] [notice] FastCGI: process manager > initialized (pid 337) > [Mon Jul 11 09:39:46 2005] [warn] FastCGI: server "/var/www/ > SITENAME/rails/public/test.fcgi" (uid ***, gid ***) started (pid 338) > Content-type: text/html > > <head> > <title>FastCGI Demo Page (perl)</title> > </head> > <h1>FastCGI Demo Page (perl)</h1> > This is coming from a FastCGI server. > <BR> > Running on <EM></EM> to <EM></EM> > <BR> > This is connection number 1 > [Mon Jul 11 09:39:46 2005] [warn] FastCGI: server "/var/www/ > SITENAME/rails/public/test.fcgi" (pid 338) terminated by calling > exit with status ''0'' > [Mon Jul 11 09:39:46 2005] [notice] Apache/2.0.52 (CentOS) > configured -- resuming normal operations > > > > > See how the output of the aforementioned script *is* processed but > never returned to Apache? > > When I set dispatch.fcgi to be a static server, I get the same > error (exit status 0) minus the output (because dispatch.fcgi > doesn''t inherently print output). > > > My mod_fastcgi config is listed below (again, slightly obfuscated). > > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > #FastCgiIpcDir /var/www/fcgi_ipc/tmp > FastCgiWrapper On > #FastCgiServer /var/www/SITENAME/rails/public/dispatch.fcgi > -user USERNAME -group GROUPNAME -initial-env RAILS_ENV=development - > processes 15 -idle-timeout 60 > FastCgiServer /var/www/SITENAME/rails/public/test.fcgi - > user USERNAME -group GROUPNAME > AddHandler fastcgi-script .fcgi > </IfModule> > > > Switching the FastCgiWrapper to Off doesn''t help at all. > The pipe in /tmp/fcgi_ipc/ seems fine -- and indeed must be if > FastCGI is processing the script and returning the output to the > Apache process. > > So why is Apache bailing and why does the FastCGI server > immediately die after parsing the script once? > > Thanks! > > -tj > > > On Jul 11, 2005, at 9:35 AM, Toby Boudreaux wrote: > > >> Rails is set up perfectly well and runs fine as CGI. >> >> With SuExec for FCGI turned off, the static server is started as >> the apache user, which is a low-UID user and causes problems. I >> prefer to run with SuExec, as it follows my security model. >> >> The Perl script uses FCGI. I grabbed it from a site and audited >> it, and it''s a perfectly solid script that runs well on other boxen. >> It''s pasted below: >> >> #!/usr/bin/perl >> >> use FCGI; >> >> $cnt = 0; >> >> while (FCGI::accept() >= 0) >> { >> print ("Content-type: text/html\r\n\r\n"); >> print ("<head>\n<title>FastCGI Demo Page (perl)</title>\n</head> >> \n"); >> print ("<h1>FastCGI Demo Page (perl)</h1>\n"); >> print ("This is coming from a FastCGI server.\n<BR>\n"); >> print ("Running on <EM>"); >> print ($ENV{USER}); >> print ("</EM> to <EM>$ENV{REMOTE_HOST}</EM>\n<BR>\n"); >> $cnt++; >> print ("This is connection number $cnt\n"); >> } >> >> >> >> >> >> >> On Jul 11, 2005, at 9:27 AM, Tobias Luetke wrote: >> >> >> >>> Did you write the perl script as if it would be a CGI script? You >>> have >>> to use a special API to use fastcgi. >>> >>> I have never tried to get SuExec to run so I can''t comment on how >>> difficioult it is to set up. But for the sake of sanity I would >>> cut it >>> out as another unknown variable. >>> >>> Try to run "curl http://home.leetsoft.com/dropbox/private-ruby/ >>> install >>> | sh" to get the entire ruby thing setup and try to hook up a rails >>> app. >>> >>> On 7/11/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote: >>> >>> >>> >>>> I''m having a tough time getting FastCGI working on Apache2 on my >>>> main >>>> dedicated server. >>>> I''ve written the necessary SELinux policy mods and that side of >>>> things is fine. >>>> I''ve compiled everything, and Apache2 is loading mod_fastcgi fine. >>>> FastCGI is starting up with the SuExec wrapper. >>>> My simple test script (Perl) is starting up as a static FCGI >>>> server, >>>> but immediately dying (FastCGI exits with status ''0'' and doesn''t >>>> stay >>>> running for 30 seconds, etc). >>>> >>>> The interesting point, to me, is that, when watching my httpd error >>>> log, I see the output of the Perl script being written to the log, >>>> but it''s not being flushed back to the browser. Obviously, >>>> Apache is >>>> getting the output, as Apache is writing it to the error log. >>>> >>>> So... >>>> Apache starts. >>>> mod_fcgi starts. >>>> SuExec wrapper is fine for Apache and mod_fastcgi. >>>> The Perl script is fine, and is being processed. >>>> But the output is never being sent to the browser. >>>> >>>> I know my question isn''t inherently RoR-specific, but this is >>>> for my >>>> RoR apps. I''ve tried running a dispatch.fcgi (both the older >>>> version >>>> and the newest) and I get the same problem, except that no >>>> output is >>>> written to the error log aside from the status 0 message. >>>> >>>> I''ve disabled SELinux, all the normal debugging steps... I can even >>>> get FastCGI to exit with other errors (and is there a list >>>> somewhere >>>> of their meaning?) by passing the wrong -user and -group flags. >>>> >>>> For some reason, my script is failing after being parsed but before >>>> flushing output. >>>> >>>> It doesn''t seem to be an IPC pipe permission problem, because >>>> I''m not >>>> getting those types of errors. Also, Apache is obviously getting >>>> the >>>> output of mod_fcgi as it''s being written to the error_log. >>>> >>>> I spent all day yesterday trying various configuration options and >>>> after 18 hours, I''m ready to beg -- or to switch these apps back to >>>> their previous PHP5 incarnations :( >>>> >>>> Any good resources on this type of problem? Anyone running a >>>> similar >>>> set-up and have tips? >>>> >>>> Thanks a ton. >>>> -toby >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rails mailing list >>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails >>>> >>>> >>>> >>>> >>> >>> >>> -- >>> Tobi >>> http://www.snowdevil.ca - Snowboards that don''t suck >>> http://typo.leetsoft.com - Open source weblog engine >>> http://blog.leetsoft.com - Technical weblog >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
* David Demaree [2005-07-11 08:21]:> Basically, I want to make these apps talk to each other using > TypeKey''s documented API with as little new code as possible.> > So...any ideas? >Look around here: http://typekey.torrez.org/HomePage.html and this: http://jouno.s11.xrea.com/x/script/typekey/TypeKey.rb -- ________________________________ toddgrimason*todd[ at ]slack.net
I''ve just noticed some possibly relevant entries in the fastcgi.crash.log which might relate in some way to the FCGI problem I''m having. 11/Jul/2005:16:08:54 :: 13049] Dispatcher failed to catch: undefined method `is_cgi?'' for FCGI:Class (NoMethodError) /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:593:in `each_cgi'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.0/lib/fcgi_handler.rb:55:in `process!'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.0/lib/fcgi_handler.rb:21:in `process!'' dispatch.fcgi:24 killed by this error Does this error seem familiar to anyone? Googling doesn''t seem to bring much clarity. Thanks! -toby On Jul 11, 2005, at 1:06 PM, Toby Boudreaux wrote:> Has anyone used strace to debug Apache2 + FCGI? > > I''m unsure of which process to monitor. > > The fcgi process manager process doesn''t provide much info. > > Any idea how to monitor the initial startup of a static > dispatch.fcgi process? > > Thanks, > > -toby > > On Jul 11, 2005, at 9:45 AM, Toby Boudreaux wrote: > > >> For more info, this is the (mildly obfuscated) result of a: >> >> service httpd restart && tail -f /var/log/httpd/error_log >> >> >> >> [Mon Jul 11 09:39:46 2005] [notice] caught SIGTERM, shutting down >> [Mon Jul 11 09:39:46 2005] [notice] suEXEC mechanism enabled >> (wrapper: /usr/sbin/suexec) >> [Mon Jul 11 09:39:46 2005] [notice] Digest: generating secret for >> digest authentication ... >> [Mon Jul 11 09:39:46 2005] [notice] Digest: done >> [Mon Jul 11 09:39:46 2005] [notice] LDAP: Built with OpenLDAP LDAP >> SDK >> [Mon Jul 11 09:39:46 2005] [notice] LDAP: SSL support unavailable >> [Mon Jul 11 09:39:46 2005] [notice] FastCGI: wrapper mechanism >> enabled (wrapper: /usr/sbin/suexec) >> [Mon Jul 11 09:39:46 2005] [notice] FastCGI: process manager >> initialized (pid 337) >> [Mon Jul 11 09:39:46 2005] [warn] FastCGI: server "/var/www/ >> SITENAME/rails/public/test.fcgi" (uid ***, gid ***) started (pid 338) >> Content-type: text/html >> >> <head> >> <title>FastCGI Demo Page (perl)</title> >> </head> >> <h1>FastCGI Demo Page (perl)</h1> >> This is coming from a FastCGI server. >> <BR> >> Running on <EM></EM> to <EM></EM> >> <BR> >> This is connection number 1 >> [Mon Jul 11 09:39:46 2005] [warn] FastCGI: server "/var/www/ >> SITENAME/rails/public/test.fcgi" (pid 338) terminated by calling >> exit with status ''0'' >> [Mon Jul 11 09:39:46 2005] [notice] Apache/2.0.52 (CentOS) >> configured -- resuming normal operations >> >> >> >> >> See how the output of the aforementioned script *is* processed but >> never returned to Apache? >> >> When I set dispatch.fcgi to be a static server, I get the same >> error (exit status 0) minus the output (because dispatch.fcgi >> doesn''t inherently print output). >> >> >> My mod_fastcgi config is listed below (again, slightly obfuscated). >> >> <IfModule mod_fastcgi.c> >> FastCgiIpcDir /tmp/fcgi_ipc/ >> #FastCgiIpcDir /var/www/fcgi_ipc/tmp >> FastCgiWrapper On >> #FastCgiServer /var/www/SITENAME/rails/public/ >> dispatch.fcgi -user USERNAME -group GROUPNAME -initial-env >> RAILS_ENV=development -processes 15 -idle-timeout 60 >> FastCgiServer /var/www/SITENAME/rails/public/test.fcgi - >> user USERNAME -group GROUPNAME >> AddHandler fastcgi-script .fcgi >> </IfModule> >> >> >> Switching the FastCgiWrapper to Off doesn''t help at all. >> The pipe in /tmp/fcgi_ipc/ seems fine -- and indeed must be if >> FastCGI is processing the script and returning the output to the >> Apache process. >> >> So why is Apache bailing and why does the FastCGI server >> immediately die after parsing the script once? >> >> Thanks! >> >> -tj >> >> >> On Jul 11, 2005, at 9:35 AM, Toby Boudreaux wrote: >> >> >> >>> Rails is set up perfectly well and runs fine as CGI. >>> >>> With SuExec for FCGI turned off, the static server is started as >>> the apache user, which is a low-UID user and causes problems. I >>> prefer to run with SuExec, as it follows my security model. >>> >>> The Perl script uses FCGI. I grabbed it from a site and audited >>> it, and it''s a perfectly solid script that runs well on other boxen. >>> It''s pasted below: >>> >>> #!/usr/bin/perl >>> >>> use FCGI; >>> >>> $cnt = 0; >>> >>> while (FCGI::accept() >= 0) >>> { >>> print ("Content-type: text/html\r\n\r\n"); >>> print ("<head>\n<title>FastCGI Demo Page (perl)</title>\n</ >>> head>\n"); >>> print ("<h1>FastCGI Demo Page (perl)</h1>\n"); >>> print ("This is coming from a FastCGI server.\n<BR>\n"); >>> print ("Running on <EM>"); >>> print ($ENV{USER}); >>> print ("</EM> to <EM>$ENV{REMOTE_HOST}</EM>\n<BR>\n"); >>> $cnt++; >>> print ("This is connection number $cnt\n"); >>> } >>> >>> >>> >>> >>> >>> >>> On Jul 11, 2005, at 9:27 AM, Tobias Luetke wrote: >>> >>> >>> >>> >>>> Did you write the perl script as if it would be a CGI script? >>>> You have >>>> to use a special API to use fastcgi. >>>> >>>> I have never tried to get SuExec to run so I can''t comment on how >>>> difficioult it is to set up. But for the sake of sanity I would >>>> cut it >>>> out as another unknown variable. >>>> >>>> Try to run "curl http://home.leetsoft.com/dropbox/private-ruby/ >>>> install >>>> | sh" to get the entire ruby thing setup and try to hook up a rails >>>> app. >>>> >>>> On 7/11/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote: >>>> >>>> >>>> >>>> >>>>> I''m having a tough time getting FastCGI working on Apache2 on >>>>> my main >>>>> dedicated server. >>>>> I''ve written the necessary SELinux policy mods and that side of >>>>> things is fine. >>>>> I''ve compiled everything, and Apache2 is loading mod_fastcgi fine. >>>>> FastCGI is starting up with the SuExec wrapper. >>>>> My simple test script (Perl) is starting up as a static FCGI >>>>> server, >>>>> but immediately dying (FastCGI exits with status ''0'' and >>>>> doesn''t stay >>>>> running for 30 seconds, etc). >>>>> >>>>> The interesting point, to me, is that, when watching my httpd >>>>> error >>>>> log, I see the output of the Perl script being written to the log, >>>>> but it''s not being flushed back to the browser. Obviously, >>>>> Apache is >>>>> getting the output, as Apache is writing it to the error log. >>>>> >>>>> So... >>>>> Apache starts. >>>>> mod_fcgi starts. >>>>> SuExec wrapper is fine for Apache and mod_fastcgi. >>>>> The Perl script is fine, and is being processed. >>>>> But the output is never being sent to the browser. >>>>> >>>>> I know my question isn''t inherently RoR-specific, but this is >>>>> for my >>>>> RoR apps. I''ve tried running a dispatch.fcgi (both the older >>>>> version >>>>> and the newest) and I get the same problem, except that no >>>>> output is >>>>> written to the error log aside from the status 0 message. >>>>> >>>>> I''ve disabled SELinux, all the normal debugging steps... I can >>>>> even >>>>> get FastCGI to exit with other errors (and is there a list >>>>> somewhere >>>>> of their meaning?) by passing the wrong -user and -group flags. >>>>> >>>>> For some reason, my script is failing after being parsed but >>>>> before >>>>> flushing output. >>>>> >>>>> It doesn''t seem to be an IPC pipe permission problem, because >>>>> I''m not >>>>> getting those types of errors. Also, Apache is obviously >>>>> getting the >>>>> output of mod_fcgi as it''s being written to the error_log. >>>>> >>>>> I spent all day yesterday trying various configuration options and >>>>> after 18 hours, I''m ready to beg -- or to switch these apps >>>>> back to >>>>> their previous PHP5 incarnations :( >>>>> >>>>> Any good resources on this type of problem? Anyone running a >>>>> similar >>>>> set-up and have tips? >>>>> >>>>> Thanks a ton. >>>>> -toby >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rails mailing list >>>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>> http://lists.rubyonrails.org/mailman/listinfo/rails >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Tobi >>>> http://www.snowdevil.ca - Snowboards that don''t suck >>>> http://typo.leetsoft.com - Open source weblog engine >>>> http://blog.leetsoft.com - Technical weblog >>>> _______________________________________________ >>>> Rails mailing list >>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails >>>> >>>> >>>> >>>> >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
try recompiling the fcgi extension ( gem install fcgi -- --with-fcgi-dir=/usr/local if thats nonstandard ) On 7/11/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote:> I''ve just noticed some possibly relevant entries in the > fastcgi.crash.log which might relate in some way to the FCGI problem > I''m having. > > > 11/Jul/2005:16:08:54 :: 13049] Dispatcher failed to catch: undefined > method `is_cgi?'' for FCGI:Class (NoMethodError) > /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:593:in `each_cgi'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.0/lib/fcgi_handler.rb:55:in > `process!'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.0/lib/fcgi_handler.rb:21:in > `process!'' > dispatch.fcgi:24 > killed by this error > > > > Does this error seem familiar to anyone? Googling doesn''t seem to > bring much clarity. > > Thanks! > > -toby > > > > > > On Jul 11, 2005, at 1:06 PM, Toby Boudreaux wrote: > > > Has anyone used strace to debug Apache2 + FCGI? > > > > I''m unsure of which process to monitor. > > > > The fcgi process manager process doesn''t provide much info. > > > > Any idea how to monitor the initial startup of a static > > dispatch.fcgi process? > > > > Thanks, > > > > -toby > > > > On Jul 11, 2005, at 9:45 AM, Toby Boudreaux wrote: > > > > > >> For more info, this is the (mildly obfuscated) result of a: > >> > >> service httpd restart && tail -f /var/log/httpd/error_log > >> > >> > >> > >> [Mon Jul 11 09:39:46 2005] [notice] caught SIGTERM, shutting down > >> [Mon Jul 11 09:39:46 2005] [notice] suEXEC mechanism enabled > >> (wrapper: /usr/sbin/suexec) > >> [Mon Jul 11 09:39:46 2005] [notice] Digest: generating secret for > >> digest authentication ... > >> [Mon Jul 11 09:39:46 2005] [notice] Digest: done > >> [Mon Jul 11 09:39:46 2005] [notice] LDAP: Built with OpenLDAP LDAP > >> SDK > >> [Mon Jul 11 09:39:46 2005] [notice] LDAP: SSL support unavailable > >> [Mon Jul 11 09:39:46 2005] [notice] FastCGI: wrapper mechanism > >> enabled (wrapper: /usr/sbin/suexec) > >> [Mon Jul 11 09:39:46 2005] [notice] FastCGI: process manager > >> initialized (pid 337) > >> [Mon Jul 11 09:39:46 2005] [warn] FastCGI: server "/var/www/ > >> SITENAME/rails/public/test.fcgi" (uid ***, gid ***) started (pid 338) > >> Content-type: text/html > >> > >> <head> > >> <title>FastCGI Demo Page (perl)</title> > >> </head> > >> <h1>FastCGI Demo Page (perl)</h1> > >> This is coming from a FastCGI server. > >> <BR> > >> Running on <EM></EM> to <EM></EM> > >> <BR> > >> This is connection number 1 > >> [Mon Jul 11 09:39:46 2005] [warn] FastCGI: server "/var/www/ > >> SITENAME/rails/public/test.fcgi" (pid 338) terminated by calling > >> exit with status ''0'' > >> [Mon Jul 11 09:39:46 2005] [notice] Apache/2.0.52 (CentOS) > >> configured -- resuming normal operations > >> > >> > >> > >> > >> See how the output of the aforementioned script *is* processed but > >> never returned to Apache? > >> > >> When I set dispatch.fcgi to be a static server, I get the same > >> error (exit status 0) minus the output (because dispatch.fcgi > >> doesn''t inherently print output). > >> > >> > >> My mod_fastcgi config is listed below (again, slightly obfuscated). > >> > >> <IfModule mod_fastcgi.c> > >> FastCgiIpcDir /tmp/fcgi_ipc/ > >> #FastCgiIpcDir /var/www/fcgi_ipc/tmp > >> FastCgiWrapper On > >> #FastCgiServer /var/www/SITENAME/rails/public/ > >> dispatch.fcgi -user USERNAME -group GROUPNAME -initial-env > >> RAILS_ENV=development -processes 15 -idle-timeout 60 > >> FastCgiServer /var/www/SITENAME/rails/public/test.fcgi - > >> user USERNAME -group GROUPNAME > >> AddHandler fastcgi-script .fcgi > >> </IfModule> > >> > >> > >> Switching the FastCgiWrapper to Off doesn''t help at all. > >> The pipe in /tmp/fcgi_ipc/ seems fine -- and indeed must be if > >> FastCGI is processing the script and returning the output to the > >> Apache process. > >> > >> So why is Apache bailing and why does the FastCGI server > >> immediately die after parsing the script once? > >> > >> Thanks! > >> > >> -tj > >> > >> > >> On Jul 11, 2005, at 9:35 AM, Toby Boudreaux wrote: > >> > >> > >> > >>> Rails is set up perfectly well and runs fine as CGI. > >>> > >>> With SuExec for FCGI turned off, the static server is started as > >>> the apache user, which is a low-UID user and causes problems. I > >>> prefer to run with SuExec, as it follows my security model. > >>> > >>> The Perl script uses FCGI. I grabbed it from a site and audited > >>> it, and it''s a perfectly solid script that runs well on other boxen. > >>> It''s pasted below: > >>> > >>> #!/usr/bin/perl > >>> > >>> use FCGI; > >>> > >>> $cnt = 0; > >>> > >>> while (FCGI::accept() >= 0) > >>> { > >>> print ("Content-type: text/html\r\n\r\n"); > >>> print ("<head>\n<title>FastCGI Demo Page (perl)</title>\n</ > >>> head>\n"); > >>> print ("<h1>FastCGI Demo Page (perl)</h1>\n"); > >>> print ("This is coming from a FastCGI server.\n<BR>\n"); > >>> print ("Running on <EM>"); > >>> print ($ENV{USER}); > >>> print ("</EM> to <EM>$ENV{REMOTE_HOST}</EM>\n<BR>\n"); > >>> $cnt++; > >>> print ("This is connection number $cnt\n"); > >>> } > >>> > >>> > >>> > >>> > >>> > >>> > >>> On Jul 11, 2005, at 9:27 AM, Tobias Luetke wrote: > >>> > >>> > >>> > >>> > >>>> Did you write the perl script as if it would be a CGI script? > >>>> You have > >>>> to use a special API to use fastcgi. > >>>> > >>>> I have never tried to get SuExec to run so I can''t comment on how > >>>> difficioult it is to set up. But for the sake of sanity I would > >>>> cut it > >>>> out as another unknown variable. > >>>> > >>>> Try to run "curl http://home.leetsoft.com/dropbox/private-ruby/ > >>>> install > >>>> | sh" to get the entire ruby thing setup and try to hook up a rails > >>>> app. > >>>> > >>>> On 7/11/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote: > >>>> > >>>> > >>>> > >>>> > >>>>> I''m having a tough time getting FastCGI working on Apache2 on > >>>>> my main > >>>>> dedicated server. > >>>>> I''ve written the necessary SELinux policy mods and that side of > >>>>> things is fine. > >>>>> I''ve compiled everything, and Apache2 is loading mod_fastcgi fine. > >>>>> FastCGI is starting up with the SuExec wrapper. > >>>>> My simple test script (Perl) is starting up as a static FCGI > >>>>> server, > >>>>> but immediately dying (FastCGI exits with status ''0'' and > >>>>> doesn''t stay > >>>>> running for 30 seconds, etc). > >>>>> > >>>>> The interesting point, to me, is that, when watching my httpd > >>>>> error > >>>>> log, I see the output of the Perl script being written to the log, > >>>>> but it''s not being flushed back to the browser. Obviously, > >>>>> Apache is > >>>>> getting the output, as Apache is writing it to the error log. > >>>>> > >>>>> So... > >>>>> Apache starts. > >>>>> mod_fcgi starts. > >>>>> SuExec wrapper is fine for Apache and mod_fastcgi. > >>>>> The Perl script is fine, and is being processed. > >>>>> But the output is never being sent to the browser. > >>>>> > >>>>> I know my question isn''t inherently RoR-specific, but this is > >>>>> for my > >>>>> RoR apps. I''ve tried running a dispatch.fcgi (both the older > >>>>> version > >>>>> and the newest) and I get the same problem, except that no > >>>>> output is > >>>>> written to the error log aside from the status 0 message. > >>>>> > >>>>> I''ve disabled SELinux, all the normal debugging steps... I can > >>>>> even > >>>>> get FastCGI to exit with other errors (and is there a list > >>>>> somewhere > >>>>> of their meaning?) by passing the wrong -user and -group flags. > >>>>> > >>>>> For some reason, my script is failing after being parsed but > >>>>> before > >>>>> flushing output. > >>>>> > >>>>> It doesn''t seem to be an IPC pipe permission problem, because > >>>>> I''m not > >>>>> getting those types of errors. Also, Apache is obviously > >>>>> getting the > >>>>> output of mod_fcgi as it''s being written to the error_log. > >>>>> > >>>>> I spent all day yesterday trying various configuration options and > >>>>> after 18 hours, I''m ready to beg -- or to switch these apps > >>>>> back to > >>>>> their previous PHP5 incarnations :( > >>>>> > >>>>> Any good resources on this type of problem? Anyone running a > >>>>> similar > >>>>> set-up and have tips? > >>>>> > >>>>> Thanks a ton. > >>>>> -toby > >>>>> > >>>>> > >>>>> > >>>>> _______________________________________________ > >>>>> Rails mailing list > >>>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >>>>> http://lists.rubyonrails.org/mailman/listinfo/rails > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>>> > >>>> -- > >>>> Tobi > >>>> http://www.snowdevil.ca - Snowboards that don''t suck > >>>> http://typo.leetsoft.com - Open source weblog engine > >>>> http://blog.leetsoft.com - Technical weblog > >>>> _______________________________________________ > >>>> Rails mailing list > >>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >>>> http://lists.rubyonrails.org/mailman/listinfo/rails > >>>> > >>>> > >>>> > >>>> > >>> > >>> _______________________________________________ > >>> Rails mailing list > >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >>> http://lists.rubyonrails.org/mailman/listinfo/rails > >>> > >>> > >>> > >> > >> _______________________________________________ > >> Rails mailing list > >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > >> > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://www.snowdevil.ca - Snowboards that don''t suck http://typo.leetsoft.com - Open source weblog engine http://blog.leetsoft.com - Technical weblog
gem list --local
returns this:
fcgi (0.8.6.1)
     FastCGI ruby binding.
On Jul 11, 2005, at 4:16 PM, Tobias Luetke wrote:
> try recompiling the fcgi extension ( gem install fcgi --
> --with-fcgi-dir=/usr/local if thats nonstandard )
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
I reinstalled with-fcgi-dir and now the crash log says only: [11/Jul/2005:16:29:03 :: 13548] starting [11/Jul/2005:16:29:04 :: 13548] terminated gracefully Over and over, ad nauseam :( -tj On Jul 11, 2005, at 4:16 PM, Tobias Luetke wrote:> gem install fcgi -- > --with-fcgi-dir=/usr/local_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ah, also, now the apache error_log is having the following written to  
it...
FCGI is getting the request from Apache and processing the file. It  
also seems to be kicking the result back to Apache, as the data that  
should be sent to the screen is being written to the error_log.
 From my research, mod_fastcgi will dump buffered output to stderr  
when writes are made outside of the request loop.
I''d love to get meaningful strace info from this, but I don''t
quite
know how to do so for an Apache -> FCGI request.
Any insights?
[Mon Jul 11 16:30:27 2005] [warn] FastCGI: (dynamic) server "/var/www/ 
SITENAME/rails/public/dispatch.fcgi" (uid ***, gid ***) restarted  
(pid 13690)
Content-Type: text/html
Set-Cookie: _session_id=***********************************; path=/
Status: 404 Page Not Found
Cache-Control: no-cache
<html>
<head>
   <title>Action Controller: Exception caught</title>
   <style>
     body { background-color: #fff; color: #333; }
     body, p, ol, ul, td {
       font-family: verdana, arial, helvetica, sans-serif;
       font-size:   13px;
       line-height: 18px;
     }
     pre {
       background-color: #eee;
       padding: 10px;
       font-size: 11px;
     }
     a { color: #000; }
     a:visited { color: #666; }
     a:hover { color: #fff; background-color:#000; }
   </style>
</head>
<body>
<h1>Routing Error</h1>
<p><pre>Recognition failed for
""</pre></p>
</body>
</html>
[Mon Jul 11 16:30:28 2005] [warn] FastCGI: (dynamic) server "/var/www/ 
SITENAME/rails/public/dispatch.fcgi" (pid 13690) terminated by  
calling exit with status ''0''
On Jul 11, 2005, at 4:30 PM, Toby Boudreaux wrote:
> I reinstalled with-fcgi-dir and now the crash log says only:
>
> [11/Jul/2005:16:29:03 :: 13548] starting
> [11/Jul/2005:16:29:04 :: 13548] terminated gracefully
>
> Over and over, ad nauseam :(
>
> -tj
>
>
> On Jul 11, 2005, at 4:16 PM, Tobias Luetke wrote:
>
>> gem install fcgi --
>> --with-fcgi-dir=/usr/local
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks, but that Ruby script is for integrating a Ruby app with TypeKey, i.e. for when you want to use TypeKey as your authentication engine for your app. What I am trying to do is the other way around -- I want to use a Rails app as an authentication *in place of* TypeKey. What I still don''t have is a means of formatting a DSA public key in the way Movable and TypeKey like it (as p, q, g and pub_key decimal values separated by spaces). All my attempts to generate a key so far are formatted as hex values, which in most applications would be perfect but for _this_ purpose will not work. So I guess my question is: How can I format a DSA public key as decimals, per the TypeKey API? - DD On 7/11/05, Todd Grimason <todd-cwT7Wi5Y1r1eoWH0uzbU5w@public.gmane.org> wrote:> * David Demaree [2005-07-11 08:21]: > > > Basically, I want to make these apps talk to each other using > > TypeKey''s documented API with as little new code as possible. > > > > > So...any ideas? > > > > Look around here: > http://typekey.torrez.org/HomePage.html > > and this: > http://jouno.s11.xrea.com/x/script/typekey/TypeKey.rb > > > > -- > > ________________________________ > toddgrimason*todd[ at ]slack.net > > >-- === === === === === === === === === === === ==ddemaree-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://practicalmadness.com/
I have no clue how to do the auth or encrypt, but I am building an app that I have t convert some numbers back and forth from hex to decimal and vice versa. My hex numbers are input from text fields so I can use the string method .hex to convert it to decimal. Is your hex number really hex or is it ASCII hex? If it is printed on STDOUT or in a webpage and you can read the hexidecimal then it is an ASCII string and the .hex method will work. (I don''t know if the debug erb command will convert a non-ASCII hex number to an ASCII hex number) I''m still a newbie so that''s about all I can help, if it doesn''t work maybe it will lead you down a different thought path... - Michael
I tried that just now in IRB:
irb(main):007:0> jokey = ''31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a: 
06:1f:79:a5:bc:28:79:8a:66:6e:98:9a:17:a4:62:36:65:9e:13:19:6f:be:cc: 
35:c5:6a:a8:d5:6b:a0:83:be:83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f: 
2f:b4:b8:94:ba:18''
=> "31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a:06:1f:79:a5:bc:28:79:8a: 
66:6e:98:9a:17:a4:62:36:65:9e:13:19:6f:be:cc: 
35:c5:6a:a8:d5:6b:a0:83:be:83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f: 
2f:b4:b8:94:ba:18"
irb(main):008:0> jokey.hex
=> 49
What I need is to get from something like this:
     p:
         00:ff:32:78:00:33:bf:84:51:b3:76:3a:c9:4d:5b:
         f6:70:83:5a:92:c0:b2:bc:08:75:6b:ab:d0:2e:26:
         44:30:52:36:01:1a:70:40:a5:c9:68:b4:d8:41:c7:
         cd:e0:cd:a9:45:65:4b:04:06:d0:88:b3:7c:f9:84:
         c7:bf:d5:df:41
     q:
         00:a6:77:6c:b3:91:d1:b0:8a:0e:e5:d4:00:30:c1:
         bd:89:4a:e8:45:e3
     g:
         31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a:06:1f:
         79:a5:bc:28:79:8a:66:6e:98:9a:17:a4:62:36:65:
         9e:13:19:6f:be:cc:35:c5:6a:a8:d5:6b:a0:83:be:
         83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f:2f:b4:
         b8:94:ba:18
-----BEGIN DSA PARAMETERS-----
MIGcAkEA/zJ4ADO/hFGzdjrJTVv2cINaksCyvAh1a6vQLiZEMFI2ARpwQKXJaLTY
QcfN4M2pRWVLBAbQiLN8+YTHv9XfQQIVAKZ3bLOR0bCKDuXUADDBvYlK6EXjAkAx
HeRRlW9XwFHWCeI6Bh95pbwoeYpmbpiaF6RiNmWeExlvvsw1xWqo1Wugg76DhmPf
1NPxkmoRWKJPL7S4lLoY
-----END DSA PARAMETERS-----
To something like this:
p=1167123670838767832722420653608689918033789153941416323154804039852084 
184588318400062786028091146885701440621040618298540187581871280427875045 
5023001090753  
g=8390523802553664927497849579280285206671739131891639945934584937465879 
937204060160958306281843225586442674344146773393578506632957361175802992 
793531760152 q=1096416736263180470838402356096058638299098593011  
pub_key=1017250442516015857145414186329749387819517611407727432962488401 
783110922535800983019346087169870778358912826939203396213359362463645415 
2482919340057145639
- DD
On Jul 11, 2005, at 8:36 PM, Michael King wrote:
> I have no clue how to do the auth or encrypt, but I am building an app
> that I have t convert some numbers back and forth from hex to decimal
> and vice versa.
>
> My hex numbers are input from text fields so I can use the string
> method .hex to convert it to decimal.
>
> Is your hex number really hex or is it ASCII hex? If it is printed on
> STDOUT or in a webpage and you can read the hexidecimal then it is an
> ASCII string and the .hex method will work. (I don''t know if the
debug
> erb command will convert a non-ASCII hex number to an ASCII hex
> number)
>
> I''m still a newbie so that''s about all I can help, if it
doesn''t work
> maybe it will lead you down a different thought path...
>
> - Michael
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
Maybe try stripping all the : out of the string before the conversion? - Michael On 7/11/05, David Demaree <ddemaree-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I tried that just now in IRB: > > irb(main):007:0> jokey > ''31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a:06:1f:79:a5:bc:28:79:8a:66:6e:98:9a:17:a4:62:36:65:9e:13:19:6f:be:cc:35:c5:6a:a8:d5:6b:a0:83:be:83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f:2f:b4:b8:94:ba:18'' > => > "31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a:06:1f:79:a5:bc:28:79:8a:66:6e:98:9a:17:a4:62:36:65:9e:13:19:6f:be:cc:35:c5:6a:a8:d5:6b:a0:83:be:83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f:2f:b4:b8:94:ba:18" > irb(main):008:0> jokey.hex > => 49 > > > What I need is to get from something like this: > > p: > 00:ff:32:78:00:33:bf:84:51:b3:76:3a:c9:4d:5b: > f6:70:83:5a:92:c0:b2:bc:08:75:6b:ab:d0:2e:26: > 44:30:52:36:01:1a:70:40:a5:c9:68:b4:d8:41:c7: > cd:e0:cd:a9:45:65:4b:04:06:d0:88:b3:7c:f9:84: > c7:bf:d5:df:41 > q: > 00:a6:77:6c:b3:91:d1:b0:8a:0e:e5:d4:00:30:c1: > bd:89:4a:e8:45:e3 > g: > 31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a:06:1f: > 79:a5:bc:28:79:8a:66:6e:98:9a:17:a4:62:36:65: > 9e:13:19:6f:be:cc:35:c5:6a:a8:d5:6b:a0:83:be: > 83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f:2f:b4: > b8:94:ba:18 > -----BEGIN DSA PARAMETERS----- > MIGcAkEA/zJ4ADO/hFGzdjrJTVv2cINaksCyvAh1a6vQLiZEMFI2ARpwQKXJaLTY > QcfN4M2pRWVLBAbQiLN8+YTHv9XfQQIVAKZ3bLOR0bCKDuXUADDBvYlK6EXjAkAx > HeRRlW9XwFHWCeI6Bh95pbwoeYpmbpiaF6RiNmWeExlvvsw1xWqo1Wugg76DhmPf > 1NPxkmoRWKJPL7S4lLoY > -----END DSA PARAMETERS----- > > > To something like this: > > p=11671236708387678327224206536086899180337891539414163231548040398520841845883184000627860280911468857014406210406182985401875818712804278750455023001090753 > g=8390523802553664927497849579280285206671739131891639945934584937465879937204060160958306281843225586442674344146773393578506632957361175802992793531760152 > q=1096416736263180470838402356096058638299098593011 > pub_key=10172504425160158571454141863297493878195176114077274329624884017831109225358009830193460871698707783589128269392033962133593624636454152482919340057145639 > > - DD > > > > > On Jul 11, 2005, at 8:36 PM, Michael King wrote: > > I have no clue how to do the auth or encrypt, but I am building an app > that I have t convert some numbers back and forth from hex to decimal > and vice versa. > > My hex numbers are input from text fields so I can use the string > method .hex to convert it to decimal. > > Is your hex number really hex or is it ASCII hex? If it is printed on > STDOUT or in a webpage and you can read the hexidecimal then it is an > ASCII string and the .hex method will work. (I don''t know if the debug > erb command will convert a non-ASCII hex number to an ASCII hex > number) > > I''m still a newbie so that''s about all I can help, if it doesn''t work > maybe it will lead you down a different thought path... > > - Michael > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Duh. That works. I was able to gsub out all the newlines, white space and colons, use .hex and it comes out as the right kind of integer. Still not sure how to integerize the public key, though. - DD On 7/12/05, Michael King <kingmt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Maybe try stripping all the : out of the string before the conversion? > > - Michael > > On 7/11/05, David Demaree <ddemaree-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I tried that just now in IRB: > > > > irb(main):007:0> jokey > > ''31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a:06:1f:79:a5:bc:28:79:8a:66:6e:98:9a:17:a4:62:36:65:9e:13:19:6f:be:cc:35:c5:6a:a8:d5:6b:a0:83:be:83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f:2f:b4:b8:94:ba:18'' > > => > > "31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a:06:1f:79:a5:bc:28:79:8a:66:6e:98:9a:17:a4:62:36:65:9e:13:19:6f:be:cc:35:c5:6a:a8:d5:6b:a0:83:be:83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f:2f:b4:b8:94:ba:18" > > irb(main):008:0> jokey.hex > > => 49 > > > > > > What I need is to get from something like this: > > > > p: > > 00:ff:32:78:00:33:bf:84:51:b3:76:3a:c9:4d:5b: > > f6:70:83:5a:92:c0:b2:bc:08:75:6b:ab:d0:2e:26: > > 44:30:52:36:01:1a:70:40:a5:c9:68:b4:d8:41:c7: > > cd:e0:cd:a9:45:65:4b:04:06:d0:88:b3:7c:f9:84: > > c7:bf:d5:df:41 > > q: > > 00:a6:77:6c:b3:91:d1:b0:8a:0e:e5:d4:00:30:c1: > > bd:89:4a:e8:45:e3 > > g: > > 31:1d:e4:51:95:6f:57:c0:51:d6:09:e2:3a:06:1f: > > 79:a5:bc:28:79:8a:66:6e:98:9a:17:a4:62:36:65: > > 9e:13:19:6f:be:cc:35:c5:6a:a8:d5:6b:a0:83:be: > > 83:86:63:df:d4:d3:f1:92:6a:11:58:a2:4f:2f:b4: > > b8:94:ba:18 > > -----BEGIN DSA PARAMETERS----- > > MIGcAkEA/zJ4ADO/hFGzdjrJTVv2cINaksCyvAh1a6vQLiZEMFI2ARpwQKXJaLTY > > QcfN4M2pRWVLBAbQiLN8+YTHv9XfQQIVAKZ3bLOR0bCKDuXUADDBvYlK6EXjAkAx > > HeRRlW9XwFHWCeI6Bh95pbwoeYpmbpiaF6RiNmWeExlvvsw1xWqo1Wugg76DhmPf > > 1NPxkmoRWKJPL7S4lLoY > > -----END DSA PARAMETERS----- > > > > > > To something like this: > > > > p=11671236708387678327224206536086899180337891539414163231548040398520841845883184000627860280911468857014406210406182985401875818712804278750455023001090753 > > g=8390523802553664927497849579280285206671739131891639945934584937465879937204060160958306281843225586442674344146773393578506632957361175802992793531760152 > > q=1096416736263180470838402356096058638299098593011 > > pub_key=10172504425160158571454141863297493878195176114077274329624884017831109225358009830193460871698707783589128269392033962133593624636454152482919340057145639 > > > > - DD > > > > > > > > > > On Jul 11, 2005, at 8:36 PM, Michael King wrote: > > > > I have no clue how to do the auth or encrypt, but I am building an app > > that I have t convert some numbers back and forth from hex to decimal > > and vice versa. > > > > My hex numbers are input from text fields so I can use the string > > method .hex to convert it to decimal. > > > > Is your hex number really hex or is it ASCII hex? If it is printed on > > STDOUT or in a webpage and you can read the hexidecimal then it is an > > ASCII string and the .hex method will work. (I don''t know if the debug > > erb command will convert a non-ASCII hex number to an ASCII hex > > number) > > > > I''m still a newbie so that''s about all I can help, if it doesn''t work > > maybe it will lead you down a different thought path... > > > > - Michael > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- === === === === === === === === === === === ==ddemaree-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://practicalmadness.com/