Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 63200 - Directories in awstats webapps don't have correct permissions
Summary: Directories in awstats webapps don't have correct permissions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo Web Application Packages Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-08 01:50 UTC by Rob Rosenfeld
Modified: 2005-01-24 06:48 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
postinst-en.txt (awstats.conf,884 bytes, text/plain)
2004-09-14 13:35 UTC, Andy Dustman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Rosenfeld 2004-09-08 01:50:22 UTC
Most subdirectories of /usr/share/webapps/awstats/6.1/htdocs and hostroot/cgi-bin have a mask of 644.  This prevents the webserver from getting their listings

Reproducible: Always
Steps to Reproduce:
1.  emerge awstats
2.  webapp-config --install awstats 6.1


Actual Results:  
directories such as /usr/share/webapps/awstats/6.1/htdocs/icons have a
permission mask of 644

Expected Results:  
I believe this needs to be 755 so that the webserver can find files in these
directories.
Comment 1 Andy Dustman 2004-09-14 12:26:20 UTC
Confirmed. Moreover, it prevents the webservers from getting their file contents (probably doesn't prevent listing directory).

Insert this line just before the # copy configuration file comment (about line 93):

find ${D}${MY_HTDOCSDIR} -type d | xargs chmod 755

That should fix it.
Comment 2 Andy Dustman 2004-09-14 12:35:34 UTC
Make that:

find ${D}${MY_HTDOCSDIR} ${D}{MY_HOSTROOTDIR} -type d | xargs chmod 755

since /usr/share/webapps/awstats/6.1/hostroot has the same problem.
Comment 3 Andy Dustman 2004-09-14 13:35:12 UTC
Created attachment 39605 [details]
postinst-en.txt

Here's a fixed version of postinst-en.txt. The original, which is emitted after
webapp-config, has some bad Alias lines, which are missing slashes:

Alias /awstatsclasses "/usr/share/webapps/awstats/6.1/htdocs/classes/"
Alias /awstatscss "/usr/share/webapps/awstats/6.1/htdocs/css/"
Alias /awstatsicons "/usr/share/webapps/awstats/6.1/htdocs/icon/"

This file fixes them to /awstats/classes, etc.

In the tarball, this file comes from tools/httpd_conf. It might be best to
patch this file. It references paths in /usr/local/awstats/wwwroot/ but these
are fixed with sed in the ebuild.
Comment 4 Denny Schierz 2004-09-23 13:00:24 UTC
Can't get it working. I installed awstats too for my virtual servers, but i get only "access denied". 

[Thu Sep 23 21:42:19 2004] [error] [client 84.57.61.29] client denied by server configuration: /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/icons
[Thu Sep 23 21:56:57 2004] [error] [client 84.57.61.29] client denied by server configuration: /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/
[Thu Sep 23 21:57:01 2004] [error] [client 84.57.61.29] client denied by server configuration: /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/
[Thu Sep 23 21:57:02 2004] [error] [client 84.57.61.29] client denied by server configuration: /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/
[Thu Sep 23 21:57:08 2004] [error] [client 84.57.61.29] client denied by server configuration: /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/awstats.pl
[Thu Sep 23 21:57:11 2004] [error] [client 84.57.61.29] client denied by server configuration: /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/awstats.pl

ls -al /usr/share/webapps/awstats/6.1/hostroot
total 24
drwxr-xr-x  6 root root 4096 Sep 22 18:37 .
drwxr-xr-x  7 root root 4096 Sep 22 18:37 ..
drwxr-xr-x  5 root root 4096 Sep 22 18:37 cgi-bin
drwxr-xr-x  2 root root 4096 Sep 22 18:37 datadir
drwxr-xr-x  2 root root 4096 Sep 22 18:37 error
drwxr-xr-x  2 root root 4096 Sep 22 18:37 icons

Here is my apache config:

 <VirtualHost *>

ServerAdmin webmaster@foo.com
ServerName www.foo.com
ServerAlias foo.com
ErrorLog /home/httpd/domain/websites/foo.com/log/error.log
CustomLog /home/httpd/domain/websites/foo.com/log/access.log combined
php_admin_flag engine on
php_admin_value open_basedir "/home/httpd/domain/websites/foo.com/htdocs:/home/httpd/domain/websites/foo.com/tmp:."
DirectoryIndex index.php
DocumentRoot /home/httpd/domain/websites/foo.com/htdocs/
ScriptAlias /cgi-bin/ /home/httpd/domain/websites/foo.com/cgi-bin/

<Directory /home/httpd/domain/websites/foo.com/htdocs/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

<Directory /home/httpd/domain/websites/foo.com/cgi-bin/>
AllowOverride None
Options ExecCGI
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>

Alias /webdav "/home/httpd/domain/websites/foo.com/htdocs/"
<Location /webdav>
        DAV on
        AuthType Basic
        AuthName "WebDAV Storage"
        AuthUserFile /home/httpd/domain/websites/foo.com/etc/dav.passwd
                <LimitExcept GET OPTIONS>
                        require user domain
                </LimitExcept>
</Location>

Alias /awstats/classes "/usr/share/webapps/awstats/6.1/htdocs/classes/"
Alias /awstats/css "/usr/share/webapps/awstats/6.1/htdocs/css/"
Alias /awstats/icon "/usr/share/webapps/awstats/6.1/htdocs/icon/"
ScriptAlias /awstats/ "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/"
RewriteEngine on
RewriteRule ^/awstats/$ /awstats/awstats.pl [R,L]
RewriteEngine off

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/share/webapps/awstats/6.1/htdocs">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>



</VirtualHost>



Does anybody knows the problem?
Comment 5 Paul Querna 2004-09-23 13:06:13 UTC
Add Another block like this to the vhost config:

<Directory "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>



Comment 6 Denny Schierz 2004-09-24 07:39:29 UTC
hi,

now i can access through http://foo.com/awstats/awstats.pl but now i get errors like that:

Warning: Can't find language files for "de". English will be used.
Warning: Can't read file "status_http.pm" (status http detection will not work correctly).
Check if file is in "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lib" directory and is readable.
Warning: Can't read file "search_engines.pm" (search engines detection will not work correctly).
Check if file is in "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lib" directory and is readable.
Warning: Can't read file "domains.pm" (domains detection will not work correctly).
Check if file is in "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lib" directory and is readable.
Warning: Can't read file "operating_systems.pm" (operating systems detection will not work correctly).
Check if file is in "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lib" directory and is readable.
Warning: Can't read file "robots.pm" (robots detection will not work correctly).
Check if file is in "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lib" directory and is readable.
Warning: Can't read file "browsers.pm" (browsers detection will not work correctly).
Check if file is in "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lib" directory and is readable.
Warning: Can't read file "mime.pm" (mime detection will not work correctly).
Check if file is in "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lib" directory and is readable.

also i cant access the images:

You don't have permission to access /awstats/icons/other/page.png on this server.

Its very confusing for me, cause the htdocs root from awstats are avaible for apache.
Comment 7 Denny Schierz 2004-09-24 07:47:13 UTC
hi,

sorry, my mistake. I've forgotten to change the dir permissions from 644 to 755, but the images doesn't work.
Comment 8 Andy Dustman 2004-09-24 07:55:00 UTC
Another problem with the default install is the Apache Alias line for icons. By default it is:

Alias /awstatsicons "/usr/share/webapps/awstats/6.1/htdocs/icon/"

and it should be:

Alias /awstats/icon "/usr/share/webapps/awstats/6.1/htdocs/icon/"

Judging from your error message "You don't have permission to access /awstats/icons/other/page.png on this server.", you need to fix this, or maybe fix something else in your config so that it looks to the correct directory.

This is a really messed-up ebuild -- quite broken in the default installation.
Comment 9 David D. Huff Jr. 2004-10-16 12:16:44 UTC
Just tried to install phpmyadmin locations have broken the install. I cannot understand why the default directory is now set to /usr/share/webapps when we already underwent a year long evolution to move apache apps from the /home directory to the /var/www/localhost and now we are moving applications out of the tree again.
Comment 10 Andy Dustman 2004-10-17 20:45:19 UTC
David, you should read the man page for webapp-config and maybe turn off USE=vhosts if you have that on.
Comment 11 Aaron Walker (RETIRED) gentoo-dev 2005-01-24 06:48:18 UTC
Fixed in 6.3.