Netgate SG-1000 microFirewall

Author Topic: Lightsquid Graph 500 Server Error Resolution  (Read 8726 times)

0 Members and 1 Guest are viewing this topic.

Offline Tram

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +2/-0
    • View Profile
Lightsquid Graph 500 Server Error Resolution
« on: January 08, 2013, 01:16:55 am »
Hi All

I recently updated my Firewalls to the latest release of pfSense 2.0.2. Once the update was completed and the packages had been re-installed I ran into the issue where the Lightsquid graphs were no longer working and I instead was getting a "Server 500 Error". I have encountered this error before and had to do the research twice to fix it so here is a quick resolution so that I can easily find it again if I need to.

SSH as root to the firewall and go to
Code: [Select]
cd /usr/local/www/lightsquidThen run the lightsquid check which will check for all the lightsquid dependencies
Code: [Select]
./check-setup.pl
If this command throws an error then you will need to install perl which can be done with the following command:
Code: [Select]
pkg_add -rvf ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/Latest/perl.tbz
Try running the check-setup command again. If you still encounter errors you may need to resolve the links from /usr/bin to /usr/local/bin
Here are the commands to do so: (Note: the version numbers on your system may be different to those stated below)
Code: [Select]
ln -s /usr/local/bin/perl5.14.2 /usr/bin/perl
ln -s /usr/local/bin/perl5.14.2 /usr/bin/perl5
You may also need to update the perl5 link in /usr/local/bin
Code: [Select]
ln -s /usr/local/bin/perl5.14.2 /usr/local/bin/perl5

When the check-setup command is runs you will likely encounter the output error: "no: GD.PM found, please install or set $graphreport=0 to disable"
To resolve this we will need to install the p5-GD libraries. Use the command below to do so
Code: [Select]
pkg_add -rvf ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/Latest/p5-GD.tbz
Run the check-setup command after the install completes and you should get an output similar to:
Code: [Select]
LightSquid Config Checker, (c) 2005-9 Sergey Erokhin GNU GPL

LogPath   : /var/squid/logs
reportpath: /var/lightsquid/report
Lang      : /usr/local/share/lightsquid/lang/eng
Template  : /usr/local/www/lightsquid/tpl/novosea
Ip2Name   : /usr/local/libexec/lightsquid/ip2name.dns

WARNING: $skipurl variable contain unescaped '.' char !!!
WARNING: if you use . as regular expression metacharacter please use '' instead "" and escape . via \.
WARNING: $skipurl now ->zzz.zzz<

all check passed, now try access to cgi part in browser

Your graphs should now work correctly.

NOTE: On one of the firewalls I configured I had to re-run the install for perl library and dependencies again before the system picked up the missing library.

Offline asmat

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #1 on: January 30, 2013, 10:33:01 pm »
I encounter the "no gd.pm found" error but when i run the pkg_info it states that i do have it installed.

What should I do?

Great tutorial btw

Offline Tram

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +2/-0
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #2 on: January 31, 2013, 01:11:17 pm »
I encounter the "no gd.pm found" error but when i run the pkg_info it states that i do have it installed.

What should I do?

Great tutorial btw

It is likely that your links are not in the right place but I'd need more info to go on in order to help more. eg. pkg_info output etc.

Your other option is to run the command
Code: [Select]
pkg_add -rvf ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/Latest/p5-GD.tbz
Which will forcefully install the p5-GD package and dependencies again, hopefully repairing the links.



Offline asmat

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #3 on: February 04, 2013, 01:37:59 am »
Code: [Select]
pkg_info
bsdinstaller-2.0.2012.1207 BSD Installer mega-package
cyrus-sasl-2.1.25_1 RFC 2222 SASL (Simple Authentication and Security Layer)
cyrus-sasl-2.1.25_2 RFC 2222 SASL (Simple Authentication and Security Layer)
db3-3.3.11_3,1      The Berkeley DB package, revision 3.3
db41-4.1.25_4       The Berkeley DB package, revision 4.1
db42-4.2.52_5       The Berkeley DB package, revision 4.2
expat-2.0.1_2       XML 1.0 parser written in C
fontconfig-2.8.0,1  An XML-based font configuration API for X Windows
freetype2-2.4.7     A free and portable TrueType font rendering engine
gd-2.0.35_7,1       A graphics library for fast creation of images
gettext-0.18.1.1    GNU gettext package
jpeg-8_3            IJG's jpeg compression utilities
libiconv-1.13.1_1   A character set conversion library
libiconv-1.14       A character set conversion library
libwww-5.4.0_4      The W3C Reference Library
lightsquid-1.8_2    A light and fast web based squid proxy traffic analyser
neon29-0.29.6_4     An HTTP and WebDAV client library for Unix systems
net-snmp-5.7.1_7    An extendable SNMP implementation
nut-2.6.4           Network UPS Tools
openldap-client-2.4.26 Open source LDAP client implementation
openldap-sasl-client-2.4.31_1 Open source LDAP client implementation with SASL2                 support
p5-GD-2.46          A perl5 interface to Gd Graphics Library version2
perl-5.12.4_3       Practical Extraction and Report Language
perl-5.14.2_2       Practical Extraction and Report Language
perl-threaded-5.12.4_4 Practical Extraction and Report Language
pkg-config-0.25_1   A utility to retrieve information about installed libraries
pkgconf-0.8.7_2     pkg-config compatible utility which does not depend on glib
png-1.4.8           Library for manipulating PNG images
squid-2.7.9_1       HTTP Caching Proxy
squid-3.1.20        HTTP Caching Proxy
squidGuard-1.4_4    A fast redirector for squid

this is the output. I already tried removing and recreating symlinks but still find the error

I will try your suggestion to reinstall p5-GD package

Offline iorx

  • Full Member
  • ***
  • Posts: 150
  • Karma: +6/-0
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #4 on: February 04, 2013, 09:48:25 am »
Confirmed. That first post in this thread fixed the problems. I'm latest build 2.1.
Had to reload / refresh browser though (Ctrl+R  / F5) to get the graphs to show.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21571
  • Karma: +1471/-26
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #5 on: February 04, 2013, 11:24:36 am »
Try to remove all that and remove lightsquid as well and reinstall.

I changed the build options on the PBI to ensure that it includes perl and GD. If that alone isn't enough, then the install code may need to make some additional symlinks and such.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline asmat

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #6 on: February 04, 2013, 08:52:33 pm »
Hi Jimp,

When I execute per graph.cgi from the shell it come out like this:

Code: [Select]
perl graph.cgi
Can't load '/usr/local/lib/perl5/site_perl/5.12.4/mach/auto/GD/GD.so' for module GD: /usr/local/lib/perl5/site_perl/5.12.4/mach/auto/GD/GD.so: Undefined symbol "PL_sv_undef" at /usr/local/lib/perl5/5.12.4/mach/DynaLoader.pm line 200.
 at graph.cgi line 23
Compilation failed in require at graph.cgi line 23.
BEGIN failed--compilation aborted at graph.cgi line 23.

I even tried uninstalling all packages and try almost every install sequence but still having this error.

For the record, the lightsquid graph is the only thing not working in my setup. Everything else is just perfect.
« Last Edit: February 04, 2013, 08:56:02 pm by asmat »

Offline Tram

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +2/-0
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #7 on: March 01, 2013, 12:04:41 am »
Hey Jimp

I tested your changes, by uninstalling and re-installing lightsquid the problem appears to resolve itself.

Thanks bud  :)

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21571
  • Karma: +1471/-26
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #8 on: March 01, 2013, 12:07:01 pm »
So it does... with one exception. If you install git (for gitsync) before lightsquid, git's perl install doesn't have GD so it won't find it.

But if you uninstall git, remove/reinstall lightsquid, then it works.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline Tram

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +2/-0
    • View Profile
Re: Lightsquid Graph 500 Server Error Resolution
« Reply #9 on: April 21, 2013, 06:10:01 am »
Please note that the perl package location has changed.

Use to update link:
Code: [Select]
pkg_add -rvf ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/perl.tbz