PDA

View Full Version : fcgi auth


ginoitalo
04-19-2005, 01:58 PM
I have setup a fcgi authorizer like so,
it's listening on the same box as the webserver on port 3456

<extProcessor>
<type>fcgiauth</type>
<name>Chuck_Auth</name>
<address>127.0.0.1:3456</address>
<maxConns>2000</maxConns>
<respBuffer>0</respBuffer>
<backlog>50</backlog>
<instances>1000</instances>
</extProcessor>

The problem is that I can't seem to get the http basic auth popup to display when browsing the website. (the rest of the install and setup is right out of the box)

The perl script works on apache and zeus so I believe it's just a matter of incorrect server configuration on my part.

mistwang
04-19-2005, 02:24 PM
You have done half of the configurations for fcgi authorizer, still need to put the authorizer in use by selecting the defined fcgi authorizer under the context that need to be protected.
Value of "maxConns" and "instances" looks too high, unless you have a very slow authorizer and a busy web site, "20" is more than enough for most cases.

ginoitalo
04-19-2005, 03:24 PM
alright, now the webserver returns "No input file specified." to the browser with the fastcgi auth on.

what "file" is it talking about ?


FCGI Context Definition

URI /
Fast CGI App &#91;Server Level&#93;&#58; phpFcgi
Allow Override N/A
Realm N/A
Authentication Name auth_name
Required N/A
Access Allowed N/A
Access Denied N/A
Authorizer &#91;Server Level&#93;&#58; Chuck_Auth
Add Default Charset Off
Customized Default Charset N/A




Log:

2005-04-19 18&#58;21&#58;12.578 &#91;DEBUG&#93; &#91;*&#58;7777&#93; New connection from 192.168.2.79&#58;1407.
2005-04-19 18&#58;21&#58;12.578 &#91;DEBUG&#93; &#91;*&#58;7777&#93; 1 connections accepted!
2005-04-19 18&#58;21&#58;12.613 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0&#93; HttpIOLink&#58;&#58;handleEvents&#40;&#41; events=1!
2005-04-19 18&#58;21&#58;12.613 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0&#93; HttpConnection&#58;&#58;onReadEx&#40;&#41;, state&#58; 0!
2005-04-19 18&#58;21&#58;12.613 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0&#93; readToHeaderBuf&#40;&#41;.
2005-04-19 18&#58;21&#58;12.614 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0&#93; Read from client&#58; 318
2005-04-19 18&#58;21&#58;12.615 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0&#93; processHeader&#40;&#41; return 0, header state&#58; 3.
2005-04-19 18&#58;21&#58;12.615 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#93; New request&#58;
Method=&#91;GET&#93;, URI=&#91;/default.html&#93;,
QueryString=&#91;&#93;
Content Length=0
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#93; processContextPath&#40;&#41; return 0
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#93; run fcgi processor.
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;uds&#58;//tmp/lshttpd/php.sock&#93; connection available!
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;uds&#58;//tmp/lshttpd/php.sock&#93; request &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; is assigned with connection!
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;doWrite&#40;&#41;
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;beginRequest&#40;&#41;
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;pendingWrite&#40;&#41;,m_iCurStreamHeader= 16
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; request header is done
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;beginReqBody&#40;&#41;
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;pendingEndStream&#40;&#41;
2005-04-19 18&#58;21&#58;12.616 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; ExtConn&#58;&#58;continueRead&#40;&#41;
2005-04-19 18&#58;21&#58;12.617 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; Request body done!
2005-04-19 18&#58;21&#58;12.617 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;endOfReqBody&#40;&#41;
2005-04-19 18&#58;21&#58;12.617 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;pendingEndStream&#40;&#41;
2005-04-19 18&#58;21&#58;12.617 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;flush&#40;&#41;
2005-04-19 18&#58;21&#58;12.619 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;suspendWrite&#40;&#41;
2005-04-19 18&#58;21&#58;12.619 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; processNewReq&#40;&#41; return 0.
2005-04-19 18&#58;21&#58;12.620 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; readToHeaderBuf&#40;&#41; return 0.
2005-04-19 18&#58;21&#58;12.620 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; ExtConn&#58;&#58;onRead&#40;&#41;
2005-04-19 18&#58;21&#58;12.621 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;doRead&#40;&#41;
2005-04-19 18&#58;21&#58;12.621 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; read 128 bytes from Fast CGI.
2005-04-19 18&#58;21&#58;12.622 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FCGI Header&#58; 01060001005b0500
2005-04-19 18&#58;21&#58;12.622 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; process STDOUT 91 bytes
2005-04-19 18&#58;21&#58;12.623 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; response header finished!
2005-04-19 18&#58;21&#58;12.623 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FCGI Header&#58; 0106000100000000
2005-04-19 18&#58;21&#58;12.624 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; FCGI Header&#58; 0103000100080000
2005-04-19 18&#58;21&#58;12.624 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; &#91;EXT&#93; EndResponse&#40; endCode=0, protocolStatus=0 &#41;
2005-04-19 18&#58;21&#58;12.624 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; release ExtProcessor!
2005-04-19 18&#58;21&#58;12.625 &#91;DEBUG&#93; &#91;uds&#58;//tmp/lshttpd/php.sock&#93; add recycled connection to connection pool!
2005-04-19 18&#58;21&#58;12.625 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; call pConn->writeRespBody&#40;&#41; to write 25 bytes
2005-04-19 18&#58;21&#58;12.625 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; Written to client&#58; 212
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; pConn->writeRespBody&#40;&#41; return 25
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; ReqBody&#58; 0, RespBody&#58; 25, HEC_COMPLETE!
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; m_pHandler->onWrite&#40;&#41; return 0
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; HttpConnection&#58;&#58;flush&#40;&#41;!
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; HttpConnection&#58;&#58;nextRequest&#40;&#41;!
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; HttpExtConnector&#58;&#58;cleanUp&#40;&#41; ...
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; Non-KeepAlive, CLOSING!
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; HttpIOLink&#58;&#58;continueWrite&#40;&#41;...
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; write resumed!
2005-04-19 18&#58;21&#58;12.626 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; HttpIOLink&#58;&#58;handleEvents&#40;&#41; events=4!
2005-04-19 18&#58;21&#58;12.627 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; Shutting down out-bound socket ...
2005-04-19 18&#58;21&#58;12.635 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; HttpIOLink&#58;&#58;handleEvents&#40;&#41; events=1!
2005-04-19 18&#58;21&#58;12.636 &#91;DEBUG&#93; &#91;192.168.2.79&#58;1407-0#v_hosting&#58;fcgi&#93; Close socket ...


I noticed from my fcgi logs that my authorizer never gets called.

mistwang
04-19-2005, 03:36 PM
I think you should use a "static" context instead of a "fcgi" context for "/".

ginoitalo
04-19-2005, 03:44 PM
Do you mean the URI context "/" ?
I tried "/www/chuck.cvstest2.com/safe/" and then the page was served as if there was no fastcgi auth at all.

If that's not what you meant, please explain what you mean by a ' a "static" context '


Thanks again for your time

mistwang
04-19-2005, 05:17 PM
Please try http://www.litespeedtech.com/packages/2.0/lsws-2.1RC1-std-i386-linux.tar.gz
should be fixed.

ginoitalo
04-19-2005, 08:16 PM
All our servers are running FreeBSD

Is there a release candidate for BSD ?

mistwang
04-19-2005, 08:59 PM
Yes, uploaded, just replace linux with freebsd in the URL.

ginoitalo
04-20-2005, 09:26 AM
webserver keeps restarting ....



2005-04-20 12&#58;19&#58;41.242 &#91;DEBUG&#93; &#91;*&#58;7777&#93; 1 connections accepted!
2005-04-20 12&#58;19&#58;41.243 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; ExtConn&#58;&#58;onWrite&#40;&#41;
2005-04-20 12&#58;19&#58;41.243 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; connected to &#91;127.0.0.1&#58;3460&#93;!
2005-04-20 12&#58;19&#58;41.243 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;doWrite&#40;&#41;
2005-04-20 12&#58;19&#58;41.243 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;beginRequest&#40;&#41;
2005-04-20 12&#58;19&#58;41.243 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;pendingWrite&#40;&#41;,m_iCurStreamHeader= 16
2005-04-20 12&#58;19&#58;41.243 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; request header is done
2005-04-20 12&#58;19&#58;41.244 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;beginReqBody&#40;&#41;
2005-04-20 12&#58;19&#58;41.244 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;pendingEndStream&#40;&#41;
2005-04-20 12&#58;19&#58;41.244 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; ExtConn&#58;&#58;continueRead&#40;&#41;
2005-04-20 12&#58;19&#58;41.244 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; Request body done!
2005-04-20 12&#58;19&#58;41.245 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;endOfReqBody&#40;&#41;
2005-04-20 12&#58;19&#58;41.245 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;pendingEndStream&#40;&#41;
2005-04-20 12&#58;19&#58;41.245 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;flush&#40;&#41;
2005-04-20 12&#58;19&#58;41.252 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;suspendWrite&#40;&#41;
2005-04-20 12&#58;19&#58;41.295 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; ExtConn&#58;&#58;onRead&#40;&#41;
2005-04-20 12&#58;19&#58;41.295 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;doRead&#40;&#41;
2005-04-20 12&#58;19&#58;41.295 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; read 192 bytes from Fast CGI.
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FCGI Header&#58; 01060001009d0300
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; process STDOUT 157 bytes
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; response header finished!
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; abort request...
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FcgiConnection&#58;&#58;abort&#40;&#41;
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FCGI Header&#58; 0106000100000000
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; FCGI Header&#58; 0103000100080000
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; &#91;EXT&#93; EndResponse&#40; endCode=0, protocolStatus=0 &#41;
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; release ExtProcessor!
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;127.0.0.1&#58;3460&#93; add recycled connection to connection pool!
2005-04-20 12&#58;19&#58;41.296 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; HttpExtConnector&#58;&#58;cleanUp&#40;&#41; ...
2005-04-20 12&#58;19&#58;41.297 &#91;DEBUG&#93; &#91;192.168.2.79&#58;2152-0#v_hosting&#58;fcgi&#93; processContextPath&#40;&#41; return 0
2005-04-20 12&#58;19&#58;41.299 &#91;NOTICE&#93; &#91;AutoRestarter&#93; child process with pid=16419 received signal=11, no core file is created!
2005-04-20 12&#58;19&#58;41.347 &#91;NOTICE&#93; &#91;AutoRestarter&#93; cleanup children processes and unix sockets belong to process 16419 !
2005-04-20 12&#58;19&#58;41.452 &#91;DEBUG&#93; &#91;AutoRestarter&#93; prepare to fork new child process to handle request!
2005-04-20 12&#58;19&#58;41.454 &#91;NOTICE&#93; &#91;AutoRestarter&#93; new child process with pid=16425 is forked!
2005-04-20 12&#58;19&#58;41.454 &#91;DEBUG&#93; try to give up super user privilege!
2005-04-20 12&#58;19&#58;41.455 &#91;NOTICE&#93; &#91;child&#58; 16425&#93; Successfully change current user to www
2005-04-20 12&#58;19&#58;41.455 &#91;NOTICE&#93; &#91;Child&#58; 16425&#93; Setup swapping space...
2005-04-20 12&#58;19&#58;41.463 &#91;NOTICE&#93; &#91;Child&#58; 16425&#93; LiteSpeed/2.1RC1 Standard starts successfully!

mistwang
04-20-2005, 10:40 AM
Looks like authorization of fcgi authroizer has been passed.
Do you get core dump if there is no authorizer configured? What is in the response of the authorizer?

Is context for URI "/" a static context with location set to the document root of that virtual host?

If you know how to let a setuid process dump a core on FreeBSD, (kernel configuration?), please send us the core file for analysis.

Thanks.
George

ginoitalo
04-20-2005, 06:11 PM
I'm working on getting the other answers to you,
here's what I've gathered so far:

on success the Perl FCGI responds like so:
print(STDOUT "Set-Cookie: $c\n");
print(STDOUT "Status: 200 Authorised\n");
print(STDOUT "Variable-AUTH_USER_NAME: $user\n");
print(STDOUT "\n\n");


context URI: exp:safe
last I tried "/" wasn't working but I'll try again.

A hint on how to make the core file for you would be great.

mistwang
04-20-2005, 09:25 PM
Thanks, I will write a similar test case.

Please run the following command to let setuid program to dump a core
# sysctl -w kern.sugid_coredump=1

Core file should be under /tmp/lshttpd