PDA

Bekijk Volledige Versie : permissie view AWstats



jim01
23/02/06, 13:56
op een RH machine lukt het me niet de statistieken weer te geven van AWstats.
Deze heb ik zo juist geinstalleerd
maar krijg nu een fout melding:

Forbidden

You don't have permission to access /awstats/awstats.pl on this server.

dit als ik open

http://00.00.00.00/awstats/awstats.pl?config=www.domein.nl&configdir=/etc/awstats

het is me wel duidelijk dat er iets is met de rechten
echter na hevig zoeken op allerlei fora nog nix gevonden...

jim

frvge
23/02/06, 15:12
Moet CGI hier niet voor aangezet worden? En probeer eens andere CHMOD instellingen.

Sernate
23/02/06, 15:53
Hoe ziet je apache config er uit voor awstats?

Staan de rechten van de directory goed, en heeft deze het recht cgi scripts uit te voeren? (options Execcgi?)

jim01
23/02/06, 16:42
mijn httpd.conf:

# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

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

de paths kloppen.
en de dir van de des betreffende virtual server:

<VirtualHost 00.00.00.00:80>
SuexecUserGroup "#569" "#569"
ServerName domein.nl
ServerAlias www.domein.nl
DocumentRoot /home/sites/site7/web
ErrorLog /home/sites/site7/logs/error_log
CustomLog /home/sites/site7/logs/access_log combined
ScriptAlias /cgi-bin/ /home/sites/site7/cgi-bin/
<Directory /home/sites/site7/web>
Options Indexes IncludesNOEXEC FollowSymLinks
</Directory>

moet ik hier iets aan veranderen?

Ryan Kalkhoven
23/02/06, 16:43
Welke versie RH gebruik je? Staat er selinux op?

jim01
23/02/06, 20:17
RH enterprise v4
en volgens mij staat er idd. selinux op.

Ryan Kalkhoven
23/02/06, 20:19
RH enterprise v4
en volgens mij staat er idd. selinux op.

doe als eerste eens een audit2allow -i op je messeges log

jim01
23/02/06, 20:37
# audit2allow -l -i /var/log/messages
allow httpd_sys_script_t user_home_t:dir { getattr search };
allow httpd_sys_script_t user_home_t:file { append read };
allow httpd_t unconfined_t:fifo_file write;
allow httpd_t user_home_t:dir { add_name getattr read search write };
allow httpd_t user_home_t:file { append create getattr read write };
allow system_mail_t user_home_t:file { append read };

Ryan Kalkhoven
23/02/06, 20:43
Oke duidelijk. Er missen wat rechten om het script te draaien over de desbetreffende dirs.

Heb je de src van selinux geinstalleerd? (/etc/selinux/targeted/src)

Zo nee; dan moet je de source rpm van selinux installeren om dit te kunnen aanpassen.

Een andere optie is om selinux helemaal uit te schakelen, maar dan mis je wat mogelijkheden wat betreft security.

jim01
23/02/06, 20:52
Deze src dir. staan er niet bij nee...

Kan ik dan gewoon dit pakket?
http://www.rpmfind.net/linux/rpm2html/search.php?query=selinux&submit=Search+...

en dan in de dir. src gooien?

ps. mogelijkheden zou ik dan missen als ik selinux zou uitschakelen?

jim01
24/02/06, 06:24
ik ff jullie hulp nodig om dit voor elkaar te krijgen.

groet
jim

Ryan Kalkhoven
24/02/06, 07:17
UItleg van selinux:

http://www.fedora-linux.nl/wiki/index.php/SELinux
http://fedora.redhat.com/docs/selinux-faq/
http://www.nsa.gov/selinux/

Voor het installeren van die src-rpm is het makkelijkste om bijv. yum te gebruiken of om hem te downloaden bij redhat (staat ook op de cd)

jim01
24/02/06, 11:38
ik heb even getest met SELINUX=disabled + reboot!
maar dit heeft ook niet veel meer opgeleverd...
ik krijg nog steeds
Forbidden

You don't have permission to access /awstats/awstats.pl on this server.

# audit2allow -l -i /var/log/messages
allow httpd_sys_script_t user_home_t:dir { getattr search };
allow httpd_sys_script_t user_home_t:file { append read };
allow httpd_t unconfined_t:fifo_file write;
allow httpd_t user_home_t:dir { add_name getattr read search write };
allow httpd_t user_home_t:file { append create getattr read write };
allow system_mail_t httpd_sys_content_t:dir { getattr search };
allow system_mail_t user_home_t:file { append read };

tevens heb ik gekeken naar een download voor selinux src.
op het RH netwerk heb ik het volgende gevonden:

setools.rpm

Kan het hier ook mee?

Security-enhanced Linux is a patch of the Linux kernel and a number of
utilities with enhanced security functionality designed to add mandatory access
controls to Linux. The Security-enhanced Linux kernel contains new
architectural components originally developed to improve the security of the Flask
operating system. These architectural components provide general support for the
enforcement of many kinds of mandatory access control policies, including those
based on the concepts of Type Enforcement, Role-based Access Control, and
Multi-level Security.

The tools and libraries in this release include:

1. seuser: A GUI and command line user manager tool for SELinux. This
is a tool that actually manages a portion of a running policy (i.e.,
user accounts).

2. seuser scripts: A set of shell scripts: seuseradd, seusermod, and
seuserdel. These scripts combine the functions of the associated s*
commands with seuser to provide a single interface to manage users in
SE Linux.

3. libapol: The main policy.conf analysis library, which is the core
library for all our tools.

See the help files for apol, sepcut, and seuser for help on using the
tools.

Ryan Kalkhoven
24/02/06, 11:53
Die laatste audit2allow die je hebt uitgevoerd geeft de data van de vorige keer weer.

Als je selinux uitgezet hebt dan zou je er geen last meer van mogen hebben en schat ik in dat daar het probleem niet zit. Mocht je het toch willen proberen met selinux dan heb je de selinux-policy-targeted-sources rpm nodig (via up2date / yum?)

Een andere mogelijkheid is iets de rechten van het gestand. doe eens een getfacl op het bestand.

Daar moet uitkomen dat apache recht heeft op het bestand

jim01
24/02/06, 12:23
selinux-policy-targeted-sources-1.17.30-2.110.noarch.rpm
is geinstalleerd.

# getfacl awstats.pl
# file: awstats.pl
# owner: 1007
# group: 513
user:: rwx
group:: r-x
other:: r-x

locatie van de awstats.pl is
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl

Ryan Kalkhoven
24/02/06, 13:16
als ik dat zo zie dan heeft het awstats script vreemde eigenaren (user/group).... Misschien is het handig om die eerst aan te passen naar de apache user/group

jim01
24/02/06, 13:54
ik krijg nu, nadat ik alle awstats dirs. in root:root heb gewijzigd
en alle dirs. de chmod naar 755
dit:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Met:
tail -f /var/log/httpd/error_log

krijg ik niet echt iets dat aanduid op de server error...
Waar vind ik / hoe heet de awstats configuratie file
want met
locate awstats.conf krijg ik niets.

Ryan Kalkhoven
24/02/06, 14:07
Alles over config files staat in de documentatie van awstats:

http://awstats.sourceforge.net/docs/awstats_setup.html

jim01
25/02/06, 11:16
Alles over config files staat in de documentatie van awstats:

http://awstats.sourceforge.net/docs/awstats_setup.html


ik kom er niet uit...
kan iemand mij via bijv. msn live onder steunen.?

grt.
Jim