Results 1 to 5 of 5

Thread: ProFTPD Logs

  1. #1
    ZPanel QA Staff VJftw's Avatar
    Join Date
    Feb 2012
    Location
    Reading, England, United Kingdom
    Posts
    296

    ProFTPD Logs and Active mode? :S

    How can i set up logging properly for ProFTPD?
    my current proftpd-mysql.conf which does get run is:
    Code:
    ServerName		"zPanel ProFTPD @ Edge of the Earth"
    #ServerType         	inetd
    ServerType         	standalone
    DeferWelcome		off
    ServerAdmin		root@localhost
    #DisplayLogin		welcome.msg
    #DisplayFirstChdir	readme
    DefaultServer		on
    Port                  	21
    Umask                	000
    TimeoutLogin         	120
    TimeoutIdle          	600
    TimeoutNoTransfer    	900
    TimeoutStalled      	3600
    User			root
    Group			root
    DefaultRoot		~
    MaxLoginAttempts	3
    RequireValidShell	no
    MaxClients		50
    UseReverseDNS        	off
    MaxInstances		30
    AllowOverwrite		yes
    IdentLookups         	off
    TransferLog		/var/zpanel/logs/proftpd/xferlog.www
    ExtendedLog		/var/zpanel/logs/proftpd/access.log WRITE,READ write
    ExtendedLog		/var/zpanel/logs/proftpd/auth.log AUTH auth
    ExtendedLog   		/var/zpanel/logs/proftpd/paranoid.log ALL default
    TransferLog		/var/zpanel/logs/proftpd/xferlog.legacy
    LogFormat         	default "%h %l %u %t \"%r\" %s %b"
    LogFormat		auth    "%v [%P] %h %t \"%r\" %s"
    LogFormat		write   "%h %l %u %t \"%r\" %s %b"
    
    ######################################################
    # SQL INFORMATION
    ######################################################
    LoadModule mod_sql.c
    LoadModule mod_sql_mysql.c
    LoadModule mod_quotatab.c
    LoadModule mod_quotatab_sql.c
    # The passwords in MySQL are encrypted using CRYPT
    SQLAuthTypes            Plaintext Crypt
    SQLAuthenticate         users groups
    
    # used to connect to the database
    # databasename@host database_user user_password
    SQLConnectInfo  zpanel_proftpd@localhost ******* ****** //shh i didnt notice my password here
    
    # Here we tell ProFTPd the names of the database columns in the "usertable"
    # we want it to interact with. Match the names with those in the db
    SQLUserInfo     ftpuser userid passwd uid gid homedir shell
    
    # Here we tell ProFTPd the names of the database columns in the "grouptable"
    # we want it to interact with. Again the names match with those in the db
    SQLGroupInfo    ftpgroup groupname gid members
    
    # Here we tell ProFTPd the names of the database columns in the "grouptable"
    # we want it to interact with. Again the names match with those in the db
    SQLGroupInfo    ftpgroup groupname gid members
    
    # set min UID and GID - otherwise these are 999 each
    SQLMinID        500
    
    # create a user's home directory on demand if it doesn't exist
    #SQLHomedirOnDemand on
    # CreateHome off
    
    # Update count every time user logs in
    SQLLog PASS updatecount
    SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
    
    # Update modified everytime user uploads or deletes a file
    SQLLog  STOR,DELE modified
    SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
    
    # User quotas
    # ===========
    QuotaEngine on
    QuotaDirectoryTally on
    QuotaDisplayUnits Mb
    QuotaShowQuotas on
    
    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 ftpquotalimits 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 ftpquotatallies 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}'" ftpquotatallies
    
    SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies
    
    QuotaLimitTable sql:/get-quota-limit
    QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
    
    RootLogin off
    RequireValidShell off
    but when i go to /var/zpanel/logs there's just a single blank file called proftpd :s

    also, i've just discovered that ProFTPD doesn't work in Active mode, It only works with Passive. Odd, considering before on Windows with FileZilla only active mode would work :s

    any ideas?
    Last edited by VJftw; 08-04-2012 at 03:02 PM.

  2. #2

    Re: ProFTPD Logs

    Did you omit: SQLConnectInfo zpanel_proftpd@localhost ******* ****** //shh i didnt notice my password here

    root Your_Password ????
    Al
    ZPanel YouTube Channel|https://www.youtube.com/user/mangoldwen
    OpenSource News Paper|http://uirl.tk/paperli
    ZPX Video Blog http://zpanelcp.blogspot.co.uk/

  3. #3
    ZPanel QA Staff VJftw's Avatar
    Join Date
    Feb 2012
    Location
    Reading, England, United Kingdom
    Posts
    296

    Re: ProFTPD Logs

    yeah i did haha.

    Didn't notice my password there until after i'd pasted it in


    I think i've sorted it out finally.

    1. Installed Webmin
    2. Went into ProFTPD and selected the Default Virtual Server
    3. Went onto Logging Options
    4. set the FTP transfers logfile to: /var/zpanel/logs/proftpd/xferlog.default
    and added a custom logfile: /var/zpanel/logs/proftpd/proftpd.default for All FTP commands
    5. executed mkdir /var/zpanel/logs/proftpd
    6. restarted ProFTPD.
    Kind've figured this all out while following the /var/logsyslog in Webmin. Thankfully, ProFTPD printed out its runtime errors in there and it told me that either the directory didn't exist or the permissions were too loose.

    So these Log rules work fine for me
    Code:
    TransferLog /var/zpanel/logs/proftpd/xferlog.default
    LogFormat default "%h %l %u %t \"%r\" %s %b"
    LogFormat auth "%v [%P] %h %t \"%r\" %s"
    LogFormat write "%h %l %u %t \"%r\" %s %b"
    ExtendedLog /var/zpanel/logs/proftpd/proftpd.default
    Not sure if Active FTP works (it works for me but i'm in the local network). Passive still does so that's fine

  4. #4
    ZPanel Developer rustus's Avatar
    Join Date
    Sep 2010
    Posts
    3,207

    Re: ProFTPD Logs

    Awesome! Glad you got it sorted, and I am sure this will help others. Thanks for being so detailed in your answer

  5. #5
    ZPanel QA Staff VJftw's Avatar
    Join Date
    Feb 2012
    Location
    Reading, England, United Kingdom
    Posts
    296

    Re: ProFTPD Logs

    Just to note for anyone that does want the logs, You don't need to install Webmin or do any of the numbered steps. They're just how I resolved the issue in the first place. The ProFTPD conf snippet for the logs is all that is needed. Make sure you create the directory that the files should be in. DON'T chmod 777 that directory or ProFTPD won't want to save logs there. If you still can't get it to work, try taking a look in the /var/log/syslog file.

    No problem Rustus
    I love giving back to a community, although there is a few things I haven't done yet due to being in my final year in Sixth Form and i've got a lot of A Level exams coming up which I need to do well in to get into University.

    Once i'm in Uni and I hopefully have much more free time , i'll finish my Home Multi-functional server guide for another forum and share here if needed, dive into a bit of Android development; and finally hopefully help out a lot more here. Probably the first thing i'll do is look into all of the errors ZPanelX gives out in the apache error log as i have a bit of an obsession for getting rid of errors :P

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •