Users/Groups definitions are stored in a mysql database.
The default logging channel for the postgresql backend is 26.
Here are some instructions how to use MySQL as a backend for users/groups.
Reinstall wzdftpd if you don't already have MySQL support. The MySQL support is automatically installed if you don't use --disable-mysql.
If MySQL: YES doesn't show up at the end of your ./configure, either you don't have MySQL installed or libmysql is not detected (if you installed it in a non-standard place, you need additional flags to ./configure.
In the source dir there is a dir called backends/mysql/ where all files regarding the MySQL backend. Pay attention to the two files with the extention .sql, these are instruction files for MySQL on how to create/delete a user, database and tables that wzdftpd will use.
Let's look at tables.sql which is the file that creates all user/database/tables. If you don't have any experience with MySQL before you should look at http://www.mysql.com and learn or google some up, but the SQL language is quite understandable. Im gonna go through the lines, what they do and what you "need" to change.
CREATE DATABASE IF NOT EXISTS wzdftpd;This creates a database with the name wzdftpd.
GRANT ALL ON `wzdftpd`.* TO "wzdftpd"@"localhost" IDENTIFIED BY "wzdftpd";This allows your user wzdftpd to connect from localhost with the password wzdftpd, and grants all privileges on the wzdftpd database and all the tables in it to the user wzdftpd if he connect from localhost.
Save the file and write down or remember the database, user and password that you edited in the file.
IMPORTANT: Remember to chmod your tables.sql so only YOU can read them, otherwise everyone can read your password and add/edit/remove users/privileges/settings on wzdftpd !
Now we're gonna insert that data into MySQL. First you must have your root password or an user which is allowed to create databases and grant usage to other users. I assume you will use root and is in the dir where tables.sql is.
shell> mysql -u root -p < tables.sqlJust enter your root password for MySQL and everything should be working. If you have forgotten your root password, look at this url: http://dev.mysql.com/doc/mysql/en/resetting-permissions.html
Now we're gonna edit your wzd.cfg file, if you don't have one just copy it from the wzd.cfg.sample and edit it. The interesting line in the file is these two:
#backend = /path/to/wzdftpd/share/wzdftpd/backends/libwzdmysql.so #backend_param_mysql = login:password@host:baseUncomment those lines and add the user, password, and database that you edited in tables.sql.
With the default configuration, not recommended, it should look like this:
backend = /path/to/wzdftpd/share/wzdftpd/backends/libwzdmysql.so backend_param_mysql = wzdftpd:wzdftpd@localhost:wzdftpd
Start wzdftpd and use as normal.
Use the backends/mysql/dropall.sql in the source dir:
shell> mysql -u root -p < dropall.sql
Comment/delete the references to mysql in wzd.cfg
The main tables are users and groups. They are related with a n:n relation, implemented using the ugr table (user-group relations).
Other tables are linked using 1:n relations to materialize the fact that one user or group can have several associated IP adresses. Users have userip, groups have groupip.
Finally, stats for users are implemented in a separate table, stats, with a 1:1 relation (users have only one stat line).
As MySQL does not yet support constraints (nor sequences), data integrity is not assured in case of problems. If a modification is interrupted; or if you connect several servers to the same database, wzdftpd cannot guaranty the safety of your data. That's why the PostgreSQL backend is preferable in most situations (that does not mean the MySQL backend has problems, nor that the PostgreSQL backend is perfect, only that PostgreSQL is potentially less subject to problems).