Portál AbcLinuxu, 16. července 2025 05:47


Dotaz: ProFTPd s autorizací uživatelů via mod_sql - chyba při spouštění

30.1.2009 23:31 Radek Šimko | skóre: 3
ProFTPd s autorizací uživatelů via mod_sql - chyba při spouštění
Přečteno: 600×
Odpovědět | Admin

Zdravím místní komunitu,
po koketování s vsftpd a pure-ftpd jsem se rozhodl nasadit ProFTPd na svůj stroj, kde běží OpenSUSE 11.1 (x86_64) s verzí jádra 2.6.27.7-9-default (SMP). Protože ProFTPd není ve standartních repositářích, byl jsem nucen stáhnout zdroják a zkompilovat vše sám.

  1. Stáhl jsem poslední stable verzi proftpd:
    wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.1.tar.gz
  2. archiv jsem rozbalil:
    tar xvfz proftpd-1.3.1.tar.gz
  3. provedl jsem konfiguraci balíku tak, aby jsem poté nainstalil i sql modul:
    ./configure --with-modules=mod_sql
  4. make
  5. sudo make install
  6. Po úspěšném proběhnutí make i make install jsem chtěl službu nahodit:
    sudo /etc/init.d/proftpd start
    bohužel, vypisuje při pokusu o spuštění tuto chybu:
    Starting ProFTPD Server:  - mod_sql/4.2.2: notice: no backend modules have been registered
    startproc:  exit status of parent of /usr/local/sbin/proftpd: 1
                                                                         failed

Konfigurák na /etc/proftpd.conf vypadá následovně:

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "Vydra"
ServerType                      standalone
DefaultServer                   on

# Welcome message
DeferWelcome                    on
AccessGrantMsg                  "Pristup na server povolen."

# Port 21 is the standard FTP port.
Port                            21

# Don't use IPv6 support by default.
# UseIPv6                               on

# vlastni nastaveni
UseReverseDNS                   off
IdentLookups                    off
#DefaultAddress                 180.10.10.11
PassivePorts                    20000 20050

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

# 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
MaxLoginAttempts                5

# Set the user and group under which the server will run.
User                            nobody
Group                           nogroup

SQLLogFile      /var/log/proftpd.sqllog

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot /var/ftp-data


# Normally, we want files to be overwriteable.
AllowOverwrite          on

<IfModule mod_dso.c>
  # Ak je moznost prace s DSO, tak

  <IfModule !mod_sql.c>
    # Ak mod_sql este nie je, tak skusime loadnut
      LoadModule mod_sql.c
  </IfModule>

  <IfModule !mod_sql_mysql.c>
    # Ak mod_sql_mysql este nie je, tak skusime loadnut
      LoadModule mod_sql_mysql.c
  </IfModule>

</IfModule>

# Enable PAM for authentication...
#
AuthPAM                         on

# Use SQL tables first, then LDAP, for authentication
AuthOrder mod_sql.c

#########################
# Nastaveni pro mod_sql #
#########################
SQLBackend                      mysql
SQLAuthTypes backend
SQLAuthenticate                 users
SQLConnectInfo                  proftpd@localhost root *******
SQLDefaultGID                   65534
SQLDefaultUID                   65534
SQLMinUserGID                   100
SQLMinUserUID                   500
SQLUserInfo                     ftp username password uid gid homedir shell

#
# aktive SQL Kommandos, ab hier passiert etwas :-)
#
#SQLLog PASS counter
#SQLNamedQuery counter UPDATE "letzter_zugriff=now(), count=count+1 WHERE username='%u'" ftp

# xfer Log in mysql
#SQLLog RETR,STOR transfer1
#SQLNamedQuery  transfer1 INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'c', NULL" xfer_stat

#SQLLOG ERR_RETR,ERR_STOR transfer2
#SQLNamedQuery  transfer2 INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'i', NULL" xfer_stat


# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
  DenyAll
</Limit>

<Limit LOGIN>
 # AllowUser radek
 # DenyAll
</Limit>

 

Nevíte někdo z jakého důvodu vzniká tato chyba? Myslel bych si skoro, že registration of backend modules proběhne pomocí jedné (obou?) z těchto direktiv:

SQLBackend                      mysql
SQLAuthTypes backend

Bohužel tomu asi tak není...
Jinak jsem ochoten poskytnout i exporty těch tabulek, co mám v databázi, ale odhaduji, že to bude k této chybě zbytečné...

Pokoušel jsem se o konfiguraci i s konkrétním modulem pro mysql:
./configure --with-modules=mod_sql:mod_sql_mysql

Výpis sudo make install probíhal v pořádku až na konečných pár řádek s errory:
mod_sql_mysql.c:138:19: error: mysql.h: není souborem ani adresářem
mod_sql_mysql.c:164: error: expected specifier-qualifier-list before ‘MYSQL’
mod_sql_mysql.c: In function ‘_build_error’:
mod_sql_mysql.c:303: warning: implicit declaration of function ‘mysql_errno’
mod_sql_mysql.c:303: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:305: warning: implicit declaration of function ‘mysql_error’
mod_sql_mysql.c:305: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:305: warning: cast to pointer from integer of different size
mod_sql_mysql.c: In function ‘_build_data’:
mod_sql_mysql.c:316: error: ‘MYSQL’ undeclared (first use in this function)
mod_sql_mysql.c:316: error: (Each undeclared identifier is reported only once
mod_sql_mysql.c:316: error: for each function it appears in.)
mod_sql_mysql.c:316: error: ‘mysql’ undeclared (first use in this function)
mod_sql_mysql.c:317: error: ‘MYSQL_RES’ undeclared (first use in this function)
mod_sql_mysql.c:317: error: ‘result’ undeclared (first use in this function)
mod_sql_mysql.c:318: error: ‘MYSQL_ROW’ undeclared (first use in this function)
mod_sql_mysql.c:318: error: expected ‘;’ before ‘row’
mod_sql_mysql.c:327: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:333: warning: implicit declaration of function ‘mysql_store_result’
mod_sql_mysql.c:339: warning: implicit declaration of function ‘mysql_num_rows’
mod_sql_mysql.c:340: warning: implicit declaration of function ‘mysql_num_fields’
mod_sql_mysql.c:345: error: ‘row’ undeclared (first use in this function)
mod_sql_mysql.c:345: warning: implicit declaration of function ‘mysql_fetch_row’
mod_sql_mysql.c:355: warning: implicit declaration of function ‘mysql_free_result’
mod_sql_mysql.c: In function ‘cmd_open’:
mod_sql_mysql.c:408: warning: implicit declaration of function ‘mysql_ping’
mod_sql_mysql.c:408: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:420: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:420: warning: implicit declaration of function ‘mysql_init’
mod_sql_mysql.c:422: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:433: warning: implicit declaration of function ‘mysql_options’
mod_sql_mysql.c:433: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:433: error: ‘MYSQL_READ_DEFAULT_GROUP’ undeclared (first use in this function)
mod_sql_mysql.c:435: warning: implicit declaration of function ‘mysql_real_connect’
mod_sql_mysql.c:435: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:437: error: ‘CLIENT_INTERACTIVE’ undeclared (first use in this function)
mod_sql_mysql.c: In function ‘cmd_close’:
mod_sql_mysql.c:529: warning: implicit declaration of function ‘mysql_close’
mod_sql_mysql.c:529: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:530: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c: In function ‘cmd_select’:
mod_sql_mysql.c:843: warning: implicit declaration of function ‘mysql_real_query’
mod_sql_mysql.c:843: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c: In function ‘cmd_insert’:
mod_sql_mysql.c:956: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c: In function ‘cmd_update’:
mod_sql_mysql.c:1054: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c: In function ‘cmd_query’:
mod_sql_mysql.c:1169: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c:1184: warning: implicit declaration of function ‘mysql_field_count’
mod_sql_mysql.c:1184: error: ‘db_conn_t’ has no member named ‘mysql’
mod_sql_mysql.c: In function ‘cmd_escapestring’:
mod_sql_mysql.c:1264: warning: implicit declaration of function ‘mysql_escape_string’
mod_sql_mysql.c: In function ‘cmd_checkauth’:
mod_sql_mysql.c:1330: warning: implicit declaration of function ‘make_scrambled_password’
make[1]: *** [mod_sql_mysql.o] Error 1
make[1]: Leaving directory `/home/radek/downloads/proftpd-1.3.1/modules'
make: *** [modules] Error 2

 

Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

frEon avatar 31.1.2009 12:21 frEon | skóre: 40 | Praha
Rozbalit Rozbalit vše Re: ProFTPd s autorizací uživatelů via mod_sql - chyba při spouštění
Odpovědět | | Sbalit | Link | Blokovat | Admin

Ahoj, na 100% ti chybi nějaké závislousti. Suse neznám, ale v debianu jsou balíky končící na -dev. Jou v nich obsaženy hlavičkové soubory ke knihovnám popř. statické verze knihoven. Jsou to přesně ty balíky, které ti chybí. V debianu je potřeba pro zkompilování proftpd s podporou mysql balík libmysqlclient15-dev.

Vím, moc o Suse povídat nemohu, ale doufám, že jsem tě alespoň navedl správným směrem.

Talking about music is like dancing to architecture.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.