<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Fun with ones and zeros - awstats</title>
<subtitle>Barry&#039;s notes on computer software and hardware</subtitle>
<link href="/blog/tags/awstats"></link>
<updated>2026-06-13T08:50:18-07:00</updated>
<id>urn:uuid:04ca916d-241e-7a7e-3f2c-95d807ea1a9a</id>
<entry>
<title>AWStats under Nginx and SCGI</title>
<link href="/blog/entries/awstats-under-nginx-and-scgi"></link>
<id>urn:uuid:17c6cd77-c49f-74d7-5b49-94439fda5615</id>
<updated>2011-09-14T06:00:00-07:00</updated>
<author><name>Barry Pederson</name>
<email>bp@barryp.org</email>
</author>
<content type="html">&lt;body&gt;&lt;p&gt;Earlier, I wrote about running &lt;a href=&quot;/blog/entries/cgi-scripts-nginx-using-scgi&quot;&gt;CGI Scripts with Nginx using SCGI&lt;/a&gt;
with the help of a small C shim.  One particular CGI app I&#039;ve had to
alter slightly to work under this setup is &lt;a href=&quot;https://awstats.sourceforge.io/&quot;&gt;AWStats&lt;/a&gt;, which
is a decent-sized Perl app, but only requires one line added to satisfy
SCGI&#039;s requirement of a &lt;code&gt;Status&lt;/code&gt; line at the beginning of a response.&lt;/p&gt;
&lt;p&gt;Here&#039;s a patch to AWStats 7.0&lt;/p&gt;
&lt;div class=&quot;source&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&quot;gd&quot;&gt;--- awstats.pl.original 2011-09-11 21:20:40.954555528 -0500&lt;/span&gt;
&lt;span class=&quot;gi&quot;&gt;+++ awstats.pl  2011-03-31 00:19:35.867343845 -0500&lt;/span&gt;
&lt;span class=&quot;gu&quot;&gt;@@ -750,6 +750,7 @@&lt;/span&gt;
 #------------------------------------------------------------------------------
 sub http_head {
        if ( !$HeaderHTTPSent ) {
&lt;span class=&quot;gi&quot;&gt;+                print &quot;Status: 200 OK\n&quot;;&lt;/span&gt;
                my $newpagecode = $PageCode ? $PageCode : &quot;utf-8&quot;;
                if ( $BuildReportFormat eq &#039;xhtml&#039; || $BuildReportFormat eq &#039;xml&#039; ) {
                        print( $ENV{&#039;HTTP_USER_AGENT&#039;} =~ /MSIE|Googlebot/i
&lt;/pre&gt;&lt;/div&gt;&lt;/body&gt;</content>
</entry>
</feed>