Configuration and installation on Ubuntu server lightsquid

# packages required
apt-get install perl libgd-gd2-perl -y &&
apt-get install apache2 -y &&
apt-get install cron -y

# Download Lightsquid
cd /tmp
wget https://www.dropbox.com/s/naaf9ox9zr3q5tx/lightsquid-1.8.tar.gz

# Extract the package lightsquid
tar -xvzf lightsquid-1.8.tar.gz

# Move extract results to your webserver directory ubuntu default instance here I put in (/var/www)
mv lightsquid-1.8 /var/www/lightsquid

# Switching to lightsquid directory and change to all scripts .cgi and .pl be in executable
cd /var/www/lightsquid &&
chmod +x *.cgi &&
chmod +x *.pl

# Change the ownership of access according to your apache
chown -R www-data.www-data *

# Edit httpd.conf
pico /etc/apache2/httpd.conf



# Add the following httpd.conf configuration

AddHandler cgi-script .cgi
AllowOverride All

# Restart Apache
/etc/init.d/apache2 restart

# Adjust the following code according to directory where you lightsquid
cd /var/www/lightsquid
pico lightsquid.cfg
# Replace some lines like this
$cfgpath =”/var/www/lightsquid”;
$tplpath =”/var/www/lightsquid/tpl”;
$langpath =”/var/www/lightsquid/lang”;
$reportpath =”/var/www/lightsquid/report”;
$logpath =”/var/log/squid”;
$ip2namepath =”/var/www/lightsquid/ip2name”;

# type the command
perl check-setup.pl
# If a message appears as below, then lihtsquid ready for use
LightSquid Config Checker, (c) 2005 Sergey Erokhin GNU GPL
LogPath : /var/log/squid
reportpath: /var/www/lightsquid/report
Lang : /var/www/lightsquid/lang/eng
Template : /var/www/lightsquid/tpl/base
Ip2Name : /var/www/lightsquid/ip2name/ip2name.simple
all check passed, now try access to cgi part in browser

# provide the name of the registered IP
pico realname.cfg
# Ip name registration example
192.168.3.254   Billing
192.168.3.2     PC 01
192.168.3.3     PC 02
192.168.3.4     PC 03
192.168.3.5     PC 04
192.168.3.6     PC 05
192.168.3.7     PC 06
192.168.3.8     PC 07

# For group, or skip it if not needed
pico group.cfg
# example ip group
192.168.3.254   Admin
192.168.3.2     Admin
192.168.3.3     Client
192.168.3.4     Client
192.168.3.5     Client
192.168.3.6     Client
192.168.3.7     Client
192.168.3.8     Client

# After that run the script lightparser.pl
perl lightparser.pl /var/log/squid/access.log

# To run the script automatically lightparser.pl add in crontab
crontab -e
10 * * * * /var/www/lightsquid/lightparser.pl today

# Please open your localhost web, and look at what your users do
http://IP-Proxy/lightsquid