Setup lightsquid CentOS 6


I. Install Apache, PHP and make run at startup
# yum -y install httpd php
# service httpd start
# chkconfig httpd on

II. Install lightsquid
-Install paket perl yang diperlukan (perl-GD diperlukan untuk meregenerasi Grafis)
# yum install perl-GD perl-CGI

-Download & Install lightsquid.tgz
# mkdir /tmp/lightsquid
# cd /tmp/lightsquid
# wget http://sourceforge.net/projects/lightsquid/files/lightsquid/1.8/lightsquid-1.8.tgz/download/
# tar -zxvf lightsquid-1.8.tgz -C /var/www/html/; cd /var/www/html/
# mv lightsquid-1.8/ lightsquid
# cd lightsquid/
# cp lightsquid.cfg lightsquid.cfg.asli

III. Konfigurasi Lightsquid
-Edit /var/www/html/lightsquid/lightsquid.cfg
Di dalam file ini, rubahlah path cfgpath, tplpath, langpath, reportpath, logpath, ip2namepath yang sesuai dengan dimana folder lightsquid itu berada…

# cd /var/www/html/lightsquid/
# vi /var/www/html/lightsquid/lightsquid.cfg

# -------------------- GLOBAL VARIABLES ---------------------------
#path to additional `cfg` files
$cfgpath ="/var/www/html/lightsquid";
#path to `tpl` folder
$tplpath ="/var/www/html/lightsquid/tpl";
#path to `lang` folder
$langpath ="/var/www/html/lightsquid/lang";
#path to `report` folder
$reportpath ="/var/www/html/lightsquid/report";
#path to access.log
$logpath ="/var/log/squid";
#path to `ip2name` folder
$ip2namepath ="/var/www/html/lightsquid/ip2name";
..dst..
..dst..
..dst..

 
-Edit Permission
# cd /var/www/html/lightsquid/
# chmod +x *.cgi
# chmod +x *.pl

-Cek Konfigurasi lightsquid di /var/www/html/lightsquid/
# perl check-setup.pl

-Edit /etc/httpd/conf/httpd.conf
# vi /etc/httpd/conf/httpd.conf

Tambahkan baris berikut di paling bawah:

<Directory "/var/www/html/lightsquid">
AddHandler cgi-script .cgi
AllowOverride All
</Directory>

 
-Generate lightsquid
# /var/www/html/lightsquid/lightparser.pl

-Restart apache
# service httpd restart

-Buat penjadwalan regenerate lightsquid
# crontab -e

Masukkan syntax berikut ini untuk meregenerate per-jam/ hourly:

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

 
Done!! Tes lightsquid via browser ketik http://ip_server/lightsquid

1 thought on “Setup lightsquid CentOS 6

Leave a Reply

Your email address will not be published. Required fields are marked *