OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • How to set up sarg with opnsense?
« previous next »
  • Print
Pages: [1]

Author Topic: How to set up sarg with opnsense?  (Read 8266 times)

liver007

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
    • View Profile
How to set up sarg with opnsense?
« on: August 24, 2018, 12:39:26 pm »
Hi all!
Anyone who has info that might be helpful in setting up Sarg on an opnsense firewall?
Suggestions and ideas are greatly appreciated.
« Last Edit: August 29, 2019, 06:59:55 am by fabian »
Logged

myksto

  • Full Member
  • ***
  • Posts: 106
  • Karma: 6
    • View Profile
Re: How to set up sarg with opnsense?
« Reply #1 on: August 28, 2018, 08:55:45 am »
Hello.
Yes, I installed Sarg in one of my installation of OPNSense.
A did a "step by step" guide and I have it in my office's server, I'm out now.
If you like I can post it as soon as I'll reach my office.

Cheers,

Michele.
Logged

myksto

  • Full Member
  • ***
  • Posts: 106
  • Karma: 6
    • View Profile
Re: How to set up sarg with opnsense?
« Reply #2 on: August 28, 2018, 04:45:11 pm »
Here I am.
Below the steps to install, configure and protect Sarg on OPNSense.
I have one installation and I did the installation many months ago.

INSTALL
pkg install sarg

CONFIG
Search for file "sarg.conf" and set thi parameter:
output_dir /usr/local/www/squid-reports

If this parameter remains unset reports will be unaccessible.

PROTECT
To protect access to reports with user and password follow these steps:

Search for file "/usr/local/etc/inc/plugin.inc.d/webgui.inc" and:

1) add string "mod_auth"

## modules to load
server.modules              =   ( "mod_access", "mod_expire", "mod_auth", "mod_compress", "mod_redirect",
  "mod_cgi", "mod_fastcgi","mod_alias", "mod_rewrite"
)

2) Just after those rows add these lines of code:

"auth.backend = "plain"
auth.backend.plain.userfile = "/usr/local/www/squid-reports/.htpasswd"
auth.require = ("/squid-reports" => (
"method" => "digest",
"realm" => "squid-reports",
"require" => "valid-user"
))"


3) Then create file "/usr/local/www/sarg-reports/.htpasswd"
and insert username and password inside (for istance):
admin:admin

Thats all.

Restart firewall to test.

HINT: file "webgui.inc" is being overwritten when OPNSense is updated or upgraded so it must be re-written for the part in point 2)

I hope to have been helpful,

cheers,

Michele.
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: How to set up sarg with opnsense?
« Reply #3 on: August 28, 2018, 06:25:54 pm »
FYI: a better solution would be using the nginx plugin.

just create a server listening on a high port like 8080/8443 and set the root to the export directory. If you use a location (use no match and / to match the URL), you can also configure authentication and it will persist across releases.
Logged

Raxid

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: How to set up sarg with opnsense?
« Reply #4 on: September 29, 2020, 03:18:03 pm »
Hi myksto,

Following your steps i had installed sarg on opnsense but i cannot find sarg plugin on Opnsense Gui.
Can you please tell me how to access the sarg Gui for configurations?
Logged

myksto

  • Full Member
  • ***
  • Posts: 106
  • Karma: 6
    • View Profile
Re: How to set up sarg with opnsense?
« Reply #5 on: September 30, 2020, 07:00:14 pm »
Hi Raxid.
Unfortunately I have no more installations with Sarg and to tell the truth I really can't remember whether I had the plugin in the gui or not.

Sorry not to be able to give you some help. :(

Michele.
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: How to set up sarg with opnsense?
« Reply #6 on: October 01, 2020, 09:17:55 am »
There never was a SARG plugin.
Logged

pls

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: How to set up sarg with opnsense?
« Reply #7 on: July 19, 2023, 02:40:05 pm »

Quote
HINT: file "webgui.inc" is being overwritten when OPNSense is updated or upgraded so it must be re-written for the part in point 2)

You can put the conf in /usr/local/etc/lighttpd_webgui/conf.d/10-sarg.conf, hence you'll be resilient to update.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • How to set up sarg with opnsense?
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2