Sarg not working on browser even httpd service is working.
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sarg not working on browser even httpd service is working.
hi,
I have successfully installed and configured SARG on my SentOS 5.3 in which squid is running. Well I am facing two problems after configuring Sarg.
1st I can not open the report on my web Browser when I write
Code:
http://192.168.1.10/sarg
It show me as
Not Found The requested URL/sarg was not found on this server.Apache/2.2.3 (CentOS)Server at 192.168.1.10 Port 80
Manually I can open the SARG html file by /var/www/html/squid-reports/10Sep 2012-12Sep 2012/index.html[/CODE]
Here now I can see the log report of each user by IP address taken by squid server.
2- The second problem is crontab does not automatically generate the report.
#crontab -e
Code:
00 23 * * * root /usr/bin/sarg
Please guide me and view my all configuration steps below.
thanks,
gardenair
Code:
------------------------------------------------------------------------
1-
# tar zxvf sarg-2.2.3.1.tar.gz
2- then configure it
[root@localhost sarg-2.2.3.1]# ./configure
3- then make
[root@localhost sarg-2.2.3.1]# make
4- then make install
[root@localhost sarg-2.2.3.1]# make install
creating /usr/local/man/man1
creating /usr/local/sarg
Creating /usr/local/sarg/languages
Creating /usr/local/sarg/fonts
cp sarg /usr/bin/sarg
chmod 755 /usr/bin/sarg
cp sarg.1 /usr/local/man/man1/sarg.1
chmod 755 /usr/local/man/man1/sarg.1
cp /usr/local/sarg/sarg.conf
cp -r ./languages /usr/local/sarg;
cp ./exclude_codes /usr/local/sarg;
cp ./user_limit_block /usr/local/sarg;
cp -r ./images /usr/local/sarg;
cp -r ./sarg-php /usr/local/sarg;
cp -r ./fonts /usr/local/sarg;
cp -r ./css.tpl /usr/local/sarg;
[root@localhost sarg-2.2.3.1]#
5- My sarg configuration file is located at
/usr/local/sarg/sarg.conf
6- The sarg.conf file configuration is
access_log /var/log/squid/access.log
graphs yes
graph_days_bytes_bar_color orange
title "Squid User Access Reports"
output_dir /var/www/htdocs/sarg
resolve_ip no
topuser_sort_field BYTES reverse
user_sort_field BYTES reverse
lastlog 3
remove_temp_files yes
index yes
overwrite_report yes
topsites_num 100
topsites_sort_order CONNECT D
index_sort_order D
max_elapsed 28800000
report_type topsites sites_users users_sites date_time denied auth_failures site_user_time_date
show_successful_message yes
show_read_statistics yes
topuser_fields NUM DATE_TIME USERID CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE
user_report_fields CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE
topuser_num 0
show_sarg_logo yes
7- I can generate the log report by
# sarg -l /var/log/squid/access.log
SARG: Records in file: 6317, reading: 100.00%
SARG: Successful report generated on /var/www/html/squid-reports/10Sep2012-11Sep2012
8- The issue is how can I automatically generate the log file. I just add an entry in contab-e
00 23 * * * root /usr/bin/sarg
9- To view the log report generated by sarg start httpd service
/etc/init.d/httpd start
10- And then I browes url "http://ip_of_linux box/sarg" eg.
http://192.168.1.10/sargNot Found
The requested URL/sarg was not found on this server.Apache/
_____________________________________________________________________
2.2.3 (CentOS)Server at 192.168.1.10 Port 80
hi,
I have successfully installed and configured SARG on my SentOS 5.3 in which squid is running. Well I am facing two problems after configuring Sarg.
1st I can not open the report on my web Browser when I write
Code:
http://192.168.1.10/sarg
It show me as Not Found The requested URL/sarg was not found on this server.Apache/2.2.3 (CentOS)Server at 192.168.1.10 Port 80
Manually I can open the SARG html file by /var/www/html/squid-reports/10Sep 2012-12Sep 2012/index.html[/CODE]
Here now I can see the log report of each user by IP address taken by squid server.
Ok....the error is very plain. The file "sarg" is not present in your Apache DocRoot directory. The line you posted tells you that, since it's two directories higher (/squid-reports/10Sep...), than the /var/www/html (the typical DocRoot). So, find the sarg file, and modify your web path accordingly in your browser.
Quote:
2- The second problem is crontab does not automatically generate the report.
Code:
00 23 * * * root /usr/bin/sarg
Please guide me and view my all configuration steps below.
Take a good look at the cron line you posted, then read the man page on crontab. Again, a good basic troubleshooting tip would be to type in the command you want to run, and see if it works, and read the man pages. Did you? What exactly happens if you type in "root /usr/bin/sarg"? It fails, because typing in "root" isn't a valid command. If this is root's crontab, it ALREADY runs as root, and just needs the sarg command.
Thanks a lot "TB0ne" for the correction .Yes now my crontab automatically generate the report file.
Well my last problem is still same. As you said
Quote:
"Ok....the error is very plain. The file "sarg" is not present in your Apache DocRoot directory. The line you posted tells you that, since it's two directories higher (/squid-reports/10Sep...), than the /var/www/html (the typical DocRoot). So, find the sarg file, and modify your web path accordingly in your browser."
Thanks a lot "TB0ne" for the correction .Yes now my crontab automatically generate the report file.
Well my last problem is still same. As you said I open my httpd.conf file here under DocumentRoot the default path is DocumentRoot "/var/www/html"
May I change it to DocumentRoot "/var/www/html/squid-reports"
Please guide me.thanks
You can change your system to be whatever you want, what do you need to be 'guided' with? Change DocumentRoot to be whatever you'd like. If you do, you will then break any web pages that are in the DocumentRoot, since you're pointing to a directory above it.
Well I try in DocumentRoot the path where my log files are
Code:
DocumentRoot "/var/www/html/squid-reports"
But still no success.I am sure that i am doing some thing wrong but as to the path I should work.The httpd service is also started but
The web browser show the following.
Not Found
The requested URL /var/www/html/squid-reports was not found on this server.
_____________________________________________________________________
2.2.3 (CentOS)Server at 192.168.1.10 Port 80
Well I do some google and finally find the solution which i was pacing problem.
# vi httpd.conf
Code:
DocumentRoot "/var/www/html/squid-reports"
and
Code:
Alias /icons/ "/var/www/icons/"
# <Directory "/var/www/icons">
<Directory "/var/www/html/squid-reports">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
This was the complete solution which i found.Now I can open the browser and just write
Well I do some google and finally find the solution which i was pacing problem.
Code:
DocumentRoot "/var/www/html/squid-reports"
and
Code:
Alias /icons/ "/var/www/icons/"
# <Directory "/var/www/icons">
<Directory "/var/www/html/squid-reports">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
This was the complete solution which i found.Now I can open the browser and just write http://192.168.1.10 I can see SARG report
Congratulations...you followed the advice you were given, and it worked.
Quote:
Well the question is if I disable document root as
Code:
# DocumentRoot "/var/www/html/squid-reports"
Run httpd service I can still see the sarg report but If I remove teh path
Code:
<Directory "/var/www/html/squid-reports">
then it show me same previous error.
Can you enlighten on what is the technically both above directives i.e DirectoryRoot and Directory .
If you put the path to search in, it'll find it. You don't, it won't. Why is that hard to understand?? The root is just that...the starting root directory of the path. Since you read the Apache documentation, continue reading it and you'll see the definitions of those two terms.
Thanks for the reply .Normally when we edit any particular service file we normally stop the service.Like
# service httpd stop
or
# service squid stop
To edit sarg when squid is running can can i edit sarg configuration file. Is SARG directed connected with squid service.I mean 1st I should stop squid service then edit sarg.conf file ?
I am asking this question because while running every thing fine I 1st stop httpd service and then open the sarg configuration file.Without any changes I quit the sarg file.
Unfortunately, Sarg does not open the log file even httpd service is started.
In my opinion sarg has been crashed may be not Kindly guide me regarding it.
Thanks for the reply .Normally when we edit any particular service file we normally stop the service.Like # service httpd stop
or # service squid stop
To edit sarg when squid is running can can i edit sarg configuration file. Is SARG directed connected with squid service.I mean 1st I should stop squid service then edit sarg.conf file ?
I am asking this question because while running every thing fine I 1st stop httpd service and then open the sarg configuration file.Without any changes I quit the sarg file. Unfortunately, Sarg does not open the log file even httpd service is started.
In my opinion sarg has been crashed may be not Kindly guide me regarding it.
If you change a config file for ANY service you need to restart it. Obviously, if a service is reading/writing a file that another service has locked open, things will not work right until ALL the services in the chain are restarted.
I even restart the system but no success.Every thing is running but now sarg not showing its report in web page. as before it was showing.
Well, you followed the advice above, and it WAS working. So, either something changed (and you need to change it BACK), or you're having another problem. Again, go back, read log files, and try to UNDERSTAND what's going on.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.