Gentoo:HowTos: diferència entre les revisions

De WikiMar
Salta a la navegació Salta a la cerca
Cap resum de modificació
(Contingut canviat per « Afegir AWSTATS a un VHost».)
Línia 1: Línia 1:
== PER AFEGIR AWSTATS A UN VHOST:  ==


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

Revisió del 18:29, 11 jul 2008