Eric

samedi mai 02, 2009

awstat statistique d'utilisation sous apache

awstat

# cd /export/home1/adm/source
# mkdir awstats
# cd awstats
# wget http://voxel.dl.sourceforge.net/sourceforge/awstats/awstats-6.9.tar.gz
# su - user1
$ cp /export/home1/adm/source/awstats/awstats-6.9.tar.gz htdocs/awstats/
$ cd htdocs/awstats
$ gunzip awstats-6.9.tar.gz
$ tar xvf awstats-6.9.tar
$ rm awstats-6.9.tar
$ exit
  • Configuration de awstats
    • Adjuster les logs au format combined. (CustomLog)
      # vi /opt/coolstack/apache2/conf/httpd.conf
      <IfModule log_config_module>
          #
          # The following directives define some format nicknames for use with
          # a CustomLog directive (see below).
          #
          LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
          LogFormat "%h %l %u %t \"%r\" %>s %b" common
      
          <IfModule logio_module>
            # You need to enable mod_logio.c to use %I and %O
            LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
          </IfModule>
      
          #
          # The location and format of the access logfile (Common Logfile Format).
          # If you do not define any access logfiles within a <VirtualHost>
      
          # container, they will be logged here.  Contrariwise, if you *do*
          # define per-<VirtualHost> access logfiles, transactions will be
          # logged therein and *not* in this file.
          #
          #CustomLog logs/access_log common
      
          #
          # If you prefer a logfile with access, agent, and referer information
          # (Combined Logfile Format) you can use the following directive.
          #
          CustomLog logs/access_log combined
      </IfModule>
      
  • Ajouter les Alias pour le web.
    # vi /opt/coolstack/apache2/conf/extra/httpd-awstats.conf
    
    # Cants.org/GNU
    # Config fait par Eric Cantin
    #
    Alias /awstatsclasses "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/classes/"
    Alias /awstatscss "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/css/"
    Alias /awstatsicons "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/icon/"
    ScriptAlias /awstats/ "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/cgi-bin/"
    #
    # This is to permit URL access to scripts/files in AWStats directory.
    #
    <Directory "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    
  • Inclure la configuration de awstats dans httpd.conf
    # vi /opt/coolstack/apache2/conf/httpd.conf
    
    
  • Ajouter à la fin du fichier.
    # awstats-6.9
    Include conf/extra/httpd-awstats.conf
    
  • Créer la configuration du site.
    # su - user1
    $ cd htdocs/awstats/awstats-6.9/wwwroot/cgi-bin
    $ cp awstats.model.conf awstats.www.modomaine.conf
    $ chmod 755 awstats.www.mondomaine.conf
    
  • Modifier la configuration du site.
    $ vi awstats.www.mondomaine.conf
    
    LogFile="/var/log/httpd/mylog.log"
    LogFile="/opt/coolstack/apache2/logs/access_log"
    SiteDomain=""
    SiteDomain="www.mondomaine"
    DNSLookup=2
    DNSLookup=1
    DirData="."
    DirData="/export/home1/daemons/apache/htdocs/awstats/logs"
    DirIcons="/icon"
    DirIcons="/awstatsicons"
    
$ mkdir /export/home1/daemons/apache/htdocs/awstats/logs
$ chmod -R 777 /export/home1/daemons/apache/htdocs/awstats/logs
$ exit
  • Redémarrer apache-2.2
    # svcadm restart svc:/network/http:apache22-csk
    

Premier démarrage

  • Première execution
    # su - user1
    $ /export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/cgi-bin/awstats.pl -config=www.mondomaine -update
    
  • Ajouter la tâche au cron
    # su - user1
    $ crontab -e
    25,55 * * * * /export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/cgi-bin/awstats.pl -config=www.mondomaine -update > /dev/null 2>&1
    

samedi juil. 14, 2007

afficher du code dans une page web

Comment faire pour afficher du code dans une page web.
Il suffit de remplacer le caractère par le code.

"Special" Character Entity References
      
   &lt;      -  <      &gt;      -    >
   &amp;     -  &      &quot;    -    " 
      
HTML 2.0 Standard Entity References 
      
   &AElig;   -  Æ      &Aacute;  -  Á      &Acirc;   -  Â 
   &Agrave;  -  À      &Aring;   -  Å      &Atilde;  -  Ã 
   &Auml;    -  Ä      &Ccedil;  -  Ç      &ETH;     -  Ð 
   &Eacute;  -  É      &Ecirc;   -  Ê      &Egrave;  -  È 
   &Euml;    -  Ë      &Iacute;  -  Í      &Icirc;   -  Î 
   &Igrave;  -  Ì      &Iuml;    -  Ï      &Ntilde;  -  Ñ 
   &Oacute;  -  Ó      &Ocirc;   -  Ô      &Ograve;  -  Ò
   &Oslash;  -  Ø      &Otilde;  -  Õ      &Ouml;    -  Ö 
   &THORN;   -  Þ      &Uacute;  -  Ú      &Ucirc;   -  Û 
   &Ugrave;  -  Ù      &Uuml;    -  Ü      &Yacute;  -  Ý 
   &aacute;  -  á      &acirc;   -  â      &aelig;   -  æ 
   &agrave;  -  à      &aring;   -  å      &atilde;  -  ã 
   &auml;    -  ä      &ccedil;  -  ç      &eacute;  -  é 
   &ecirc;   -  ê      &egrave;  -  è      &eth;     -  ð 
   &euml;    -  ë      &iacute;  -  í      &icirc;   -  î 
   &igrave;  -  ì      &iuml;    -  ï      &ntilde;  -  ñ 
   &oacute;  -  ó      &ocirc;   -  ô      &ograve;  -  ò 
   &oslash;  -  ø      &otilde;  -  õ      &ouml;    -  ö 
   &szlig;   -  ß      &thorn;   -  þ      &uacute;  -  ú 
   &ucirc;   -  û      &ugrave;  -  ù      &uuml;    -  ü 
   &yacute;  -  ý      &yuml;    -  ÿ      
      

Entities Added with HTML 3.2
      
   &nbsp;    -         &iexcl;   -  ¡      &pound;   -  £
   &curren;  -  ¤      &yen;     -  ¥      &brvbar;  -  ¦
   &sect;    -  §      &uml;     -  ¨      &copy;    -  ©
   &ordf;    -  ª      &laquo;   -  «      &not;     -  ¬
   &shy;     -  ­      &reg;     -  ®      &macr;    -  ¯
   &deg;     -  °      &plusmn;  -  ±      &sup2;    -  ²
   &sup3;    -  ³      &acute;   -  ´      &micro;   -  µ
   &para;    -  ¶      &middot;  -  ·      &cedil;   -  ¸
   &sup1;    -  ¹      &ordm;    -  º      &raquo;   -  »
   &frac14;  -  ¼      &frac12;  -  ½      &frac34;  -  ¾
   &iquest;  -  ¿
      

Additional Widely Implemented Entities
      
   &times;   -  ×
   &divide;  -  ÷
   &cent;    -  ¢

samedi juin 09, 2007

Page web qui liste le contenue du répertoire


";
echo "";
echo "Techno-Linux";
echo "";
echo "";
echo "";
echo "Techno-Linux

"; setlocale(LC_TIME, 'fr_CA.UTF-8'); date_default_timezone_set("America/Montreal"); echo "Le TIMEZONE est:"; echo ""; echo date_default_timezone_get(); echo ""; echo "
"; echo strftime("%A %d %B %Y %R", mktime()); echo "
"; closedir($dir); if($tri == 'DESC'){ rsort($Array); }else{ sort($Array); } $Max = count($Array); for($i = 0; $i != $Max; $i++){ echo "$Array[$i]
"; } // affiche le nombre de fichiers dans le r?pertoire // echo "

".$Max." fichier(s)" ; } // utilisation de la fonction // param.1 : chemin du r?pertoire ("." si il s'agit du r?p. courant) // param.2 : ASC ou DESC (A-Z ou Z-A) DirTri(".","ASC"); echo ""; echo ""; echo ""; */ ?>

Calendar

Feeds

Search

Links

Navigation

Referrers