<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=AWStats%3A_Squid_Log_Analyzer</id>
	<title>AWStats: Squid Log Analyzer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=AWStats%3A_Squid_Log_Analyzer"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=AWStats:_Squid_Log_Analyzer&amp;action=history"/>
	<updated>2026-04-19T20:23:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=AWStats:_Squid_Log_Analyzer&amp;diff=49025&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot;sumber: http://www.bxpsoftware.com/wixi/index.php?title=Configuring_Squid_proxy_cache_with_AWStats_on_Windows  Configuring Squid proxy cache with AWStats on Windows Contents...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=AWStats:_Squid_Log_Analyzer&amp;diff=49025&amp;oldid=prev"/>
		<updated>2017-06-29T10:55:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;sumber: http://www.bxpsoftware.com/wixi/index.php?title=Configuring_Squid_proxy_cache_with_AWStats_on_Windows  Configuring Squid proxy cache with AWStats on Windows Contents...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;sumber: http://www.bxpsoftware.com/wixi/index.php?title=Configuring_Squid_proxy_cache_with_AWStats_on_Windows&lt;br /&gt;
&lt;br /&gt;
Configuring Squid proxy cache with AWStats on Windows&lt;br /&gt;
Contents&lt;br /&gt;
&lt;br /&gt;
    1 Overview&lt;br /&gt;
    2 To configure your machine to use the proxy&lt;br /&gt;
    3 To use the reporting tool (after its all set up)&lt;br /&gt;
    4 Security&lt;br /&gt;
    5 The setup: Server installation&lt;br /&gt;
        5.1 Download and install ActivePerl&lt;br /&gt;
        5.2 Notepad++&lt;br /&gt;
        5.3 Download and install Squid&lt;br /&gt;
        5.4 Configuration changes to squid&lt;br /&gt;
            5.4.1 Log files&lt;br /&gt;
            5.4.2 Logging format&lt;br /&gt;
        5.5 Get perl working in IIS&lt;br /&gt;
        5.6 Download and set up an AWSTATs server&lt;br /&gt;
        5.7 Configure AWStats&lt;br /&gt;
        5.8 Give AWStats something to chomp on&lt;br /&gt;
        5.9 Maintenance&lt;br /&gt;
            5.9.1 Log file size&lt;br /&gt;
            5.9.2 Update history size&lt;br /&gt;
            5.9.3 Setting the schedule&lt;br /&gt;
    6 Appendix A : All urls used in research&lt;br /&gt;
    7 Appendix B : Commands from article&lt;br /&gt;
&lt;br /&gt;
1 Overview&lt;br /&gt;
&lt;br /&gt;
This article serves as a step by step overview and reminder for how we established a squid proxy cache on our Windows network, along with AWStats for the security department to be able to audit and review our Internet traffic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2 To configure your machine to use the proxy&lt;br /&gt;
&lt;br /&gt;
On a Windows 10 machine.&lt;br /&gt;
&lt;br /&gt;
    Windows in the bottom left of the screen &amp;gt; choose “Settings” &amp;gt; “Network &amp;amp; Internet” &amp;gt; “Proxy”&lt;br /&gt;
    Use a proxy server : On&lt;br /&gt;
    Address : 192.168.0.254&lt;br /&gt;
    Port : 3128&lt;br /&gt;
    Don’t use the proxy server for local (intranet) addresses : Tick the box&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the future if you don’t use the proxy your machine won’t get out to the internet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3 To use the reporting tool (after its all set up)&lt;br /&gt;
&lt;br /&gt;
You must be inside the network!&lt;br /&gt;
&lt;br /&gt;
http://192.168.0.254/awstats.pl?config=allnone.ie&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the top is an “update now” button. Click that to update the logs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4 Security&lt;br /&gt;
&lt;br /&gt;
There is a very basic authentication service possible on the proxy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C:\Squid\etc\passwd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That is a file that can be opened in notepad.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You add one line per user&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use the following tool to generate the line that goes into the file&lt;br /&gt;
&lt;br /&gt;
http://www.htaccesstools.com/htpasswd-generator-windows/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the future we’ll want to link it to AD, but this involves samba / ldap / and other stuff a bridge too far for right now.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add users with test passwords all you want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once everyone is going through the proxy, you then put rules in place on the firewall to block access externally, which means you have to go through the proxy to get out.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5 The setup: Server installation&lt;br /&gt;
5.1 Download and install ActivePerl&lt;br /&gt;
&lt;br /&gt;
Usually goes into C:\Perl64\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure perl works from the command prompt (i.e. it got added to the environment path)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.2 Notepad++&lt;br /&gt;
&lt;br /&gt;
If notepad++ isn’t on the machine install that as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change the defaults for .conf, .txt, .log to go to. Saves loads of hassle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.3 Download and install Squid&lt;br /&gt;
&lt;br /&gt;
Just follow the default procedures available and take note of&lt;br /&gt;
&lt;br /&gt;
    Install directory&lt;br /&gt;
    Basic config changes&lt;br /&gt;
        http_port&lt;br /&gt;
        dns_nameservers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Allow ports and ensure DNS servers are accessible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.4 Configuration changes to squid&lt;br /&gt;
5.4.1 Log files&lt;br /&gt;
&lt;br /&gt;
Add to the squid.conf file the following lines&lt;br /&gt;
&lt;br /&gt;
    access_log C:\Squid\var\log\squid\access.log combined&lt;br /&gt;
    cache_log d:\Squid\log\cache.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That means squid logs in the directories specified. Great for saving your poor space starved C: drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.4.2 Logging format&lt;br /&gt;
&lt;br /&gt;
Add the line&lt;br /&gt;
&lt;br /&gt;
    logformat combined %&amp;gt;a %ui %un [%{%d/%b/%Y:%H:%M:%S +0000}tl] &amp;quot;%rm %ru HTTP/%rv&amp;quot; %Hs %&amp;lt;st &amp;quot;%{Referer}&amp;gt;h&amp;quot; &amp;quot;%{User-Agent}&amp;gt;h&amp;quot; %Ss:%Sh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That gives a format that AWStats can read&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.5 Get perl working in IIS&lt;br /&gt;
&lt;br /&gt;
This allows perl scripts to be run through IIS&lt;br /&gt;
&lt;br /&gt;
http://www.howtogeek.com/50479/how-to-install-perl-on-iis-7-for-windows-server-2008/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You end up with the commands being slightly off, so this can help&lt;br /&gt;
&lt;br /&gt;
https://forums.iis.net/t/1171475.aspx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This got it sorted for me&lt;br /&gt;
&lt;br /&gt;
https://community.activestate.com/forum/activeperl-iis-75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.6 Download and set up an AWSTATs server&lt;br /&gt;
&lt;br /&gt;
The primary config approach. Be very careful… all domains are case sensitive though not observed in the supplied commands. Stick everything in lower case always&lt;br /&gt;
&lt;br /&gt;
http://blogs.iis.net/steveschofield/getting-awstats-installed-and-configured-on-iis-7-5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After this you need to also copy in the cgi-bin folders (lang lib and plugin really need to not be in that sub dir)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note test.pl is from the testing Perl In IIS from the previous setup article and could be removed.&lt;br /&gt;
&lt;br /&gt;
http://www.howtogeek.com/50526/setting-up-awstats-on-windows-server-and-iis/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Doesn’t give much bar the really useful line of how to start the thing&lt;br /&gt;
&lt;br /&gt;
http://localhost/awstats/awstats.pl?config=domain.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.7 Configure AWStats&lt;br /&gt;
&lt;br /&gt;
Location C:\inetpub\stats.allnone.ie and the file awstats.allnone.ie.conf which is created from the model example one provided.&lt;br /&gt;
&lt;br /&gt;
    LogFile=&amp;quot;D:\Squid\log\access.log&amp;quot;&lt;br /&gt;
    LogType=W&lt;br /&gt;
    LogFormat=1&lt;br /&gt;
    SiteDomain=&amp;quot;stats.allnone.ie&amp;quot;&lt;br /&gt;
    HostAliases=&amp;quot;localhost 127.0.0.1 REGEX[stats.allnone\.ie$]&amp;quot;&lt;br /&gt;
    DNSLookup=2&lt;br /&gt;
    DirData=&amp;quot;C:\inetpub\stats.allnone.ie\stats\Domain1&amp;quot;&lt;br /&gt;
    DirCgi=&amp;quot;C:\inetpub\stats.allnone.ie\&amp;quot;&lt;br /&gt;
    AllowToUpdateStatsFromBrowser=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is security to limit access to the report, but we’re not to that point yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.8 Give AWStats something to chomp on&lt;br /&gt;
&lt;br /&gt;
So to generate the file…. Create a batch file&lt;br /&gt;
&lt;br /&gt;
    C:\Perl64\bin\perl.exe C:\inetpub\stats.allnone.ie\awstats.pl -config=allnone.ie&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That should create a awstats042016.allnone.ie.txt file in the C:\inetpub\stats.allnone.ie\stats\Domain1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That process creates a raw initial comprehensive single file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update from within the browser will “add to the history”. So to keep the report file smaller… we use this batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.9 Maintenance&lt;br /&gt;
5.9.1 Log file size&lt;br /&gt;
&lt;br /&gt;
The log files are going to get rather big, so we need to rotate them with a simple dos command in a batch file nightly.&lt;br /&gt;
&lt;br /&gt;
    squid -k rotate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.9.2 Update history size&lt;br /&gt;
&lt;br /&gt;
As mentioned in the previous step. A simple recreate of the file nightly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5.9.3 Setting the schedule&lt;br /&gt;
&lt;br /&gt;
The batch files are in D:\Maintenance. Both to run nightly just before midnight. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Referensi==&lt;br /&gt;
&lt;br /&gt;
* http://www.bxpsoftware.com/wixi/index.php?title=Configuring_Squid_proxy_cache_with_AWStats_on_Windows&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>