Gentoo:HowTos

De WikiMar
Salta a la navegació Salta a la cerca

PER AFEGIR AWSTATS A UN VHOST:

Opcio Rapida:

1:

cp /var/www/de.espai.de/htdocs/awstats /var/www/noudomini.com/htdocs/awstats

2: corretgim els permisos:

 sudo chown usuari:apache /var/www/noudomini.com/htdocs/awstats

3: editar /var/www/noudomini.com/htdocs/awstats/index.conf adaptant la configuracio

4: eliminar estadistigues indexXXXXX.txt


5: Crear fitxer de passwords:

sudo htpasswd2 -c /var/www/dafyn.com/.awstatspasswd dafyn


6: Afegir el seguent dins de les dues seccions (http i https) del fitxer /etc/apache2/vhosts/nomvhostnoudomini.com.conf:

       #Awstats:
       <Location "/awstats/index*">
               AuthType Basic
               #AuthName "AWStats authenticated zone"
               AuthName "Zona de Estadistiques restringida"
               AuthUserFile /var/www/noudomini.com/.awstatspasswd
               Require valid-user
       </Location>

7: editar /var/www/awstats-update-marti.sh



Opcio complerta (no cal):

1: sudo webapp-config -I -h dafyn.com -d awstats awstats 6.7-r2 1.b:

marti@cube /var/www/dafyn.com/cgi-bin $ sudo rm -R lang
marti@cube /var/www/dafyn.com/cgi-bin $ sudo rm -R lib
marti@cube /var/www/dafyn.com/cgi-bin $ sudo rm -R plugins
marti@cube /var/www/dafyn.com/cgi-bin $ sudo rm awstats.pl
marti@cube /var/www/dafyn.com/cgi-bin $ sudo rm awredir.pl


2: cp /var/www/de.espai.de/cgi-bin/awstats.conf /var/www/dafyn.com/cgi-bin/ editar el nou awstats.conf canviant els directoris pels del nou vhost


3: sudo ln -s /usr/share/webapps/awstats/current/hostroot/cgi-bin/ /var/www/dafyn.com/htdocs/awstats/index.pl

sudo ln -s /usr/share/webapps/awstats/current/hostroot/cgi-bin/awredir.pl /var/www/dafyn.com/htdocs/awstats/awredir.pl

sudo ln -s /usr/share/webapps/awstats/current/hostroot/cgi-bin/lang /var/www/dafyn.com/htdocs/awstats/lang

sudo ln -s /usr/share/webapps/awstats/current/hostroot/cgi-bin/lib /var/www/dafyn.com/htdocs/awstats/lib

sudo ln -s /usr/share/webapps/awstats/current/hostroot/cgi-bin/plugins /var/www/dafyn.com/htdocs/awstats/plugins



4: Crear fitxer de passwords: sudo htpasswd2 -c /var/www/dafyn.com/.awstatspasswd dafyn


5: Afegir el seguent dins de les dues seccions (http i https) del fitxer /etc/apache2/vhosts/nomvhost.conf:

       #Awstats:
       <Location "/cgi-bin/awstats.pl">
               AuthType Basic
               #AuthName "AWStats authenticated zone"
               AuthName "Zona de Estadistiques restringida"
               AuthUserFile /var/www/de.espai.de/.awstatspasswd
               Require valid-user
       </Location>

7: editar /var/www/awstats-update-marti.sh







ALTRES INFO:


marti@cube ~ $ sudo webapp-config -I -h dafyn.com -d awstats awstats 6.7-r2

  • Creating required directories
  • Linking in required files
  • This can take several minutes for larger apps
*   Files and directories installed


POST-INSTALL INSTRUCTIONS


  1. INSTRUCTIONS:
  2. If you would like to require authentication to access AWStats, then use ONE
  3. of the example configurations below. There are many other modules and
  4. options for authentication which will not be discussed here.
  5. NOTE: Related AWStats configuration directives are:
  6. AllowAccessFromWebToAuthenticatedUsersOnly=1
  7. AllowAccessFromWebToFollowingAuthenticatedUsers="user1 [user2 ...]"
  8. You can use these to set a per-domain user access when needed for virtual
  9. hosting. That means: only the selected user(s) will have access to stats for
  10. the particular domain. All other users will not be allowed to see the domain
  11. stats even though they have authenticated successfully.
  1. SECTION I - Basic Authentication
  2. The following example requires mod_auth (apache 2.0) or mod_auth_basic
  3. (apache 2.2) to work. Make sure you have installed and enabled it in
  4. /etc/apache2/httpd.conf
  5. Add your AWStats users to /etc/awstats/.htpasswd file.
  6. Please see 'man htpasswd2' for more details if you need.
  7. htpasswd2 -c /etc/awstats/.htpasswd username1 htpasswd2
  8. /etc/awstats/.htpasswd username2 etc...
  1. <Location "/cgi-bin/awstats.pl">
  2. AuthType Basic
  3. AuthName "AWStats authenticated zone"
  4. AuthUserFile /etc/awstats/.htpasswd
  5. Require valid-user
  6. </Location>
  1. SECTION II - Digest Authentication
  2. The following example requires mod_auth_digest to work. Make sure you have
  3. installed and enabled it in /etc/apache2/httpd.conf
  4. Do not forget to replace www.example.com as appropriate. You can also add as
  5. many domains as you need to this line.
  6. Add your AWStats users to /etc/awstats/.htdigest file. Please see 'man
  7. htdigest2' and http://httpd.apache.org/docs-2.0/mod/mod_auth_digest.html for
  8. more details if you need.
  9. htdigest2 -c /etc/awstats/.htdigest "AWStats authenticated zone" username1
  10. htdigest2 /etc/awstats/.htdigest "AWStats authenticated zone" username2
  11. etc...
  1. <Location "/cgi-bin/awstats.pl">
  2. AuthType Digest
  3. AuthName "AWStats authenticated zone"
  4. AuthDigestFile /etc/awstats/.htdigest
  5. AuthDigestDomain http://www.example.com https://www.example.com
  6. require valid-user
  7. # The following line is REQUIRED to work around a bug in MSIE.
  8. # See http://httpd.apache.org/docs-2.0/mod/mod_auth_digest.html
  9. BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
  10. </Directory>


  • Install completed - success