• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • proftpd+mysql用戶認證+quota磁盤限額

    發表于:2007-05-25來源:作者:點擊數: 標簽:
    proftpd+mysql用戶認證+quota磁盤限額 整理編輯:mars(mars_diy@21cn.com) 網上關于proftpd的安裝文章實在是不少,我只是稍微整理了一下,并且使用了新的quota磁盤限額模塊 由于proftpd最新版1.2.8目前還是RC版,加上有些設置不能通用,所以在這里還是使用1.

    proftpd+mysql用戶認證+quota磁盤限額 

    整理編輯:mars (mars_diy@21cn.com) 

    網上關于proftpd的安裝文章實在是不少,我只是稍微整理了一下,并且使用了新的 quota磁盤限額模塊 

    由于proftpd最新版1.2.8目前還是RC版,加上有些設置不能通用, 所以在這里還是使用1.2.7版 

    首先下載源碼 
    proftpd1.2.7: 
    ftp://ftp.proftpd.org/distrib/sourc...d-1.2.7.tar.bz2 

    mod_quotatab-1.2.4 (1.2.5 版本的mod_quotatab是用在最新的1.2.8rc1上的) 
    http://www.castaglia.org/proftpd/mo...ab-1.2.4.tar.gz 

    假定你的機器上已經安裝好了mysql 
    開始編譯安裝 
    將proftpd的源碼包解壓縮到某臨時目錄下: 
    localhost proftpd # tar -jxvf proftpd-1.2.7.tar.bz2 
    解壓縮 mod_quotatab-1.2.4 
    localhost proftpd # tar -zxvf proftpd-mod-quotatab-1.2.4.tar.gz 
    進入 mod_quotatab 目錄 
    localhost proftpd # cd mod_quotatab 
    把mod_quotatab中的文件拷貝到 proftpd 中的modules 目錄中 
    localhost mod_quotatab # cp * ../proftpd-1.2.7/modules 

    在開始運行configure之前,我們要先改動一個文件 
    進入 proftpd-1.2.7/contrib 目錄 
    localhost mod_quotatab # cd ../proftpd-1.2.7/contrib 
    修改 mod_sql_mysql.c 
    localhost contrib # vi mod_sql_mysql.c 
    找到#include <mysql/mysql.h> 把他該為你實際路徑 
    如果你的mysql 安裝在 /usr/local/mysql 下,就把它修改為#include </usr/local/mysql/include/mysql/mysql.h>r 
    然后 
    localhost contrib # cd .. 
    localhost proftpd-1.2.7 # cd .. 
    localhost proftpd #./configure --prefix=DIR --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-includes=DIR --with-libraries=DIR 
    需要修改的三個地方 
    --prefix=DIR 你要安裝到哪里 
    --with-includes=DIR mysql 的includes 目錄 
    --with-libraries=DIR mysql 的lib 目錄 
    然后 
    make 
    make install 完成安裝 

    接下來,進入你安裝好的proftpd目錄 ,修改etc/proftpd.conf 文件開始配置 
    基本配置我就不多說了,網上這類文章有很多,實在不會的話,自己找找就是了,這里主要介紹如何配置mysql用戶認證和磁盤限額 

    mysql 用戶認證部分: 
    在proftpd.conf中加入以下內容 

    #設置MySQL認證: 
    #數據庫聯接的信息,DatabaseName是數據庫名, HostName是主機名, 
    #Port是端口號,UserName是連接數據庫的用戶名,Password是密碼。 
    SQLConnectInfo DatabaseName@HostName:port UserName Password 

    #數據庫認證的類型: 
    SQLAuthTypes Backend Plaintext 

    #指定用來做用戶認證的表的有關信息。("FTPUSERS"和"FTPGRPS"是數據表名字,等一會而在下面建立) 
    SQLUserInfo FTPUSERS userid passwd uid gid homedir shell 

    SQLGroupInfo FTPGRPS groupname gid members 

    #設置如果shell為空時允許用戶登錄: 
    RequireValidShell off 

    #數據庫的鑒別 
    SQLAuthenticate users groups usersetfast groupsetfast 

    #如果home目錄不存在,則系統會為根據它的home項新建一個目錄: 
    SQLHomedirOnDemand on 

    然后在這個數據庫中建立一個用戶表FTPUSERS,這個表是必須的: 

    use FTP; 
    create table FTPUSERS ( 
    userid TEXT NOT NULL, 
    passwd TEXT NOT NULL, 
    uid INT NOT NULL, 
    gid INT NOT NULL, 
    home TEXT, 
    shell TEXT 
    ); 
    此表格是為了用戶認證所需要的,其中userid、passwd是必不可少的,userid是用做FTP服務的用戶名;passwd是指此用戶的密碼;uid是系統用戶的ID,也就是所映射的系統用戶;gid是所屬系統組的ID;home是該用戶所在的HOME目錄;shell可以為該用戶指定相應的shell。當然你可以建立更多的字段,例如:用來記錄用戶登錄次數的count,或者是日期的date,如果你對配置熟悉了之后,你可以根據自己的喜歡添加更多的功能。在此就不多講。 
    3、如果你想需要所有的功能,你還可以添加另外一個需要的表:FTPGRPS,也就是確定組的表格,當然也可以不用,這里講一個它的格式: 
    create table FTPGRPS ( 
    grpname TEXT NOT NULL, 
    gid SMALLINT NOT NULL, 
    members TEXT NOT NULL, 
    ); 
    其中grpname是組的名稱,gid是系統組的ID,members是組的成員。注意:多成員,他們之間要用逗號隔開,不能使用空格。 

    4、為空表格插入記錄: 
    INSERT INTO FTPUSERS (userid, passwd, uid, gid, home, shell) 
    valueS ('user1', '999999', '1000', '1000', '/home/FTP/user1', '' ); 

    按此格式你可以插入這每一個用戶添加一個記錄。 
    如果你要想應用到更多的功能,且建立了組的表格,你也要為此添加記錄,不過一定要注意在members的字段多個成員一定要用逗號隔開。 

    INSERT INTO FTPGRPS VALUES ('FTPGRPS', 1000, 'FTPUSR'); 
    四、為FTP用戶建立相應的系統用戶。 
    在本例中,只整個FTP服務只提供一個有效的系統用戶FTPUSR和組FTPGRP,當然你也可以設置多個系統用戶。但出于安全的考慮,我只設一個,用他來啟動FTP daemon,并把所有的FTP用戶映射過這個用戶。 

    先建立FTPGRP組: 
    groupadd -g 1000 -r FTPGRP 
    建立FTPUSR用戶: 
    adduser -u 1000 -g 1000 -d /home/FTP -s /bin/bash -r FTPUSR 

    為FTPUSR建立HOME,把所有的FTP user 活動空間全放在此目錄下: 
    mkdir /home/FTP 
    chown FTPUSR /home/FTP 
    chgrp FTPGRP /home/FTP 

    到這里MYSQL認證部分就算基本配置好了,接下來是磁盤限額部分 

    首先,還是編輯proftpd文件 

    #磁盤限額部分 
    QuotaDirectoryTally on 

    #磁盤限額單位 b"|"Kb"|"Mb"|"Gb" 
    QuotaDisplayUnits "Kb" 

    QuotaEngine on 

    #磁盤限額日志記錄 
    QuotaLog "你的LOG路徑" 

    # 打開磁盤限額信息,當登陸FTP帳戶后,使用命令 "quote SITE QUOTA" 后可顯示當前用戶的磁盤限額 
    QuotaShowQuotas on 

    #以下是SQL調用語句,不用修改直接拷貝過去 

    SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, \ 
    bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM quotalimits \ 
    WHERE name = '%{0}' AND quota_type = '%{1}'" 

    SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, \ 
    bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM quotatallies \ 
    WHERE name = '%{0}' AND quota_type = '%{1}'" 

    SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, \ 
    bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, \ 
    files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, \ 
    files_xfer_used = files_xfer_used + %{5} \ 
    WHERE name = '%{6}' AND quota_type = '%{7}'" quotatallies 

    SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" quotatallies 

    QuotaLimitTable sql:/get-quota-limit 
    QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally 

    然后建立mysql 數據表 
    CREATE TABLE quotalimits ( 
    name VARCHAR(30), 
    quota_type ENUM("user", "group", "class", "all") NOT NULL, 
    per_session ENUM("false", "true") NOT NULL, 
    limit_type ENUM("soft", "hard") NOT NULL, 
    bytes_in_avail FLOAT NOT NULL, 
    bytes_out_avail FLOAT NOT NULL, 
    bytes_xfer_avail FLOAT NOT NULL, 
    files_in_avail INT UNSIGNED NOT NULL, 
    files_out_avail INT UNSIGNED NOT NULL, 
    files_xfer_avail INT UNSIGNED NOT NULL 
    ); 

    CREATE TABLE quotatallies ( 
    name VARCHAR(30) NOT NULL, 
    quota_type ENUM("user", "group", "class", "all") NOT NULL, 
    bytes_in_used FLOAT NOT NULL, 
    bytes_out_used FLOAT NOT NULL, 
    bytes_xfer_used FLOAT NOT NULL, 
    files_in_used INT UNSIGNED NOT NULL, 
    files_out_used INT UNSIGNED NOT NULL, 
    files_xfer_used INT UNSIGNED NOT NULL 
    ); 

    說明一下,quotatallies表不需要作修改,它記錄了用戶當前的磁盤使用情況,由程序自動記錄 
    要注意的是quotalimits 表中一些字段的含意 
    quota_type 磁盤限額的鑒別,可以設置單各用戶,也可以設置一各組中的全部用戶,還可以設置全部用戶 
    bytes_in_avail 上傳最大字節數,就是FTP用戶空間容量 (設置個字段的時候是以byte(字節)為單位,如果要限額在10M,那就是10240000,下面也一樣) 
    bytes_out_avail 下載最大字節數,需要注意的是,這個字段中記錄的是用戶總共能從服務器上下載多少數據,數據是累計的。 
    bytes_xfer_avail 總共可傳輸的文件的最大字節數(上傳和下載流量)需要注意的是,這個字段中記錄的是用戶總共能傳輸文件的最大字節數,數據是累計的。 
    files_in_avail INT 總共能上傳文件的數目 
    files_out_avail INT 能從服務器上下載文件的總數目 
    files_xfer_avail INT 總共可傳輸文件的數目(上傳和下載) 

    好了,開始使用磁盤限額,我們要將上面建立的user1帳號給予10M空間,最多能上傳500個文件到服務器上,文件傳輸流量為20M,只能傳輸10個文件。只要在MYSQL中 
    插入 
    INSERT INTO `quotalimits` ( `name` , `quota_type` , `per_session` , `limit_type` , `bytes_in_avail` , `bytes_out_avail` , `bytes_xfer_avail` , `files_in_avail` , `files_out_avail` , `files_xfer_avail` ) 
    VALUES ('user1', 'user', 'false', 'soft', '10240000', '0', '2048000', '500', '0', '10'); 
    就可以了,不需要設置的部分用0代替就可以了 
    現在運行proftpd,登陸到user1 ,使用quote SITE QUOTA 就會顯示user1用戶的磁盤使用情況 

    ftp> quote SITE QUOTA 
    200-The current quota for this session are [current/limit]: 
    Name: user1 
    Quota Type: User 
    Per Session: False 
    Limit Type: Soft 
    Uploaded Kb: 0.00/10000.00 
    Downloaded Kb: unlimited 
    Transferred Kb: 0.00/2000.00 
    Uploaded files: 0/500 
    Downloaded files: unlimited 
    Transferred files: 0/10 
    200 Please contact root@localhost if these entries are inaccurate 

    OK,安裝完畢


    (轉)

    <progress id="5koa6"></progress>

  •  白狐貍 回復于:2003-01-18 12:01:45
    天啊,又是抱錯,我該怎么辦
    Proftpd-1.2.7.tar.gz
    proftpd-mod-quotatab-1.2.4.tar.gz 
    Mysql- 3.23.41 (已安裝在/usr/local/mysql)

    在make的時候出錯,錯誤代碼:
    /usr/libexec/elf/ld: cannot find -lmysqlclient
    *** Error code 1

    Stop in /usr/local/src/proftpd-1.2.7.

    在google上查找mysqlclient,也得到什么結果,郁悶啊

     白狐貍 回復于:2003-01-18 17:35:15
    proftpd+mysql用戶認證已經搞定,但就是加不上quota功能

     wind521 回復于:2003-01-18 20:09:55
    [quote:ee9f7b41f5="白狐貍"]天啊,又是抱錯,我該怎么辦
    Proftpd-1.2.7.tar.gz
    proftpd-mod-quotatab-1.2.4.tar.gz 
    Mysql- 3.23.41 (已安裝在/usr/local/mysql)

    在make的時候出錯,錯誤代碼:
    /usr/libexec/elf/ld: cannot find -lmy..........[/quote:ee9f7b41f5]

    機器有mysql的client端的程序嗎?

     nbpanda 回復于:2003-01-21 10:20:37
    [quote:f57028f8af="白狐貍"]proftpd+mysql用戶認證已經搞定,但就是加不上quota功能[/quote:f57028f8af]

    我也是 quota 功能加不上去,quote SITE QUOTA 回答如下:
        No quotas in effect

     nbpanda 回復于:2003-01-21 11:00:07
    已經做好,但是這個quota 的功能沒有 系統的quota 來的好,一個可以立刻阻斷,比較好

     白狐貍 回復于:2003-01-21 11:49:21
    proftpd+mysql用戶認證方式我在FreeBSD4.6上配置成功了,但用同樣的方法卻在4.7和5.0上卻出錯,錯誤代碼為:
    用/usr/local/ftp/sbin/proftpd -n 來起動ftp服務時,提示下面的 錯誤 
    /usr/local/ftp/sbin/proftpd: error while loading shared libraries: libmysqlclient.so.10: cannot open shared object file: No such file or directory

     o葉大馬猴 回復于:2003-01-21 11:53:22
    [quote:f2b8e5d83c="白狐貍"]proftpd+mysql用戶認證方式我在FreeBSD4.6上配置成功了,但用同樣的方法卻在4.7和5.0上卻出錯,錯誤代碼為:
    用/usr/local/ftp/sbin/proftpd -n 來起動ftp服務時,提示下面的 錯誤 
    /usr/local/ftp/sbin/proftpd: e..........[/quote:f2b8e5d83c]
     

    少了個文件....
    有關  mysqlclient的...

     白狐貍 回復于:2003-01-21 11:55:06
    配置使Proftpd支持MySQL認證: 
    #./configure --prefix=/usr/local/proftpd \
    --with-modules=mod_sql:mod_sql_mysql \ 
    --with-includes=/usr/local/mysql/include/mysql \ 
    --with-libraries=/usr/local/mysql/lib/mysql 
    # make 
    # make install

    應該不會出現找不到的情況啊,我mysql裝在/usr/local/mysql,并且運行良好,怎么回事啊,在4.6上就沒這個問題啊,libmysqlclient.so.10這個文件在/usr/local/mysql/lib/mysql/libmysqlclient.so.10,也是存在的呀

     白狐貍 回復于:2003-01-22 23:02:27
    安裝mysql時,將mysql庫所在的目錄添加進配置文件中,例如 
    echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf 
    然后執行ldconfig -v|grep libmysqlclient ,再試試!



    所有問題得到解決,用起來的感覺就是爽,更重要的是你還可以在數據庫添加更多的功能和記錄更多的記錄啊,謝謝

     luj 回復于:2003-01-29 21:33:00
    我的QUOTA加上去不能登陸,報錯421 Service not available,remote server has closed connection Login failed 
    不加QUOTA沒事,是什么原因??可以把你們成功的proftpd.conf發給我參考一下嗎,急
    E-MAIL:luj@xxsb.com

     白狐貍 回復于:2003-02-08 10:08:01
    現在偶把偶的proftpd配置文件貼出來,希望對你有所幫助,嘿嘿

    ServerName "白狐貍's  FTP Server" 
    ServerType standalone
    DefaultServer on

    # Port 21 is the standard FTP port.
    Port 21

    # Umask 022 is a good standard umask to prevent new dirs and files
    # from being group and world writable.
    Umask 022

    #limit the user in his owner directory
    DefaultRoot                     ~

    #put the proftpd log files in /var/log/ftp.syslog
    SystemLog                       /var/log/ftp.syslog 

    #TransferLog log files
    TransferLog                     /var/log/ftp.transferlog

    #set The maxtimes user Attempts times 
    MaxLoginAttempts                 3

    #setup the Restart 
    AllowRetrieveRestart             on

    #setup the download and upload speed
    RateReadBPS                      80000 
    RateWriteBPS                     80000

    #setup the disk quota
    QuotaDirectoryTally              on

    #quota  b"|"Kb"|"Mb"|"Gb" 
    #setup the disk quota
    QuotaDirectoryTally              on

    #quota  b"|"Kb"|"Mb"|"Gb"
    QuotaDisplayUnits               Kb
    QuotaEngine                       on
    QuotaLog                            /var/ftp/Quota.log
    QuotaShowQuotas             on


    # We put our mod_sql directives in a <Global> block so they'll be
    # inherited by the <Anonymous> block below, and any other <VirtualHost>
    # blocks we may want to add.  For a simple server these don't need to
    # be in a <Global> block but it won't hurt anything.
    <Global>

    # Specify our connection information.  Both mod_sql_mysql and
    # mod_sql_postgres use the same format, other backends may specify a
    # different format for the first argument to SQLConnectInfo.  By not
    # specifying a fourth argument, we're defaulting to 'PERSESSION'
    # connections -- a connection is made to the database at the start of
    # the session and closed at the end.  This should be fine for most
    # situations. 

    #  SQLConnectInfo dbname@host:port username password
       SQLConnectInfo ftp@localhost:3306 root 12345678

    # Specify our authentication schemes.  Assuming we're using
    # mod_sql_mysql, here we're saying 'first try to authenticate using
    # mysql's password scheme, then try to authenticate the user's
    # password as plaintext'.  Note that 'Plaintext' isn't a smart way to
    # store passwords unless you've got your database well secured.
      SQLAuthTypes Backend Plaintext

    # Specify the table and fields for user information.  If you've
    # created the database as it specifies in 'README.mod_sql', you don't
    # need to have this directive at all UNLESS you've elected not to
    # create some fields.  In this case we're telling mod_sql to look in
    # table 'users' for the fields 'username','password','uid', and
    # 'gid'.  The 'homedir' and 'shell' fields are specified as 'NULL' --
    # this will be explained below.

    #  SQLUserInfo users username password uid gid NULL NULL
       SQLUserInfo ftpusers userid passwd uid gid home shell


    # Here we tell mod_sql that every user it authenticates should have
    # the same home directory.  A much more common option would be to
    # specify a homedir in the database and leave this directive out. Note
    # that this directive is necessary in this case because we specified
    # the homedir field as 'NULL', above.  mod_sql needs to get homedir
    # information from *somewhere*, otherwise it will not allow access.

    #  SQLDefaultHomedir "/tmp"

    # This is not a mod_sql specific directive, but it's here because of
    # the way we specified 'SQLUserInfo', above.  By setting this to
    # 'off', we're telling ProFTPD to allow users to connect even if we
    # have no (or bad) shell information for them.  Since we specified the
    # shell field as 'NULL', above, we need to tell ProFTPD to allow the
    # users in even though their shell doesn't exist.

      RequireValidShell off

    # Here we tell mod_sql how to get out group information.  By leaving
    # this commented out, we're telling mod_sql to go ahead and use the
    # defaults for the tablename and all the field names.
    # SQLGroupInfo groups groupname gid members

    # For small sites, the following directive will speed up queries at
    # the cost of some memory.  Larger sites should read the complete
    # description of the 'SQLAuthenticate' directive; there are options
    # here that control the use of potentially expensive database
    # queries. NOTE: these arguments to 'SQLAuthoritative' limit the way
    # you can structure your group table.  Check the README for more
    # information.
      
       SQLAuthenticate users 

    # Finally, some example logging directives.  If you have an integer
    # field named 'count' in your users table, these directives will
    # automatically update the field each time a user logs in and display
    # their current login count to them.
    # SQLNamedQuery getcount SELECT "count, userid from users where userid='%u'"
    # SQLNamedQuery updatecount UPDATE "count=count+1 WHERE userid='%u'" users
    # SQLShowInfo PASS "230" "You've logged on %{getcount} times, %u"
    # SQLLog PASS updatecount

    SQLHomedirOnDemand                on


    #...SQL............... 

    SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM quotalimits  WHERE name = '%{0}' AND quota_type = '%{1}'"


    SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM quotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"  


    SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" quotatallies 

    SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" quotatallies 

    QuotaLimitTable sql:/get-quota-limit 
    QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally 


    # close our <Global> block.
    </Global>


    # To prevent DoS attacks, set the maximum number of child processes
    # to 30.  If you need to allow more than 30 concurrent connections
    # at once, simply increase this value.  Note that this ONLY works
    # in standalone mode, in inetd mode you should use an inetd server
    # that allows you to limit maximum number of processes per service
    # (such as xinetd)
    MaxInstances 30

    # Set the normal user and group permissions for the server.
    User ftpusr
    Group ftpgrp

    # Normally, we want files to be overwriteable.
    <Directory /*>
      AllowOverwrite on
    </Directory>

    # A basic anonymous configuration, no upload directories.  If you
    # don't want to support anonymous access, simply remove this
    # <Anonymous ..> ... </Anonymous> block.

    <Anonymous ~ftp>
      User ftp
      Group ftp
      # We want clients to be able to login with "anonymous" as well as "ftp"
      UserAlias anonymous ftp

      # Limit the maximum number of anonymous logins
      MaxClients 10

      # We want 'welcome.msg' displayed at login, and '.message' displayed
      # in each newly chdired directory.
      DisplayLogin welcome.msg
      DisplayFirstChdir .message

      # Limit WRITE everywhere in the anonymous chroot
      <Limit WRITE>
        DenyAll
      </Limit>

    </Anonymous>

     lazylee 回復于:2003-02-10 21:12:12
    樓頂“找到#include <mysql/mysql.h> 把他該為你實際路徑”可以用編譯時加入 --with-mysql=/usr/local/mysql 代替

    找不到 mysqlclient 可以的另一個解決辦法是把 /usr/local/mysql/lib/mysql 下的東西拷到 /usr/local/lib 下

     白狐貍 回復于:2003-02-10 21:58:15
    [quote:354fcfaa76="lazylee"]樓頂“找到#include <mysql/mysql.h> 把他該為你實際路徑”可以用編譯時加入 --with-mysql=/usr/local/mysql 代替

    找不到 mysqlclient 可以的另一個解決辦法是把 /usr/local/mysql/lib/mysql 下的東西拷到 ..........[/quote:354fcfaa76]

    你實際做了沒??不要憑空想當然好不好,拜托??!

     lazylee 回復于:2003-02-10 23:29:05
    我當然這么做了,你如果沒試過就不要著急反駁我

     白狐貍 回復于:2003-02-11 00:10:09
    ”找不到 mysqlclient 可以的另一個解決辦法是把 /usr/local/mysql/lib/mysql 下的東西拷到 /usr/local/lib 下“

    這個辦法誰都能想到呀,但我在FreeBSD下試過了,通不過

     lazylee 回復于:2003-02-11 11:28:24
    sorry,筆誤,昨天晚上困了,我是拷到 /usr/lib 下了,正常使用中

     haohaoo 回復于:2003-02-11 14:28:26
    good

     luj 回復于:2003-02-17 15:35:34
    proftpd+Mysql搞好,還是老問題
    我的QUOTA加上去不能登陸,報錯421 Service not available,remote server has closed connection Login failed 
    不加QUOTA沒事,是什么原因,就教成功的人??!

     henkon 回復于:2003-02-19 18:39:10
    groupadd –g 1000 –r FTPGRP 
    出現groupadd:Command not found??是什么回事??

     白狐貍 回復于:2003-02-20 09:31:45
    [quote:0029301de5="henkon"]groupadd –g 1000 –r FTPGRP 
    出現groupadd:Command not found??是什么回事??[/quote:0029301de5]

    pw groupadd –g 1000 –r FTPGRP

     henkon 回復于:2003-02-20 19:02:17
    出現新的問題在下面這步的時候出現 ERROR 1064:You have an error in your SQL syntax near ')' at line 12怎么辦???
    CREATE TABLE quotalimits ( 
    name VARCHAR(30), 
    quota_type ENUM("user", "group", "class", "all") NOT NULL, 
    per_session ENUM("false", "true") NOT NULL, 
    limit_type ENUM("soft", "hard") NOT NULL, 
    bytes_in_avail FLOAT NOT NULL, 
    bytes_out_avail FLOAT NOT NULL, 
    bytes_xfer_avail FLOAT NOT NULL, 
    files_in_avail INT UNSIGNED NOT NULL, 
    files_out_avail INT UNSIGNED NOT NULL, 
    files_xfer_avail INT UNSIGNED NOT NULL,
    );

     白狐貍 回復于:2003-02-20 19:19:53
    照樣考過去就是呀,

    CREATE TABLE quotalimits ( 
    name VARCHAR(30), 
    quota_type ENUM("user", "group", "class", "all") NOT NULL, 
    per_session ENUM("false", "true") NOT NULL, 
    limit_type ENUM("soft", "hard") NOT NULL, 
    bytes_in_avail FLOAT NOT NULL, 
    bytes_out_avail FLOAT NOT NULL, 
    bytes_xfer_avail FLOAT NOT NULL, 
    files_in_avail INT UNSIGNED NOT NULL, 
    files_out_avail INT UNSIGNED NOT NULL, 
    files_xfer_avail INT UNSIGNED NOT NULL 
    );

     lazylee 回復于:2003-02-21 09:18:40
    es_xfer_avail INT UNSIGNED NOT NULL, 

    這行最后不能有 ,

     henkon 回復于:2003-02-21 18:13:13
    [quote:b9cf9056a8="白狐貍"]照樣考過去就是呀,

    CREATE TABLE quotalimits ( 
    name VARCHAR(30), 
    quota_type EENUM("user", "group", "class", "all") NOT NULL, 
    per_session ENUM("false", "true") NOT NULL, 
    limit_type ENUM("soft"..........[/quote:b9cf9056a8]

    是考到proftpd.conf中嗎?而不是在FTP里直接建數據表嗎?如果拷的話怎么拷?我是新人,請白狐貍兄指點迷津

     白狐貍 回復于:2003-02-21 20:22:39
    [quote:b3e59e4ae4="henkon"]

    是考到proftpd.conf中嗎?而不是在FTP里直接建數據表嗎?如果拷的話怎么拷?我是新人,請白狐貍兄指點迷津[/quote:b3e59e4ae4]

    就是直接在Mysql中建立表呀,通過phpmyadmin即可

     dykeyer 回復于:2003-02-23 17:39:28
    謝謝了,

     henkon 回復于:2003-03-05 17:25:57
    為什么我建組的數據表的時候出現錯誤??
    create table FTPGRPS (
    grpname TEXT NOT NULL,
    gid SMALLINT NOT NULL,
    members TEXT NOT NULL,
    );







     henkon 回復于:2003-03-05 17:29:34
    那位好心的兄弟可以把你的*.sql直接發給我,白狐貍兄不知道你是否可以發給我?先謝謝了,我的郵箱是henkon@163.net

     henkon 回復于:2003-03-05 17:52:42
    建立FTPUSR用戶的時候也出錯:
    adduser –u 1000 –g 1000 –d /home/FTP –s /bin/bash –r FTPUSR 
    /etc/adduser.conf:No such file or directory

     白狐貍 回復于:2003-03-05 22:15:35
    [quote:e27d216cf0="henkkon"]建立FTPUSR用戶的時候也出錯:
    adduser –u 1000 –g 1000 –d /home/FTP –s /bin/bash –r FTPUSR 
    /etc/adduser.conf:No such file or directory[/quote:e27d216cf0]

    pw adduser –u 1000 –g 1000 –d /home/FTP –s /bin/bash FTPUSR

     白狐貍 回復于:2003-03-05 22:20:35
    [quote:feeeb9e24f="henkon"]為什么我建組的數據表的時候出現錯誤??
    create table FTPGRPS (
    grpname TEXT NOT NULL,
    gid SMALLINT NOT NULL,
    members TEXT NOT NULL,
    );[/quote:feeeb9e24f]

    哎,
    create table FTPGRPS ( 
    grpname TEXT NOT NULL, 
    gid SMALLINT NOT NULL, 
    members TEXT NOT NULL
    );

    看看他們的區別哦 :lol:  :lol:

     isthisrabit 回復于:2003-03-06 01:36:56
    http://free.tcvec.js.cn

    一個簡單的管理用戶小程序,如有好的通知我

     白狐貍 回復于:2003-03-06 02:01:32
    [quote:1ffccf961b="isthisrabit"]http://free.tcvec.js.cn

    一個簡單的管理用戶小程序,如有好的通知我[/quote:1ffccf961b]

    誰有這個源代碼嗎,我想要一個研究啊

     songxi0354 回復于:2003-03-06 10:55:43
    :oops: 在FreeBSD4.6下安裝proftpd+mysql+quota需要開啟系統的磁盤限額?也就是重新編譯內核?

     白狐貍 回復于:2003-03-06 13:24:12
    其實不用系統自身的磁盤限額功能,通過proftpd的限額功能也是能做到的

     isthisrabit 回復于:2003-03-06 18:27:20
    最好別用系統的磁盤限額,應用proftpd的第三方軟件,
    ftp://pooh.urbanrage.com/pub/c 
    mod_quota.c

    當時我在設置時就因它(系統的)出過很大的問題.最后把它刪除后就沒事了,用了五個月左右一直很穩定

     xurwxj 回復于:2003-04-21 19:58:30
    我這邊出現/usr/bin/ld:cannt open lz是什么錯誤

     proftpd 回復于:200-04-25 18:16:49
    [quote:14c27e1e81="isthisrabit"]http://free.tcvec.js.cn

    一個簡單的管理用戶小程序,如有好的通知我[/quote:14c27e1e81]

    還可以喔??! :lol:

     wwl 回復于:2003-05-24 12:56:47
    磁盤限額處不好用,我在
    ftp>quote SITE QUOTA提示
    202  no quotas  in  effect

     netkiller 回復于:2003-05-30 15:20:57
    我全實現了。。。。做成功了?。?!

    Proftpd + MySQL 不喜歡。
    Proftpd + Postgresql 比較喜歡。。
    Proftpd + OpenLDAP 我最喜歡

     ghost_diy 回復于:2003-06-09 11:16:15
    這里的FTP磁盤限額是用戶累計上傳了多少byte的文件,而不是現在用戶究竟使用了多少空間,這有什么意思???!

     NightKids 回復于:2003-07-03 09:45:51
    真的需要修改  找到#include <mysql/mysql.h> 把他該為你實際路徑” 的,做過實驗的,不要吵了/

     cqfanli 回復于:2003-07-24 00:52:02
    我也成功的做出來了,不過有一個問題!
    就是ftp client是list時,系統并不報告它使用了多少空間,還剩多少空間呀?

     wolf1980 回復于:2003-07-24 22:32:03
    各位前輩,make時提示如下錯誤。是為什么呀??     


    modules/mod_quotatab_sql.o: In function `sqltab_create':
    modules/mod_quotatab_sql.o(.text+0x265): undefined reference to `quotatab_log'
    modules/mod_quotatab_sql.o: In function `sqltab_lookup':
    modules/mod_quotatab_sql.o(.text+0x36d): undefined reference to `quotatab_log'
    modules/mod_quotatab_sql.o(.text+0x3b8): undefined reference to `quotatab_log'
    modules/mod_quotatab_sqlo: In function `sqltab_write':
    modules/mod_quotatab_sql.o(.text+0x961): undefined reference to `quotatab_log'
    modules/mod_quotatab_sql.o: In function `sqltab_open':
    modules/mod_quotatab_sql.o(.text+0xad1): undefined reference to `quotatab_log'
    modules/mod_quotatab_sql.o: In function `sqltab_init':
    modules/mod_quotatab_sql.o(.text+0xc87): undefined reference to `quotatab_register'
    collect2: ld returned 1 exit status
    make: *** [proftpd] Error 1
    [root@xujj proftpd-1.2.7]#

     feiyi 回復于:2003-08-10 18:46:21
    我的mysql是用的rpm包安裝的,找不到/mysql/include/mysql這個,我應該怎么做呢?

    我這里就不知道應該怎么配置了呢?,那位兄弟可以幫幫忙,謝謝您了!
    ./configure --prefix=/usr/local/proftpd \ 
    --with-modules=mod_sql:mod_sql_mysql \ 
    --with-includes=/usr/local/mysql/include/mysql \ 
    --with-libraries=/usr/local/mysql/lib/mysql 
     make 
     make install

     zhangweibo 回復于:2003-08-28 17:23:32
    不行呀?。。?!

    [root@bak root]# groupadd -g 1000 -r FTPGRP  
    groupadd: FTPGRP is a not a valid group name

     golden76 回復于:2003-09-06 01:29:39
    頂,還是PROFTPD好。

     xanswer 回復于:2003-09-16 18:03:21
    /usr/bin/ld: cannot find -lmysqlclient
    collect2: ld returned 1 exit status
    make: *** [proftpd] Error 1


    我進展到marke這一步提示這個

     Linux@初學者 回復于:2004-05-21 20:20:33
    [root@server root]#/usr/programs/proftp/sbin/proftpd 
     - Fatal: unknown configuration directive 'bytes_out_avail,' on line 73 of '/usr/programs/proftp/etc/proftpd.conf'.

    怎么回事???謝謝!

     Linux@初學者 回復于:2004-05-21 20:59:13
    [root@server root]#ftp 10.0.3.40
    Connected to 10.0.3.40.
    421 Service not available, remote server has closed connection.

     Linux@初學者 回復于:2004-05-21 21:55:32
    [root@server ftp]#ftp 10.0.3.40
    Connected to 10.0.3.40.
    220 server FTP server ready
    Name (10.0.3.40:root): user1
    421 Service not available, remote server has closed connection.
    ftp: Login failed.
    ftp> 

    怎么回事???謝謝!

     hayes 回復于:2004-07-07 19:14:01
    :evil: 

    暈死了,到make時出錯

     ./configure --prefix=/usr/local/proftpd --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-includes=/usr/local/mysql/include/mysql/ --with-libraries=/usr/local/mysql/lib/mysql/ 

    make

    出錯了,出錯信息如下:


    make[1]: Leaving directory `/root/hayes/proftpd-1.2.9/lib/libcap'
    gcc -Llib  -o proftpd src/main.o src/timers.o src/sets.o src/pool.o src/regexp.o src/dirtree.o src/support.o src/netaddr.o src/inet.o src/log.o src/bindings.o src/scoreboard.o src/feat.o src/netio.o src/response.o src/ident.o src/data.o src/modules.o src/auth.o src/fsio.o src/mkhome.o modules/mod_core.o modules/mod_xfer.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_cap.o modules/mod_auth_pam.o modules/mod_quotatab_sql.o modules/mod_quotatab.o modules/mod_sql_mysql.o modules/mod_sql.o  modules/module_glue.o -lsupp -lcrypt  -Llib/libcap -lcap  -lm -lz -lmysqlclient  -lpam -L/usr/local/mysql/lib/mysql
    modules/mod_quotatab_sql.o: In function `sqltab_create':
    modules/mod_quotatab_sql.o(.text+0x24d): undefined reference to `call_module_cmd'
    modules/mod_quotatab_sql.o: In function `sqltab_lookup':
    modules/mod_quotatab_sql.o(.text+0x362): undefined reference to `call_module_cmd'
    modules/mod_quotatab_sql.o: In function `sqltab_write':
    modules/mod_quotatab_sql.o(.text+0x919): undefined reference to `call_module_cmd'
    collect2: ld returned 1 exit status
    make: *** [proftpd] Error 1


    有誰知道怎么做?

     hayes 回復于:2004-07-08 11:21:30
    我已解決了,是版本問題

    但啟動時又出問題了

    [root]#usr/local/proftpd/sbin/proftpd
    /usr/local/proftpd/sbin/proftpd: error while loading shared libraries: libmysqlclient.so.10: cannot open shared object file: No such file or directory

     hayes 回復于:2004-07-08 14:00:29
    [root]#usr/local/proftpd/sbin/proftpd 

    可以了,我copy一個 libmysqlclient.so.10 到 /ur/lib下了

    但現在proftpd起動,用前面的測試帳號登錄不了,在測試密碼時就停了???????????

     cswain 回復于:2004-07-19 17:42:54
    C:\>ftp 192.168.0.161
    Connected to 192.168.0.161.
    Connection closed by remote host.


    就這么快就關閉了,連個提示信息都沒有,真不知道什么地方出現問題了。

     adrianmak 回復于:2004-09-06 16:22:16
    目錄權限怎樣設置?
    如同一目錄,不同帳戶有不同權限

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <strong id="5koa6"></strong>