Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > cca1584ebe8ac1f9d9dba67a6aa8ebad > files > 7

apache-mod_stats-1.1-0.r2137.6mdv2010.0.i586.rpm

# mod_stats.c configuration example

<IfModule mod_stats.c>

    # These configuration directives are per directory.
    <Directory /srv/ftp/pub/download>
        # Statistics will be collected for this directory.
        # It is the directory containing the "projects".
        Stats On

        # Ignore files which do not match this regexp.
        StatsFileMask "\.(rpm|deb)$"

        # Debugging should only be enabled on specific subdirectories for testing,
        # because it is very extensive.
        StatsDebug Off

        # Hosts that are allowed to use ?cmd=... commands to add packages
        # or delete them
        StatsAdminHost 10.10.10.28
        StatsAdminHost 2001:780:101:a00:204:23ff:fea6:9458

        # required to enable ?cmd= commands
        FormGET On

    </Directory>

    # SQL statements to be prepared
    #
    # This configuration is per server.
    #
    StatsDBDQuery "\
    UPDATE redirect_stats \
    SET count=count+1, \
        counted_at=NOW() \
    WHERE project=%s \
          AND repository=%s \
          AND arch=%s \
          AND filename=%s \
          AND filetype=%s \
          AND version=%s \
          AND `release`=%s"

    StatsDBDSelectQuery "\
    SELECT \
        id \
    FROM \
        redirect_stats \
    WHERE \
        project=%s \
        AND repository=%s \
        AND arch=%s \
        AND filename=%s \
        AND filetype=%s \
        AND version=%s \
        AND `release`=%s"

    StatsDBDDeleteQuery "\
    DELETE \
    FROM \
        redirect_stats \
    WHERE \
        project=%s \
        AND repository=%s \
        AND arch=%s \
        AND filename=%s \
        AND filetype=%s \
        AND version=%s \
        AND `release`=%s"

    StatsDBDInsertQuery "\
    INSERT INTO \
        redirect_stats \
    SET \
        project=%s, \
        repository=%s, \
        arch=%s, \
        filename=%s, \
        filetype=%s, \
        version=%s, \
        `release`=%s, \
        counted_at=NOW(), \
        package=%s"

</IfModule>

# vim: set ft=apache ts=4 sw=4 ai expandtab smarttab: