LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-10-2009, 07:37 AM   #16
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled

access_log is a file. do not cd into it. open it using your favorite text editor like vi.
and once you move the directory have you checked that permissions are intact? or else chown sarge directory to apache user. Your web server will usually run as user apache.
 
Old 08-10-2009, 07:40 AM   #17
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by linuxlover.chaitanya View Post
access_log is a file. do not cd into it. open it using your favorite text editor like vi.
and once you move the directory have you checked that permissions are intact? or else chown sarge directory to apache user. Your web server will usually run as user apache.
tail -f /var/log/httpd/access_log gives this when I access the page
86.xxx.xxx.xx - - [10/Aug/2009:12:36:38 +0100] "GET /sarg HTTP/1.1" 403 281 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11"

[root@localhost ~]# apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 localhost.localdomain (/etc/httpd/conf.d/ssl.conf:81)
Syntax OK
[root@localhost ~]#

created some test files:
http://88.xxx.xxx.xxx/index.html works and gives me hello world
http://88.xxx.xxx.xxx/sarg/test.html still 403 error

chown -R apache /var/www/sarg - still error 403

error_log:
[Mon Aug 10 12:48:06 2009] [error] [client 86.163.103.36] client denied by server configuration: /var/www/sarg

Last edited by qwertyjjj; 08-10-2009 at 07:48 AM.
 
Old 08-10-2009, 07:43 AM   #18
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
also check the error_log file as well.
 
Old 08-10-2009, 07:48 AM   #19
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by qwertyjjj View Post
tail -f /var/log/httpd/access_log gives this when I access the page
86.xxx.xxx.xx - - [10/Aug/2009:12:36:38 +0100] "GET /sarg HTTP/1.1" 403 281 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11"

[root@localhost ~]# apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 localhost.localdomain (/etc/httpd/conf.d/ssl.conf:81)
Syntax OK
[root@localhost ~]#

created some test files:
http://88.xxx.xxx.xxx/index.html works and gives me hello world
http://88.xxx.xxx.xxx/sarg/test.html still 403 error

chown -R apache /var/www/sarg - still error 403

error_log:
[Mon Aug 10 12:48:06 2009] [error] [client 86.xxx.xxx.xxx] client denied by server configuration: /var/www/sarg
error log gives:
[Mon Aug 10 12:48:06 2009] [error] [client 86.xxx.xxx.xxx] client denied by server configuration: /var/www/sarg

copied to sarg to the html folder but still the error:
[root@localhost ~]# cp -r /var/www/sarg /var/www/html
[root@localhost ~]# chown -R apache /var/www/html/sarg
[root@localhost ~]#

Last edited by qwertyjjj; 08-10-2009 at 07:57 AM.
 
Old 08-10-2009, 08:15 AM   #20
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
GOT IT...finally

had to change the deny and allow from in the sarg.conf file to:

Alias /sarg /var/www/sarg

<Directory /var/www/sarg>
DirectoryIndex index.html
Order deny,allow
#Deny from all
#Allow from 127.0.0.1
#Allow from ::1
# Allow from your-workstation.com
</Directory>
 
Old 08-10-2009, 08:34 AM   #21
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by qwertyjjj
GOT IT...finally
Congrats
 
Old 08-10-2009, 08:35 AM   #22
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Quote:
Originally Posted by qwertyjjj View Post
<Directory /var/www/sarg>
DirectoryIndex index.html
Order deny,allow
#Deny from all
#Allow from 127.0.0.1
#Allow from ::1
# Allow from your-workstation.com

</Directory>
Nice but it's not good. Use your ISP's IP range in your "Allow from" rule like I already offered in one of your other threads. I also suggest you have a look at the Apache documentation for ways to password protect access (AuthType Basic: htpasswd).
 
Old 08-11-2009, 03:59 PM   #23
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by unSpawn View Post
Nice but it's not good. Use your ISP's IP range in your "Allow from" rule like I already offered in one of your other threads. I also suggest you have a look at the Apache documentation for ways to password protect access (AuthType Basic: htpasswd).
In this guide
http://www.ikhwan15.blogspot.com/200...cess-sarg.html
, it says that I need to edit the httpd.conf file to get passwords setup for sarg reports. From my PHP days, I was under the impression I could just stick a .htaccess file in the /var/www/sarg folder
I don't want the document root to be /var/www/sarg so not sure what to edit.
?

Have changed this in httpd.conf but couldn't it go in the /var/www/sarg .htaccess file?
Code:
<Directory /var/www/sarg>
deny from all
AllowOverride AuthConfig
Order deny,allow
</Directory>
I haven't put this in yet - what is the virtual host part for? Seems to work without this bit of code.
Code:
....
....
NameVirtualHost *:80
....
....
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /var/www/sarg
ServerName squid.example.com
</VirtualHost>
....
....
I HAVE created these though:

Code:
# cat /var/www/sarg/.htaccess

AuthType Basic
AuthUserFile /etc/httpd/conf/.htpasswd
AuthName Squid-logs
require valid-user
satisfy any
Code:
chmod 644 /var/www/sarg/.htaccess
chown apache /var/www/sarg/.htaccess
Code:
htpasswd -bc /etc/httpd/conf.htpasswd someuser somepassword
chmod 644 /etc/httpd/conf/.htpasswd

Last edited by qwertyjjj; 08-11-2009 at 04:17 PM.
 
Old 08-11-2009, 04:47 PM   #24
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Quote:
Originally Posted by qwertyjjj View Post
In this guide it says that I need to edit the httpd.conf file to get passwords setup for sarg reports. From my PHP days, I was under the impression I could just stick a .htaccess file in the /var/www/sarg folder
Both are possible but do understand http://httpd.apache.org/docs/2.2/how...cess.html#when.


Quote:
Originally Posted by qwertyjjj View Post
what is the virtual host part for? Seems to work without this bit of code.
It's a default, see http://httpd.apache.org/docs/2.2/mod...ml#virtualhost.
Should be changed if one already runs Something Completely Different on <VirtualHost *:80>.
 
Old 08-11-2009, 04:55 PM   #25
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by unSpawn View Post
Both are possible but do understand http://httpd.apache.org/docs/2.2/how...cess.html#when.

Aha, hence why I always used .htaccess files before as I never had root access.



It's a default, see http://httpd.apache.org/docs/2.2/mod...ml#virtualhost.
Should be changed if one already runs Something Completely Different on <VirtualHost *:80>.
I don't understand in this instance why it's needed.
The server root is var/ww/html
Why would I create a virtual host just for the sarg folder?
The .htaccess files only refer to /var/www/sarg so if anybody access http://www.mysite.com, it should still serve the html page whereas if they go http://www.mysite.com/sarg, it will prompt for a password.
 
Old 08-11-2009, 05:26 PM   #26
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Quote:
Originally Posted by qwertyjjj View Post
I don't understand in this instance why it's needed.
The server root is var/ww/html
Why would I create a virtual host just for the sarg folder?
Me neither but then my ESP is at an alltime low today.
Maybe it was provided as an example for your convenience?


Quote:
Originally Posted by qwertyjjj View Post
The .htaccess files only refer to /var/www/sarg so if anybody access http://www.mysite.com, it should still serve the html page whereas if they go http://www.mysite.com/sarg, it will prompt for a password.
Nothing wrong with that.
 
Old 10-08-2009, 03:33 AM   #27
sajay
LQ Newbie
 
Registered: Oct 2009
Posts: 1

Rep: Reputation: 0
hi all
i want to know how to configure sarg so that i can generate the squid proxy report
plese show how to access sarg through web brwoser.

thanks in advance..
 
Old 10-08-2009, 05:14 AM   #28
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
What distribution are you using? Have you looked into the repositories of your package manager to see if sarg is available? If it is there, best way is to install using package manager.
On how to configure it, read the complete thread and you will understand.
 
Old 10-08-2009, 07:38 PM   #29
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Can I just point out that
Code:
htpasswd -bc /etc/httpd/conf.htpasswd someuser somepassword
chmod 644 /etc/httpd/conf/.htpasswd
has 2 different names for 'htpasswd':

conf.htpasswd
.htpasswd

Also, no point in making it hidden (ie leading dot). That only applies to .htaccess files.
Whatever name you decide on, the entry in the .htaccess file must be exactly the same.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apache access forbidden to user dirs. Spudley SUSE / openSUSE 1 12-29-2005 02:53 AM
Forbidden access to soft link on apache web server bnj Linux - Software 3 05-03-2005 09:14 AM
Forbidden access to apache server wisdom Linux - Software 2 12-25-2004 10:29 PM
Error 403 Forbidden access in Apache anoop_cn Linux - Software 1 09-21-2004 10:32 AM
Apache - 403 Forbidden - Access to Subdirectories dieter Linux - Networking 2 03-25-2004 01:51 PM


All times are GMT -5. The time now is 10:47 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration