System-Linux

Aller au contenu | Aller au menu | Aller à la recherche

Proftpd avec support mysql

Petite suite de cet article mais pour utiliser mysql

Pour la compilation avec support mysql :

./configure --prefix=/opt/proftpd131 --enable-openssl  --with-includes=/opt/mysql/include 
--with-libraries=/opt/mysql/lib --enable-ctrls --with-modules=mod_sql:mod_sql_mysql

Niveau configuration :

dans proftpd.conf ajouter ceci et faire les modification que vous désirez.

 ## SQL

 SQLConnectInfo                  database@localhost username password
 SQLAuthenticate                 users   groups
 SQLAuthTypes                    Crypt   Backend
 SQLUserInfo                     users userid passwd uid gid homedir shell
 SQLGroupInfo                    groups groupid gid members

 SQLLog                          PASS logincount
 SQLNamedQuery                   logincount UPDATE "login_count=login_count+1 WHERE userid='%u'" users
 SQLLog                          PASS lastlogin
 SQLNamedQuery                   lastlogin UPDATE "last_login=now() WHERE userid='%u'" users
 SQLLog RETR                     dlbytescount
 SQLNamedQuery                   dlbytescount UPDATE "dl_bytes=dl_bytes+%b WHERE userid='%u'" users
 SQLLog RETR                     dlcount
 SQLNamedQuery                   dlcount UPDATE "dl_count=dl_count+1 WHERE userid='%u'" users
 SQLLog STOR                     ulbytescount
 SQLNamedQuery                   ulbytescount UPDATE "ul_bytes=ul_bytes+%b WHERE userid='%u'" users
 SQLLog STOR                     ulcount
 SQLNamedQuery                   ulcount UPDATE "ul_count=ul_count+1 WHERE userid='%u'" users
 SQLUserWhereClause              "disabled!=1"
Par GanGan | le jeudi, janvier 29 2009 08:02