• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

How to guide for Accessing Squid's cachemgr.cgi over https

Scheduled Pinned Locked Moved Cache/Proxy
9 Posts 2 Posters 2.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    JonathanLee
    last edited by JonathanLee May 18, 2024, 12:21 AM Apr 1, 2024, 8:57 PM

    Screenshot 2024-05-17 at 17.06.19.png

    Screenshot 2024-05-17 at 17.08.05.png

    Squid Proxy comes pre packaged with its own cache manger.

    Here is how you can access it over https.

    After some research, thank you to @bnangle

    One inside of pfSense go to command line and create a linker file and place it inside of

    /usr/local/www/lightsquid/
    command

    ln -s /usr/local/libexec/squid/cachemgr.cgi /usr/local/www/lightsquid/cachemgr.cgi
    

    Setup some default acls set a password or not

    acl localhost src 127.0.0.1/255.255.255.255 to acl localhost src 10.0.0.1/255.255.255.255
    cachemgr_passwd disable offline_toggle reconfigure shutdown
    cachemgr_passwd none all
    

    You must use a password in place of none if you so choose to do so. I recommend you add one. However for testing I had it set to none

    access the cachemgr from pfsense under light squid

    https://192.168.1.1:7445/cachemgr.cgi

    when inside of pfsense click the lightsiquid and adapt the url to access the cache manger.

    Make sure to upvote

    1 Reply Last reply Reply Quote 0
    • J
      JonathanLee
      last edited by JonathanLee May 18, 2024, 12:19 AM Apr 1, 2024, 9:11 PM

      Still make sure you adapt your /usr/local/etc/squid/cachemgr.conf
      to include your firewall IP address and hostname

      Screenshot 2024-05-17 at 17.19.17.png

      You don't have to change this I can access it with just local. I was very excited to share this

      Make sure to upvote

      J P 2 Replies Last reply Apr 22, 2024, 8:34 PM Reply Quote 0
      • J
        JonathanLee @JonathanLee
        last edited by JonathanLee May 18, 2024, 12:12 AM Apr 22, 2024, 8:34 PM

        @JonathanLee

        PART 2 Password Security and GUI Status page
        Now that you have Squids Cache Manager accessible on the GUI, lets make sure it is secure however we have an issue with that mgr:info when Squid is build does not contain a password so if we set one we have to adapt the GUI squid status php file.

        It is easy.

        Step 1
        add your password into advanced config

        cachemgr_passwd disable offline_toggle reconfigure shutdown
        cachemgr_passwd **PASSWORDHERE!** all
        

        Screenshot 2024-05-17 at 17.12.01.png

        Mine is "redacted"
        I also disabled shutdown and reconfigure from the options.

        Now that it is set you might notice your status page no longer works that is ok its only because it doesn't have the password.

        Step 2
        Add password to
        /usr/local/www/status_squid.php

        It is simple change mgr:info@redacted

        after @ you need to be add a password.

        Screenshot 2024-05-17 at 17.09.59.png

        Now you have a cache manger access and it is password locked plus you disabled some tools that could limit access if used incorrectly.

        Enjoy

        Make sure to upvote

        1 Reply Last reply Reply Quote 0
        • J
          JonathanLee
          last edited by JonathanLee May 18, 2024, 12:14 AM Apr 22, 2024, 8:39 PM

          PART 3 Lightsquid code adaption

          Also make sure you add your password here to

          /usr/local/www/sqstat/sqstat.php

          Screenshot 2024-05-17 at 17.14.31.png

          This file already has a line of code just waiting for your new password to help lock it down.

          Make sure to upvote

          1 Reply Last reply Reply Quote 0
          • J
            JonathanLee
            last edited by May 10, 2024, 8:25 PM

            @stephenw10

            I am missing my photos here too :( Can you help with a couple of these posts the photos are vanishing ..

            Make sure to upvote

            1 Reply Last reply Reply Quote 0
            • J
              JonathanLee
              last edited by May 18, 2024, 12:15 AM

              @stephenw10

              I added the photos again however it was saying invalid path also when i went to add them. I think this fixed it.

              Make sure to upvote

              1 Reply Last reply Reply Quote 0
              • P
                periko @JonathanLee
                last edited by Mar 18, 2025, 5:05 AM

                @JonathanLee I have try the steps, I see the login screen, input my password and get this error.

                The following error was encountered while trying to retrieve the URL: http://fw.example.local:3128/squid-internal-mgr/

                Access Denied.

                Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.

                Is like squid blocking the access.

                Any ideas?

                Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                www.bajaopensolutions.com
                https://www.facebook.com/BajaOpenSolutions
                Quieres aprender PfSense, visita mi canal de youtube:
                https://www.youtube.com/c/PedroMorenoBOS

                J 1 Reply Last reply Mar 18, 2025, 1:09 PM Reply Quote 0
                • J
                  JonathanLee @periko
                  last edited by Mar 18, 2025, 1:09 PM

                  @periko what version of pfSense is this for? I think that the new version of Squid makes it such that cachemgr.cgi no longer works. I have not attempted this inside the new package. If you are running older software like 23.05.01 with Squid 5.8 it works. Sorry.. It did the same for me on pfsense version 24, some code needs adaption for this functionality to work again.

                  Make sure to upvote

                  P 1 Reply Last reply Mar 20, 2025, 4:04 AM Reply Quote 0
                  • P
                    periko @JonathanLee
                    last edited by Mar 20, 2025, 4:04 AM

                    @JonathanLee Hi, running Pfsense CE 2.7.2 Squid 6.3.

                    Make sense what you mention, will be cool to have this feature available.

                    Thanks @JonathanLee

                    Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                    www.bajaopensolutions.com
                    https://www.facebook.com/BajaOpenSolutions
                    Quieres aprender PfSense, visita mi canal de youtube:
                    https://www.youtube.com/c/PedroMorenoBOS

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                      [[user:consent.lead]]
                      [[user:consent.not_received]]