Seems like the latest Ruby LSAPI is not parsing the QUERY_STRING (incorrectly) and PATH_INFO (missing) environment variables. Can this be a bug?
Here is a test URL that shows the output of the LSAPI example:
http://208.78.98.75/asd/ert/?test=right&sdf=324
Notice how QUERY_STRING is empty and PATH_INFO is missing.
Here is some information about my SliceHost server:
# cat conf/lsws.xml
#cat /etc/issue
Ubuntu 6.06.1 LTS \n \l
#uname -a
Linux dev 2.6.16.29-xen #3 SMP Sun Oct 15 13:15:34 BST 2006 x86_64 GNU/Linux
lshttpd.3.1.1 <<<Standard>>>
# ps waux|grep www-data
www-data 12331 0.0 0.4 4580 1160 ? S 22:58 0:00 lshttpd
www-data 12332 0.5 2.8 28828 7556 ? SNs 22:58 0:00 /usr/local/bin/ruby /home/aem/igor/dist/l3.rb
# ruby -v
ruby 1.8.4 (2005-12-24) [x86_64-linux]
# gem list --local|grep lsapi
ruby-lsapi (2.5)
# cat dist/l3.rb
Hope this helps,
AEM
Here is a test URL that shows the output of the LSAPI example:
http://208.78.98.75/asd/ert/?test=right&sdf=324
Notice how QUERY_STRING is empty and PATH_INFO is missing.
Here is some information about my SliceHost server:
# cat conf/lsws.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<virtualHostConfig>
<docRoot>/home/aem/igor/public/</docRoot>
<adminEmails>adim@prefabmarkets.com</adminEmails>
<enableGzip>1</enableGzip>
<enableIpGeo>0</enableIpGeo>
<logging>
<log>
<useServer>0</useServer>
<fileName>$VH_ROOT/logs/lsws.error.log</fileName>
<logLevel>ERROR</logLevel>
<rollingSize>20M</rollingSize>
</log>
<accessLog>
<useServer>0</useServer>
<fileName>$VH_ROOT/logs/lsws.access.log</fileName>
<pipedLogger></pipedLogger>
<logFormat></logFormat>
<logHeaders>7</logHeaders>
<rollingSize>50M</rollingSize>
<keepDays>90</keepDays>
<bytesLog>$VH_ROOT/logs/lsws.bytes.log</bytesLog>
<compressArchive>1</compressArchive>
</accessLog>
</logging>
<index>
<useServer>1</useServer>
<indexFiles>index.html</indexFiles>
<autoIndex>0</autoIndex>
<autoIndexURI></autoIndexURI>
</index>
<customErrorPages>
<errorPage>
<errCode>404</errCode>
<url>/dispatch.lsapi</url>
<note></note>
</errorPage>
</customErrorPages>
<htAccess>
<allowOverride>0</allowOverride>
<accessFileName>.htaccess</accessFileName>
</htAccess>
<extProcessorList>
<extProcessor>
<type>lsapi</type>
<name>IgorLSAPI</name>
<address>uds://tmp/lshttpd/igor_lsapi.sock</address>
<note></note>
<maxConns>10</maxConns>
<env>IGOR_ENV=production</env>
<env>LSAPI_CHILDREN=10</env>
<initTimeout>30</initTimeout>
<retryTimeout>45</retryTimeout>
<persistConn>1</persistConn>
<pcKeepAliveTimeout></pcKeepAliveTimeout>
<respBuffer>0</respBuffer>
<autoStart>1</autoStart>
<path>/home/aem/igor/dist/l3.rb</path>
<backlog></backlog>
<instances></instances>
<runOnStartUp>1</runOnStartUp>
<extMaxIdleTime></extMaxIdleTime>
<priority></priority>
<memSoftLimit></memSoftLimit>
<memHardLimit></memHardLimit>
<procSoftLimit></procSoftLimit>
<procHardLimit></procHardLimit>
</extProcessor>
</extProcessorList>
<contextList>
<context>
<type>lsapi</type>
<uri>/dispatch.lsapi</uri>
<handler>IgorLSAPI</handler>
<note></note>
<extraHeaders></extraHeaders>
<allowOverride>0</allowOverride>
<realm></realm>
<authName></authName>
<required></required>
<accessControl>
<allow></allow>
<deny></deny>
</accessControl>
<authorizer></authorizer>
<addDefaultCharset>off</addDefaultCharset>
<defaultCharsetCustomized></defaultCharsetCustomized>
<enableIpGeo></enableIpGeo>
</context>
</contextList>
</virtualHostConfig>
Ubuntu 6.06.1 LTS \n \l
#uname -a
Linux dev 2.6.16.29-xen #3 SMP Sun Oct 15 13:15:34 BST 2006 x86_64 GNU/Linux
lshttpd.3.1.1 <<<Standard>>>
# ps waux|grep www-data
www-data 12331 0.0 0.4 4580 1160 ? S 22:58 0:00 lshttpd
www-data 12332 0.5 2.8 28828 7556 ? SNs 22:58 0:00 /usr/local/bin/ruby /home/aem/igor/dist/l3.rb
# ruby -v
ruby 1.8.4 (2005-12-24) [x86_64-linux]
# gem list --local|grep lsapi
ruby-lsapi (2.5)
# cat dist/l3.rb
Code:
#!/usr/local/bin/ruby
require 'rubygems'
require 'lsapi'
$count = 0;
while LSAPI.accept != nil
print "HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\nHello World! \##{$count}<br>\r\n"
ENV.each_pair {|key, value| print "#{key} is #{value}<br>\r\n" }
$count = $count + 1
end
AEM
Last edited: