Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 08/02/2013, à 15:09

sharing

proftpd ratio réinitialiser :(

Bonjour la communauté !
j'ai créé un serveur FTP avec proftpd qui marche niquel, 
mais il y a quand meme un ch'tit probleme avec le ratio,
a chaque déconnections le ratio ce remet a zero,
cela fait une semaine que je cherche sur le site de proftp et sur ubuntu
et pas moyen de trouvé la solution !!!
voici ce que j'ai programmé:

ModulePath /usr/lib/proftpd
LoadModule mod_ctrls_admin.c
LoadModule mod_tls.c
LoadModule mod_radius.c
LoadModule mod_quotatab.c
LoadModule mod_quotatab_file.c
LoadModule mod_quotatab_radius.c
LoadModule mod_wrap.c
LoadModule mod_rewrite.c
LoadModule mod_load.c
LoadModule mod_ban.c
LoadModule mod_wrap2.c
LoadModule mod_wrap2_file.c
LoadModule mod_dynmasq.c
LoadModule mod_exec.c
LoadModule mod_shaper.c
LoadModule mod_ratio.c
LoadModule mod_site_misc.c
LoadModule mod_sftp.c
LoadModule mod_sftp_pam.c
LoadModule mod_facl.c
LoadModule mod_unique_id.c
LoadModule mod_copy.c
LoadModule mod_deflate.c
LoadModule mod_ifversion.c
LoadModule mod_tls_memcache.c
LoadModule mod_ifsession.c
ServerType standalone
DefaultServer on
Umask 022
ServerName "0.0.0.0"
ServerIdent on "My FTP Server"
ServerAdmin email@example.org
IdentLookups on
UseReverseDNS on
Port 21
PassivePorts 49152 65534
#MasqueradeAddress None
TimesGMT off
MaxInstances 30
MaxLoginAttempts 3
TimeoutLogin 300
TimeoutNoTransfer 120
TimeoutIdle 120
DisplayLogin welcome.msg
DisplayChdir .message
User nobody
Group nobody
DirFakeUser on nobody
DirFakeGroup on nobody
DefaultTransferMode binary
AllowForeignAddress off
AllowRetrieveRestart on
AllowStoreRestart on
DeleteAbortedStores on
TransferRate RETR 999999
TransferRate STOR 999999
TransferRate STOU 999999
TransferRate APPE 999999
SystemLog /var/log/secure
RequireValidShell off
<IfModule mod_auth_pam.c>
AuthPAM off
</IfModule>
AuthUserFile /etc/gadmin-proftpd/users/proftpd.passwd
AuthGroupFile /etc/gadmin-proftpd/users/proftpd.group
<IfModule mod_auth_pam.c>
AuthPAM off
</IfModule>
AuthUserFile /etc/gadmin-proftpd/users/proftpd.passwd
AuthGroupFile /etc/gadmin-proftpd/users/proftpd.group
<IfModule mod_tls.c>
TLSEngine on
TLSRequired off
TLSVerifyClient off
TLSProtocol SSLv23
TLSLog /var/log/proftpd_tls.log
TLSRSACertificateFile /etc/gadmin-proftpd/certs/cert.pem
TLSRSACertificateKeyFile /etc/gadmin-proftpd/certs/key.pem
TLSCACertificateFile /etc/gadmin-proftpd/certs/cacert.pem
TLSRenegotiate required off
TLSOptions AllowClientRenegotiation
</IfModule>
<IfModule mod_ratio.c>
Ratios on
SaveRatios on
RatioFile "/restricted/proftpd_ratios"
RatioTempFile "/restricted/proftpd_ratios_temp"
CwdRatioMsg "Please upload first!"
FileRatioErrMsg "FileRatio limit exceeded, upload something first..."
ByteRatioErrMsg "ByteRatio limit exceeded, upload something first..."
LeechRatioMsg "Your ratio is unlimited."
</IfModule>
<Limit LOGIN>
  AllowUser testeur
  DenyALL
</Limit>

<Anonymous /home/sharing>
User testeur
Group ftpuser
AnonRequirePassword on
MaxClients 1 "The server is full, hosting %m users"
DisplayLogin welcome.msg
DisplayChdir .msg
UserRatio testeur 0 0 3 0
<Limit LOGIN>
Allow from All
Deny from all
</Limit>
AllowOverwrite off
<Limit LIST NLST  STOR STOU  RETR  PWD XPWD  SIZE  STAT  CWD XCWD  CDUP XCUP >
 AllowAll
</Limit>
<Limit APPE  RNFR RNTO  DELE  MKD XMKD SITE_MKDIR  RMD XRMD SITE_RMDIR  SITE  SITE_CHMOD  SITE_CHGRP  MTDM >
 DenyAll
</Limit>
</Anonymous>

HELP ME PLEASE !!!

Dernière modification par sharing (Le 09/02/2013, à 17:30)

Hors ligne

#2 Le 08/02/2013, à 16:17

Maisondouf

Re : proftpd ratio réinitialiser :(

Quand tu inclus dans ton message un fichier ou un résultat de commande, il faut que tu utilises les balises 'code' que tu peux sélectionner automatiquement à l'aide des deux petits crochets bleus '<>' au dessus.
CODE
Ce sera beaucoup plus facile pour tout le monde et surtout les caractères sont plus lisibles

Dernière modification par Maisondouf (Le 08/02/2013, à 16:46)


ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor,  OS principal Precise 12.04.1 LTS 63bits½
Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains....
"the secret of my form is summed up in two words, no sport" (Winston Churchill)

Hors ligne

#3 Le 08/02/2013, à 16:22

sharing

Re : proftpd ratio réinitialiser :(

ok et voila c fait !! tongue

Hors ligne

#4 Le 08/02/2013, à 16:47

Maisondouf

Re : proftpd ratio réinitialiser :(

C'est du ratio upload/download que tu parles ?


ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor,  OS principal Precise 12.04.1 LTS 63bits½
Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains....
"the secret of my form is summed up in two words, no sport" (Winston Churchill)

Hors ligne

#5 Le 08/02/2013, à 16:50

sharing

Re : proftpd ratio réinitialiser :(

oui les clients upload des fichiers, le ratio marche bien, mais lorsque l'on ce deconnecte puis ce reconnecte au serveur le ratio c'est remis a zero !!!

Hors ligne

#6 Le 08/02/2013, à 16:58

Maisondouf

Re : proftpd ratio réinitialiser :(

J'ai trouvé un vieux fichier README pour la gestion des ratios, j'éspère que ça va t'aider.

mod_ratio.c - Ratio system module for ProFTPD - README

Copyright (c) 2002 James Dogopoulos <james@dynw.com>
Portions Copyright (c) 1998-1999 Johnie Ingram. <johnie@netgod.net>

-----------------------------------------------------------------------

LATEST CHANGES:

   * 2002-05-24: v3.3: Fixed numerous bugs and compatibility issues with
     changing code within ProFTPD. In other words, it /works/ again!
     Added default AnonRatio support (AnonRatio * ...).

-- See mod_ratio.c for previous version changes.


NOTES:

SaveRatios, RatioFile, RatioTempFile:

In order to have SaveRatios working properly, you must point
RatioFile and RatioTempFile to files that are read/writable for all
users that you wish to have ratios saved. If there is a problem
accessing the files, ProFTPD will revert back to the old per session
ratio method (u/l d/l stats will be forgotten on disconnect).

touch and chmod both files to allow r/w from all users whos ratios
will be saved. Enable ratios, users are added to the ratios file as
they log in and stat tracking begins.

If you are using DefaultRoot along with this command, the Ratio files
will need to be stored within the Root directory. One easy way is to
create a sub-directory off of DefaultRoot that is rwx by all users
and then restrict ALL access to these directorys within ProFTPD...

   <Directory /workdir>
      <Limit ALL>
      Deny ALL
      </Limit>
   HideNoAccess
   </Directory>


INSTALLATION:

To install, cconfigure it with ProFTPD like so,
./configure --with-modules=mod_ratio

This module is inactive unless configured, which can be done with an
Anonymous, Directory, or VirtualHost block in proftpd.conf, or with a
.ftpaccess file. (Ratios must be turned on elsewhere for a directive in
.ftpaccess to take effect.)

If compiled with -DMOD_MYSQL_RATIOS, this module can get and set session
stats using mod_mysql, so the only directive needed is "Ratios on". This
acts like a weak "UserRatio" -- any directive described below can override
it. It also makes multiple concurrent uploads/downloads possible, with
persistent credits. See mod_mysql docs for setup details. Most ratio
directives take four numbers: file ratio, initial file credit, byte ratio,
and initial byte credit. Setting either ratio to 0 disables that check:
FooRatio bar [frate] [fcred] [brate] [bcred] The directives are HostRatio
(matches FQDN -- wildcards are allowed in this one), AnonRatio (matches
password entered in an anon login, usually an email address), UserRatio
(accepts "*" for 'any user'), and GroupRatio. Matches are looked for in
that order. Some examples:

Ratios on            # enable module

SaveRatios on            # Save ratios in plain text.
                 READ Above.

RatioFile "/path/tofile"      # Required for SaveRatios
RatioTempFile "/path/tofile"      # Required for SaveRatios

CwdRatioMsg "Please Upload!"      # Displayed after every directory
                 change.

UserRatio ftp 0 0 0 0
HostRatio master.debian.org 0 0 0 0    # leech access (default)

GroupRatio proftpd 100 10 5 100000    # 100:1 files, 10 file cred 5:1
                 bytes, 100k byte cred

AnonRatio billg@microsoft.com 1 0 1 0    # 1:1 ratio, no credits
UserRatio * 5 5 5 5000         # special default case

FileRatioErrMsg "Come on you can send more files than that...."
ByteRatioErrMsg "This file is %i big, you know...."
LeechRatioMsg "Access: Unlimited"


UserRatio Directive Examples:

The UserRatio command controls the initial ratios and credits for all
users on the system. The format is:

UserRatio username FILERATIO FILECREDITS BYTERATIO BYTECREDITS(kB)

So "UserRatio * 0 0 3 10000" would give all users the default of
10000k bytes credit (9.7mb) and a 1:3 byte ratio, which will give the
user 3 bytes of creadit for every 1 byte uploaded.

Specifying a ratio as a negative number will swap the ratio, for
instance... "UserRatio jd 0 0 -3 0" would give the user jd a 3:1 byte
ratio, requiring jd to upload 3 bytes for every 1 byte he downloads.

Here's a multi-user anonymous ratio example:

AnonRatio                       james@dynw.com 0 0 3 50000
AnonRatio                       * 0 0 3 10000

If someone logs in with anonymous and gives the e-mail address of
james@dynw.com, they will get 48MB credit. Everyone else will get 9MB.
It's important to put the individual users BEFORE the global "*" command
directive or else they will not take effect.



MORE Notes:

Setting "Ratios on" without configuring anything else will enable leech
mode: it logs activity and sends status messages to the ftp client, but
doesn't restrict traffic. Ratio module activity is recorded to syslog at
DEBUG0; it usually shows up in /var/log/debug, like this: foo in /: CWD
/foo :-15/3450 +0/0 (my 5 15 5 15000) =0/146 [NO F] This example is
for someone who (1) has downloaded 15 files totalling 14mb, (2) has
uploaded nothing, (3) has a ratio of 5:1 files and 15:1 bytes, (4) has
0 files and 146k credit remaining, (5) got the ratio from the MySQL
record ("my") and (6) is changing directory from / to /foo. Note that
if this module is turned on globally, any user can create a personal
ratio area with a .ftpaccess file. One way to prevent this is with:
PathDenyFilter "\.ftpaccess$"


DISCLAIMER:

The authors of this module, this ProFTPD software, and this OS and
kernel disclaim all warranties and are not responsible for what random
users of this module may do.

ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor,  OS principal Precise 12.04.1 LTS 63bits½
Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains....
"the secret of my form is summed up in two words, no sport" (Winston Churchill)

Hors ligne

#7 Le 08/02/2013, à 17:03

sharing

Re : proftpd ratio réinitialiser :(

a ouai ça a l'air intéressant je teste de suite merci wink

Hors ligne

#8 Le 08/02/2013, à 18:29

sharing

Re : proftpd ratio réinitialiser :(

bon ben non sad
j'y arrive toujours pas
si j'ai bien compris ce doc est ce qu'ils ont rectifier sur la derniere mise a jour,
ou alors j'ai rien compris j'ai comparer ce qu'ils ont modifier et apparament je suis bien a jour !
mais je ne suis pas sur d'avoir bien compris mon anglais est un peu rouiller hmm

Hors ligne

#9 Le 08/02/2013, à 19:22

Maisondouf

Re : proftpd ratio réinitialiser :(

D'après ce qu'ils disent, il faut mettre tes fichiers de sauvegarde de ratio à un endroit où proftpd a le droit d'écrire (et c'est logique)
Dans ta config tu as ça:

SaveRatios on
RatioFile "/restricted/proftpd_ratios"
RatioTempFile "/restricted/proftpd_ratios_temp"

C'est pas sûr du tout que ça fonctionne parce par définition "/restricted" n'existe pas dans un système Linux.
Crées un répertoire de sauvegarde où il peut écrire (j'ai mis 'ftp' comme utilisateur parce que je sais pas si proftpd s'en crée un pour lui, auquel cas remplace)

sudo mkdir /etc/proftpd/restricted
sudo chown ftp:ftp  /etc/proftpd/restricted

et mets ta config à jour:

SaveRatios on
RatioFile "/etc/proftpd/restricted/proftpd_ratios"
RatioTempFile "/etc/proftpd/restricted/proftpd_ratios_temp"

ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor,  OS principal Precise 12.04.1 LTS 63bits½
Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains....
"the secret of my form is summed up in two words, no sport" (Winston Churchill)

Hors ligne

#10 Le 08/02/2013, à 19:53

sharing

Re : proftpd ratio réinitialiser :(

non toujours pas !!!
par contre les deux fichiers proftpd_ratios_temp
et proftpd_ratios sont bien mis a jour !!
donc a mon avis le probleme ne vien pas de la neutral chelou quand meme !!
je dois passer a coté d'un truc tous con  c pas possible !!
une semaine que je me prend la tete avec ça !

Hors ligne

#11 Le 08/02/2013, à 22:42

Maisondouf

Re : proftpd ratio réinitialiser :(

C'est pas cette ligne qui cloche

UserRatio testeur 0 0 3 0

D'après ce que je pense, le fait d'avoir des valeurs nulles peut remettre à zéro les totaux.
0 fois n'importe quoi égale toujours 0
Dans le README, il semble y avoir un soupçon d'explication sur la signification de chaque chiffre

 # 100:1files, 10 file cred, 5:1bytes, 100k byte cred

Je l'interpréterais comme ça:
- rapport down/up  100 pour 1 fichier
- avec marge de 10 fichiers
- rapport down/up 5 pour 1 en octet
- avec marge de 100koctet

Je suis peut-être à l'ouest, mais on ne sait jamais....


ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor,  OS principal Precise 12.04.1 LTS 63bits½
Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains....
"the secret of my form is summed up in two words, no sport" (Winston Churchill)

Hors ligne

#12 Le 09/02/2013, à 05:56

sharing

Re : proftpd ratio réinitialiser :(

ça coute rien d'essayer ! je teste ça cet aprem !
merci de te prendre la tete wink

Hors ligne

#13 Le 09/02/2013, à 15:22

sharing

Re : proftpd ratio réinitialiser :(

non marche toujours pas ! enfin je m,en doutais un peu vu que le ratio marche bien temps que l'on reste connecter ! je continue de chercher big_smile

Dernière modification par sharing (Le 09/02/2013, à 15:23)

Hors ligne