LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-12-2012, 06:51 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
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/sarg

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

Last edited by gardenair; 09-12-2012 at 08:21 AM.
 
Old 09-12-2012, 09:45 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gardenair View Post
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.
 
Old 09-12-2012, 11:39 PM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
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."
I open my httpd.conf file

Code:
# vi /etc/httpd/conf/httpd.conf
# vi /etc/httpd/conf/httpd.conf

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


thanks once again.
gardenair

Last edited by gardenair; 09-13-2012 at 02:18 AM.
 
Old 09-13-2012, 04:05 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gardenair View Post
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.
 
Old 09-13-2012, 11:11 PM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
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

regards,
gardenair

Last edited by gardenair; 09-13-2012 at 11:14 PM.
 
Old 09-14-2012, 12:49 AM   #6
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
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

http://192.168.1.10

I can see SARG report

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 .

thanks
gardenair
 
Old 09-14-2012, 10:49 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gardenair View Post
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.
 
Old 09-14-2012, 11:29 AM   #8
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
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
gardenair
 
Old 09-14-2012, 11:54 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gardenair View Post
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.
 
Old 09-14-2012, 12:10 PM   #10
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
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.
 
Old 09-14-2012, 12:14 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gardenair View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
service httpd not working vs224 Linux - Newbie 2 09-03-2010 03:44 PM
Kerberos and httpd not quite working? MeeLee Linux - Newbie 0 09-22-2009 03:45 AM
sarg not working Gayal Linux - Newbie 1 12-06-2007 12:05 AM
Squid logs not working with SARG symesd Linux - Software 0 11-13-2007 02:28 PM
service httpd status, results in httpd dead but subsys locked squadja Red Hat 2 09-11-2004 10:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration