LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2006, 07:04 AM   #1
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
Angry AWSTATS for apache server, can;t set correct permissions. Please help.


Guy i need some help setting up permissions. AWstats works fine statically but cgi gives me the 403 permission.

This is what I have done:

- Apache runs under nobody user.
- AWstats directories are
/usr/local/awstats - for main program
/etc/awstats for conf files
/var/log/apache2/awstats for database

I have set up these directories as follows.

Wwwroot and everything in wwwroot is own by nobody (apache user)

--(:root@elmotrina)-(/usr/local/awstats)--
--(0546:Tue,01 Aug 06:$)-- lsa
total 28
drwx------ 5 elmo elmo 4096 2006-08-01 01:14 .
drwxrwsr-x 16 root staff 4096 2006-08-01 01:27 ..
drwx------ 3 elmo elmo 4096 2006-08-01 01:14 docs
-rwx------ 1 elmo elmo 6720 2005-12-25 00:03 README.TXT
drwx------ 5 elmo elmo 4096 2006-08-01 01:32 tools
drwxr-xr-x 7 nobody elmo 4096 2006-08-01 01:15 wwwroot

--(:root@elmotrina)-(/usr/local/awstats/wwwroot)--
--(0548:Tue,01 Aug 06:$)-- lsa
total 28
drwxr-xr-x 7 nobody elmo 4096 2006-08-01 01:15 .
drwx------ 5 elmo elmo 4096 2006-08-01 01:14 ..
drwxr-xr-x 5 nobody elmo 4096 2006-07-31 14:03 cgi-bin
drwxr-xr-x 3 nobody elmo 4096 2006-08-01 01:14 classes
drwxr-xr-x 2 nobody elmo 4096 2006-08-01 01:14 css
drwxr-xr-x 9 nobody elmo 4096 2006-08-01 01:15 icon
drwxr-xr-x 2 nobody elmo 4096 2006-08-01 01:15 js

--(:root@elmotrina)-(/usr/local/awstats/wwwroot/cgi-bin)--
--(0559:Tue,01 Aug 06:$)-- lsa
total 636
drwxr-xr-x 5 nobody elmo 4096 2006-07-31 14:03 .
drwxr-xr-x 7 nobody elmo 4096 2006-08-01 01:15 ..
-rwxr-xr-x 1 nobody elmo 5407 2005-11-19 03:36 awredir.pl
-rwxr-xr-x 1 nobody root 59524 2006-08-01 01:32 awstats.model.conf
-rwxr-xr-x 1 nobody elmo 544954 2005-11-24 23:11 awstats.pl
drwxr-xr-x 5 nobody elmo 4096 2006-08-01 01:14 lang
drwxr-xr-x 2 nobody elmo 4096 2006-08-01 01:14 lib
drwxr-xr-x 3 nobody elmo 4096 2006-08-01 01:14 plugins
-rwxr-xr-x 1 nobody root 39 2006-07-31 14:03 poro.html

--(:root@elmotrina)-(/etc/awstats)--
--(0549:Tue,01 Aug 06:$)-- lsa
total 76
drwxr-xr-x 2 nobody root 4096 2006-07-31 16:55 .
drwxr-xr-x 108 root root 8192 2006-08-01 01:30 ..
-rw-r--r-- 1 nobody root 59581 2006-07-31 16:55 awstats.www.myserver.com.conf

--(:root@elmotrina)-(/var/log/apache2/awstats)--
--(0550:Tue,01 Aug 06:$)-- lsa
total 28
drwxr-xr-x 2 nobody root 4096 2006-08-01 05:38 .
drwxr-xr-x 3 root root 4096 2006-08-01 02:00 ..
-rwxr-xr-x 1 nobody root 8412 2006-07-31 12:37 awstats072006.myserver.com.txt
-rw-r--r-- 1 nobody root 6021 2006-08-01 05:38 awstats082006.myserver.com.txt

Then in the apache httpd.conf I have added this lines

<Directory "/usr/local/awstats/wwwroot">
Options +ExecCGI
AddHandler cgi-script cgi pl
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost 192.168.11.3:80>
ServerAdmin adrian@donemail.com
DocumentRoot /var/www/apache2-default/catalog3/
ServerName www.myserver.com

DirectoryIndex /index.php
CustomLog /usr/local/apache2/logs/mylogs/access_log_myserver common
CustomLog /usr/local/apache2/logs/mylogs/comb_log_myserver combined
errorLog /usr/local/apache2/logs/mylogs/error_log_myserver

ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
</VirtualHost>

In the awstat.conf file I have cgi activated and all the directories match the ones here. Please let me know if you guys want me to paste part of it. When the users execute this website

http://www.myserver.com/aswstats/aws...w.myserver.com

They receive a message "don't have permission to access this file" Also 403....

I haven't set the soft links as some tutorials show because in my case the directory structure matches.

As long as I know if the apache user owns the file and the ScriptAlias command is pointing to the cgi directory it should work, but I have checked the permission a 1000 times and can't find the error. Any help would be highly appreciated!!! thanks.
 
Old 08-02-2006, 09:43 AM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
but I have checked the permission a 1000 times and can't find the error.
Your permissions are too strict on /usr/local/awstats (the directory itself).
 
Old 08-02-2006, 10:59 AM   #3
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Original Poster
Rep: Reputation: 30
the script is awstats.pl located in /usr/local/awstats/wwwroot/cgi-bin/ and is set to 755. Does it matter that the /usr/local/awstats is set to 700? I'll give it a try but don't get it. thanks
 
Old 08-02-2006, 11:44 AM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,285

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by isuck@linux
Does it matter that the /usr/local/awstats is set to 700?
Yes.

Think of directories in your path as doors in a hallway. If they are all unlocked ("have execute permission") you can open each one in turn and get all the way down the hallway. But if any one of them is locked (no execute permission) ... you're stuck.

[edit] For anyone old enough to remember the TV show - this reminds me of the opening credits of "Get Smart" [/edit]

Last edited by haertig; 08-02-2006 at 11:45 AM.
 
Old 08-02-2006, 05:16 PM   #5
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Original Poster
Rep: Reputation: 30
then that was the big issue. Thanks 4 ur help!
 
  


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 returns 403 on file with correct permissions jon23d Linux - Newbie 4 05-23-2006 08:54 PM
awstats apache dependency twk Debian 2 11-17-2004 10:49 PM
How to set correct file/directory permissions pat.delaney Linux - Networking 5 12-02-2003 09:39 AM
giving apache the correct permissions dflorence Linux - Newbie 3 11-06-2003 08:27 AM
Apache server: pointing to the correct file WiWa Linux - Software 4 08-11-2003 07:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:37 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