Author Topic: Lightsquid Tutorial  (Read 12449 times)

mat1_8

  • Zen Monk
  • **
  • Posts: 99
  • Karma: +0/-1
    • View Profile
Lightsquid Tutorial
« on: April 19, 2013, 10:34:00 am »
After trying to figure out how to install and configure lightsquid, I am writing a tutorial to help those interested in such package. I have taken the steps from Lightsquid docs but there are some things which you need to be careful about which are not highlighted (http://lightsquid.sourceforge.net/Installs.html):

1) Required software - Perl, http server (Apache, lighthttpd, etc), Squid, Cron

2) Download Lightsquid and extract to this path /var/www/lightsquid. Obviously you need to create the directory lightsquid with mkdir since its not created.

3) Go to the lightsquid directory where you have the extracted files and run these two commands - chmod +x *.cgi and chmod +x *.pl

4) Change the ownership of files using this command - sudo chown -R root:root lightsquid (you can also specify another user instead of root. If its not root the better since of security. I have specified root here just as an example)

5) Now when you are in the lightsquid directory, you need to configure lightsquid.cfg. Make sure that all paths are set to /var/www/lightsquid since if not, the program returns an error of files not found. Remember that we extracted lightsquid in that path so make sure the path is correct. Now be very careful that the path of the logpath needs to be /var/log/squid3 and not just squid.

6) Next go to the apache2 configuration file (apache2.conf) in /etc/apache2 and write the following line at the bottom:

<Directory "/var/www/lightsquid">
   Options +ExecCgi
   AddHandler cgi-script .cgi
   AllowOverride All
</Directory>

7) Restart apache2 by running the command /etc/init.d/apache2 restart

8) Now go back to lightsquid directory and run these two commands - sudo ./check-setup.pl and sudo ./lightparser.pl. If you have any errors make sure to check the configuration file of lightsquid - be very very careful with the paths!

9) You should access lightsquid in the web browser by typing http://<host where we live>/lightsquid/. If for any reason you cannot access it, try to restart apache2 again.

10) To execute parser every 20 minutes run this command:

crontab -e

Write the following line at the bottom:

*/20 * * * * /var/www/htdocs/lightsquid/lightparser.pl today

if you have small log and fast machine, you may run lightparser with smaller delay
warning not set interval less 10 min





Arus

  • Zen Apprentice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Lightsquid Tutorial
« Reply #1 on: October 25, 2014, 04:54:33 pm »
Hi,
Great job.
Fix crontab entry to :

*/20 * * * * /var/www/lightsquid/lightparser.pl today

removing "htdocs" from path.

Best regards

c.monty

  • Zen Apprentice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Lightsquid Tutorial
« Reply #2 on: January 11, 2015, 03:16:05 pm »
Hi!

How can I configure Nginx on Zentyal 4.0 to offer this webservice Lightsquid?

THX

kent1004

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Lightsquid Tutorial
« Reply #3 on: February 27, 2015, 10:02:03 am »
Add another port other than 80 in apache:
In "/etc/apache2/ports.conf" add Listen "<your port>" .
Add new rule in zentyal's firewall:  open <your port>  in "Filtering rules from internal networks to Zentyal"