分类: LINUX
2007-12-26 11:34:31
下载sarg-2.2.3.1.tar.gz
tar zxvf sarg-2.2.3.1.tar.gz
cd sarg-2.2.3.1
拷贝相关gd库
cp /usr/local/gd2/lib/libgd.so.2 /lib/
编译安装
./configure
make
make install
mkdir /usr/local/apache2/htdocs/sarg
vi /usr/local/sarg/sarg.conf
access_log /var/log/squid/access.log
output_dir /usr/local/apache2/htdocs/sarg
temporary_dir /var/tmp
lastlog 30
overwrite_report yes
日志的自动循环 以30天为一个周期
crontab -e
=====================================
0 21 * * * /usr/bin/sarg
0 22 * * * /usr/local/squid/sbin/squid -k rotate
====================================
修改httpd.conf设置/usr/local/apache2/htdocs/sarg目录访问权限
vi /usr/local/apache2/conf/httpd.conf
AllowOverride authconfig
Order allow,deny
Allow from all
vi /usr/local/apache2/htdocs/sarg/.htaccess
AuthType Basic
AuthName "请输入用户名和密码"
AuthUserFile /usr/local/apache2/htdocs/sarg/passwords
Require valid-user
htpasswd -c /usr/local/apache2/htdocs/sarg/passwords adminsarg
重复输入2次密码
/usr/local/apache2/bin/apachectl restart