Tutorial: How to Install SquidAnalyzer 6.5 on pfSense 2.4



  • This tutorial will show how to install the correct FreeBSD 11 SquidAnalyzer package on pfSense 2.4

    This tutorial assumes:

    • Squid is already installed, configured, and running.

    • Squid logs are enabled and the default location is used

    /var/squid/logs
    
    • User has access to the shell.

    1. In the shell enter```
    pkg add http://pkg.freebsd.org/freebsd:11:x86:64/latest/All/squidanalyzer-6.5.txz

    
    **2.** You will receive a confirmation of the install.
    
    

    Message from squidanalyzer-6.5:

    1. Modify your httpd.conf to allow access to HTML output like follow:
            Alias /squidreport /usr/local/www/squidreport
            <directory usr="" local="" www="" squidreport="">Options -Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order deny,allow
                Deny from all
                Allow from 127.0.0.1</directory>
    2. If necessary, give additional host access to SquidAnalyzer in httpd.conf.
      Restart and ensure that httpd is running.
    3. Browse to http://my.host.dom/squidreport/ to ensure that things are working
      properly.
    4. Setup a cronjob to run squid-analyzer daily:

    # SquidAnalyzer log reporting daily
        0 2 * * * /usr/local/bin/squid-analyzer > /dev/null 2>&1

    or run it manually.
    For more information, see /usr/local/share/doc/squidanalyzer/README file.

    
    *****NOTE***** THERE IS NO HTTPD.CONF - Instead there is squidanalyzer.conf
                          A DIFFERENT CRON COMMAND WILL BE USED
    
    The squidanalyzer.conf file is in usr/local/etc/squidreport/
    
    **3.** Edit the squidanalyzer.conf
    
    Change this
    

    Set the path to the Squid, squidGuard and/or ufdbGuard log files

    LogFile /var/log/squid3/access.log

    
    into this
    

    Set the path to the Squid, squidGuard and/or ufdbGuard log files

    LogFile /var/squid/logs/access.log

    
    **4.** Run the command in shell once:```
    cd /usr/local/bin/ && perl squid-analyzer
    

    This command will process Squid's files and may take some time. Allow the command to complete before proceeding to step 5.

    5. Browse to x.x.x.x/squidreport
        The report generated from the command in step 4 should be displayed in the browser.

    6. Set the command from step 4 as a cron job to your desired frequency.



  • I started this while back.

    https://forum.pfsense.org/index.php?topic=87982.90

    Make sure you have 2.4 . as 2.3.4 or something does not work.  Glad to see someone besides me found easy way to install it.. or someone that put in repositorys

    Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
    Current: 2000 MHz, Max: 2667 MHz
    8 CPUs: 2 package(s) x 4 core(s)
    8152 MiB and 600meg 10k drive
    Pfsense


  • Banned

    SquidAnalyzer is in marcello's unofficial repo, whole lot better way to install than this manual messing.

    For 2.4, use

    
    fetch -q -o /usr/local/etc/pkg/repos/Unofficial.conf https://raw.githubusercontent.com/marcelloc/Unofficial-pfSense-packages/master/Unofficial.24.conf
    
    


  • SquidAnalyzer is in marcello's unofficial repo, whole lot better way to install than this manual messing.
    fetch -q -o /usr/local/etc/pkg/repos/Unofficial.conf https://github.com/marcelloc/Unofficial-pfSense-packages/blob/master/Unofficial.24.conf

    Hmm.  The command succeeds without error but there is nothing in the Package Manager when you check it afterwards.


  • Banned

    You need to go to the installed packages tab (or otherwise trigger pkg update).



  • You need to go to the installed packages tab (or otherwise trigger pkg update).

    Already did that and it didn't make any difference but it did give me a clue.  Shelling in and running pkg update manually gave this:

    pkg: Error parsing: '/usr/local/etc/pkg/repos//Unofficial.conf': error while parsing <unknown>: line: 7, column: 0 - 'key must begin with a letter', character: '<'</unknown>

    Edit:  OK, it appears that when you run

    fetch -q -o /usr/local/etc/pkg/repos/Unofficial.conf https://github.com/marcelloc/Unofficial-pfSense-packages/blob/master/Unofficial.24.conf
    

    You are getting the HTML of that particular Github webpage and not the file contents.  My Unofficial.conf was stuffed with bogus HTML.

    When I visited the page and saw the actual 6 lines of code, I made my own config and it's now showing E2Guardian4 as expected.



  • Read my edit.


  • Banned

    Fixed the link.



  • Just about looking close enough to a real package to install now.. If I had knowledge on how I would make official.



  • Thank you everyone for showing me a more concise way. I appreciate the help. Glad to see package moving forward.



  • Followed the instructions here to fetch marcello's unofficial repo and installed squidanalyzer, which went fine. However, report isn't loading. Getting:

    Error: Could not find report index file.
    Check and save Squid Analyzer settings.

    Edit: My settings:
    Squid Log Analyzer > General Settings > Squid Log : /var/squid/logs/access.log
    Services > Proxy Server > General > Enable Access Logging: Enabled
    Services > Proxy Server > General > Log Store Directory: /var/squid/logs

    Using Putty to SSH to shell, as Admin, I can access the /var/squid/logs and verify the log files are there. If I SSH as a User, I can't access the /var/squid directory. I assume all this has to do with permissions. I also assume the permissions are set this way for a reason.



  • Any suggestions about how to get the Squidanalyser reports to work?



  • after installing & enable squidanalyzer you do need to run /usr/local/bin/squid-analyzer manually

    at least this worked for me…

    Michael.



  • That worked. Thank you!



  • This post is deleted!


  • This post is deleted!

Log in to reply