>> Error while loading shared libraries
>> Error compiling: make[1]: *** [mod_sql_mysql.o] Error 1
>> Error: too many arguments to function `make_scrambled_password'
>> Cannot find -lmysqlclient
>> Users I add through proFTPd admin don't get access
>> When connecting to the server I get "login incorrect"
>> When connecting to the server I get "Server closed connection"
>> When connecting to the server I get "Incorrect password or username"
>> Is there any way to make the create users tool actually create individual directories for each account that is created
>> Parse error in the file "include_config.php"
>> ... consider upgrading MySQL client
>> The configuration file, called "configuration.xml", is NOT writeable ...
>> "Last logout"-field never gets updated
>> SQL-error: Table 'proftpd_admin.ftpquotalimits' doesn't exist
>> Fatal error: Call to undefined function simplexml_load_file() in ...
>> Compiling in support for "mod_quotatab"
>> File listing always empty
>> How do I upgrade?
>> How do I secure this tool?
>> Relative dates always have a time of 00:00:00
>> Is there any way to let users view their account details?
>> do_connect Function not implemented yet!
>> All I get is a blank page
>> I get a blank page with what looks like code on it
>> Ftp users: 0, Server down
>> I like this project, is there any way I can help ?
|
>> Error while loading shared libraries |
You encounter the following message when trying to start proftpd:
proftpd: error while loading shared libraries: libmysqlclient.so.12: cannot open shared object file: No such file or directory
What this means is that Linux can't find a shared library required by proftpd
- and thus leaves proftpd relentlessly un-startable. The solution is to tell
Linux where these files can be found, and this can be done by searching for
the file called "libmysqlclient.so.12" and add it's path to the end of another
file called "ld.so.conf" found in "/etc". Finally execute the command
"ldconfig" so that Linux knows that you've updated the "dynamic linker"'s
configuration-file.
If you're using Linux, compiled MySQL from source, and didn't bother to read what
I wrote above - just simply execute the following set of commands.
echo "/usr/local/lib/mysql/" >> /etc/ld.so.conf
ldconfig
|
|
>> Error compiling: make[1]: *** [mod_sql_mysql.o] Error 1 |
The first thing you should do is to scroll up until you find the first point of
failure. If the error you got somewhat matches the following:
gcc -DLINUX -I.. -I../include -I/usr/ -O2 -Wall -c mod_sql_mysql.c
mod_sql_mysql.c:137:19: mysql.h: No such file or directory
mod_sql_mysql.c:164: error: parse error before "MYSQL"
mod_sql_mysql.c:164: warning: no semicolon at end of struct or union
--- more errors, but I cut them since they are of no interest to us. ---
mod_sql_mysql.c: In function `cmd_checkauth':
mod_sql_mysql.c:1295: warning: implicit declaration of function `make_scrambled_password'
make[1]: *** [mod_sql_mysql.o] Error 1
make[1]: Leaving directory `/home/chryz/proftpd-1.2.9/modules'
make: *** [modules] Error 2
What this means is that the headers (.h - files) for MySQL could not be found
the path you specified with "--with-include" when you ran configure. If you
know these files should exist on your system you might try searching for a file
called "mysql.h" and use it's path when you rerun configure and retry compilation.
If you installed MySQL using prepackaged packages these files most probably wasn't
included, and must be installed as an extra package. Look for a package called
something like "libmysql12-devel" (search for packages with names that contain the
string "mysql" and after installing them you should be ready to get going).
For most prepackaged packages the following configure should work when compiling
proFTPd:
./configure --with-modules=mod_sql:mod_sql_mysql --with-includes=/usr/include/mysql/ --with-libraries=/usr/lib/mysql/
|
|
>> Error: too many arguments to function `make_scrambled_password' |
I encountered this problem when trying to compile proftpd 1.2.9 on FreeBSD, and as
far as I could see there is no other solution to the problem other than simply
to download and compile proftpd 1.2.10 instead (which didn't seem to have this
problem). Full error message below.
mod_sql_mysql.c: In function `cmd_checkauth':
mod_sql_mysql.c:1293: error: too many arguments to function `make_scrambled_password'
*** Error code 1
If someone has a better solution to this problem, they're welcome to send me an e-mail
and I'll add the solution here.
|
|
>> Cannot find -lmysqlclient |
When compiling proFTPd is almost at an end you encounter the following error-message:
/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [proftpd] Error 1
This means that the compiler could not find the libraries for MySQL. You specify
where these libraries can be found with the "--with-libraries"-parameter when running
configure. Try searching for "libmysqlclient.so" and supply it's path when running
configure like this:
./configure --with-modules=mod_sql:mod_sql_mysql --with-includes=/usr/include/mysql/ --with-libraries=/usr/lib/mysql/
|
|
>> Users I add through proFTPd admin don't get access |
Before we continue you should first try to start the server in debug-mode as well
as consult the log files like the the two following sections discuss:
>> When connecting to the server I get "login incorrect"
>> When connecting to the server I get "Server closed connection"
>> When connecting to the server I get "Incorrect password or username"
If that didn't work try checking that the proftpd-server loads the correct
configuration-file and not a residual configuration-file from an earlier
installation of proFTPd. Check that there are no other "proftpd.conf"-files
accidentaly being loaded instead (remove or move them to another location -
the one we want to keep is "/usr/local/etc/proftpd.conf").
With one of the later releases of MySQL the procedure used for "encrypting"
passwords were changed while the same changes weren't made in proftpd until
version 1.3RC1. Using a later version of MySQL (4 and up) with proftpd version
1.2.10 (latest stable at time of writing) would result in the server reporting
that you've entered the wrong password. One option for solving this problem is
either upgrading proftpd to a recent enough version or setting proFTPd
Administrator to use the old password format (use sub-type for old passwords in
database configuration) - any passwords already set must be reset to ensure that
the old password format is used.
|
|
>> When connecting to the server I get "login incorrect" |
The cause of this error may be unclear, but thankfully proftpd comes with a set
of functions that can easy debugging considerably when chasing down problem such
as this one. The first thing you should do is to shut down the ftp-server
(you can use "kill `cat /var/run.proftpd.pid`") if that is where your pid-file is
located. Next we'll start up the server again, but with debugging and error messages
sent to your console (debug level 1 should be enough, but you can increase the
number if it doesn't present you with anything usefull):
proftpd -n -d 1
Look through the output for messages describing some or other error that has
occured. A rather familiar error message for my part is shown below:
local_ftp - ProFTPD 1.2.9 (stable) (built Sat Jul 3 16:10:46 CEST 2004) standalone mode STARTUP
local_ftp (192.168.0.x[192.168.0.x]) - FTP session opened.
local_ftp (192.168.0.x[192.168.0.x]) - USER chryz: Login successful.
local_ftp (192.168.0.x[192.168.0.x]) - Preparing to chroot() the environment, path = '~/'
local_ftp (192.168.0.x[192.168.0.x]) - chryz chroot("~/"): No such file or directory
local_ftp (192.168.0.x[192.168.0.x]) - error: unable to set default root directory
local_ftp (192.168.0.x[192.168.0.x]) - FTP session closed.
What this error message means is that the login was successfull, but it didn't work
nonetheless - thus login incorrect. The culprit here was that my user had been set to
use a "home directory" that did not exist. If this is the standard behavior for newly
created users, you should considering "$config_ftp_default_home" in the file called
"include_config.php" included in proftpd admin.
|
|
>> When connecting to the server I get "Server closed connection" |
This message usually means a fatal error of some kind has occured on the ftp-server.
Relax! ,- this doesn't mean that it actually caught fire or something like that -
it only means that there is an error in the configuration. Most of the time the culprit
has something to do with the username and password used by the ftp-server to
access your mysql-database.
To battle these and more sorts of problem, consider starting your ftp-server in
debug mode (execute "proftpd -d 9 -n") and check out the contents of your log
files. If you used the configuration file that came with proftpd-admin you'll
have these config files:
- /var/log/proftpd.access_log
- /var/log/proftpd.auth_log
- /var/log/proftpd.mysql
- /var/log/proftpd.paranoid_log
- /var/log/proftpd.xferlog
|
|
>> When connecting to the server I get "Incorrect password or username" |
You may find that with some combinations of the proftpd-server and
MySQL-server the password format may be differing leading to all passwords
being seen as incorrect even though they are entered correctly. A workaround
for this exists in proftpd-administrator version 1.1 and is used by setting
the usage of the old password format on the settings page for the database-
server - ie. setting MySQL subtype as "Old database password format". Any
passwords set on users added previously must be changed after this change to
the configuration has been made.
|
|
>> Is there any way to make the create users tool actually create individual directories for each account that is created |
Due to requests I've added a simple way of doing this in proFTPd Admin v0.6 -
in the config file you can set a script to run every time a user is created (a
sample script is included in "misc/user_create"). Take note that when we later
refer to this script in configuration files - you have to include the entire
path. For sake of discussion we'll from now on assume that the proftpd_admin
tool has been extracted and placed in "/www/ftp_admin/".
Running the script to alter permissions and creating homedirectories will most
certainly require root-access from the script - because of security considerations
we most certainly don't want to run the web-server (I however do assume in the
configuration-bit below that the server is run as the user "nobody") as root to
accomplish this. Thankfully a tool called sudo will make all this happen for us,
but first sudo has to be set up properly - edit the file "/etc/sudoers" and add
the following few lines:
# Cmnd alias specification
Cmnd_Alias CREATE_USER = /www/ftp_admin/misc/user_script/create_user.sh
# User privilege specification
nobody ALL=(ALL) NOPASSWD: CREATE_USER
Now all we have to do is make sure that proFTPd-admin is aware of the scripts-
location, and that is done by editing "/www/ftp_admin/include_config.php" to
something like this:
$config_createuser_command = "sudo /www/ftp_admin/misc/user_script/create_user.sh";
All the pieces should now be in place and all that needs to be done is actually edit the
file and make it do what we initially wanted it to do (create hodedirectory as well as
setting the correct user and group ownerships.). The completed script could look something
like the following (based on our example script):
#!/bin/bash
USER=$1
USER_ID=$2
GROUP_ID=$3
mkdir -p /ftp/$USER
chown $USER_ID.$GROUP_ID /ftp/$USER
There is one task remaining and that is making sure that our security has not been
weakened due to the creation of our script (letting ordinary users overwrite something
that is run by sudo is a major security-flaw) by altering the permissions on the script
used by running the following set of commands:
chown -R root.root /www/ftp_admin/misc/user_script
chmod 700 -R /www/ftp_admin/misc/user_script
|
|
>> Parse error in the file "include_config.php" |
You are probably using version 0.7 of this tool, and upon starting to use
the tool everything you get is an error message stating that a so-called
"Parse error" has occured. The following is the entire error message:
Parse error: parse error, unexpected '=', expecting ')' in /path_to_ftpadmin/include_config.php on line 45
This error was caused due to the introduction of some PHP5 specific code
into the application, and I released version 0.7 before properly testing
it on a machine running any version of PHP4 (sorry about that). Thankfully
the solution is as simple as either upgrading to version 0.8 or downgrading
to version 0.6.1. Most of the added features since version 0.6.1 require that
you use PHP5, and although these shouldn't result in errors for new versions
(no guarantee) you're missing out on the fun.
In conclusion: Either upgrade to "proFTPd Administrator" version 0.8 or
more preferably - upgrade to PHP5.
|
|
>> ... consider upgrading MySQL client |
You recently upgraded, or did a new installation of PHP4 (PHP5 does not have
this problem) and can't use this tool. Some earlier versions of "proFTPd
administrator" might simply state that there are some problem with the
provided MySQL username/password - version 0.8 is a lot more helpfull and will
display the following series of errors:
do_connect Connection to database with credentials user@host
do_connect Connecting to database failed with errors: Client
does not support authentication protocol requested by
server; consider upgrading MySQL client
do_select_db Selecting database "proftpd_admin"
do_select_db Can't select database, not connected to database server
The makers of the MySQL database altered the way they store their passwords in
their database, but the older included PHP framework does not support this and
results in an error stating that you should "consider upgrading MySQL client".
This functionality has been added in PHP5 and should not be a problem if you
opt for upgrading to PHP5 instead of using PHP4.
For production enviroments PHP4 still see a lot of use, but to fix the error
you'll need to recompile PHP - better soon than later since you'll probably
encounter this problem in other PHP-based "applications" at some point in the
near future. What you need to do is to specify the support code for MySQL while
running the configure part of compiling the software. Use a configure statement
such as the following:
./configure --with-mysql=/usr/local --with-apxs2=/usr/local/apache2/bin/apxs
Substitute the parts that don't match on your system. The important part is
pointing to where the include-files for MySQL is located - the example shown here
assume that these files are located in "/usr/local/include/mysql/". If you can't
locate these files on your computer; try searching for one of the files that
belongs in this directory - a file such as "mysql_time.h". If you installed MySQL
from binary and want to install PHP from source, and can't find the files I'm
talking about - make sure you've installed the MySQL development pack.
|
|
>> The configuration file, called "configuration.xml", is NOT writeable ... |
You are using PHP5, and trying to use the inbuilt configuration feature
implemented in the newer versions of "proFTPd Administrator" with the
result of only facing the following error:
The configuration file, called "configuration.xml", is NOT writeable and you can
not alter any of the settings before you have given the web-server permission to
write to this file - check the manual for more information on how to do this.
Subsections have been hidden until you rectify this error.
What this error message actually means is that allthough the server is able to read
the configuration file (which for most web-based tools is perfectly fine), but to use
the configuration-feature you also need to give the server write permissions to this
file. The simplest solution would be to run the following command:
chmod o+w configuration.xml
This will work on all configurations, but for those of you that are a bit more security
focused might not want this file, a file that contains a username and password for your
database server, to be readable by everyone able to log either locally or via a service
such as SSH. The following is a little better and assumes that your database is running
as the group "nobody" (check web-server configuration):
chgrp nobody configuration.xml
chmod 660 configuration.xml
|
|
>> "Last logout"-field never gets updated |
When viewing details for a specific user there is a field called "Last logout", and if
you find that this field never gets upgraded then this problem affects you. The reason
for this is a bug in ProFTPd that was introduced with ProFTPd 1.2.10, previous versions
don't seem to be affected. The problem lies in ProFTPd killing the process serving the
client before the update has had a chance to be applied. Hopefully this issue will get
resolved in a newer version of ProFTPd.
This error has been fixed in ProFTPd 1.3.0, but you should wait until this version of
the server has reached "stable" before updating as this is merely a cosmetic error.
Version 1.3.0rc1 has some wierd problems with the current configuration, but this is
assumed to be fixed in the final release - until that time you should use ProFTPd
1.2.10,
|
|
>> SQL-error: Table 'proftpd_admin.ftpquotalimits' doesn't exist |
This error applies to you if you've just upgraded to proFTPd Administrator
version 0.9, and get this error on the bottom of some of the pages. The reason for this
is that you've activated support for Quota, but you haven't upgraded the database to
include updates made in v0.9. To upgrade the database - see the following section:
>> Update for versions <= 0.8
|
|
>> Fatal error: Call to undefined function simplexml_load_file() in ... |
This error can occur on installations of PHP5 where support for XML has been left out -
ie. configure was running with the parameters "--disable-libxml" and/or "--disable-simplexml"
(this will leave out XML-support and negate the need to install libxml2 - appearantly a file
missing from Mandrake 10.0 Community Edition). When opening any page for this tool you'll be
met by an error message due to a PHP parser error - the full error message is as follows:
Fatal error: Call to undefined function simplexml_load_file() in file "include_config_utils.php" on line 19
To fix this I highly recommend that you install libxml2 and recompile PHP5 without explicitly
removing XML-support. If that isn't an option there is a way out of this mess by enforcing
the pages to use the older PHP4 configuration file, "include_config_oldstyle.php", by opening
up the file "include_config.php" in an editor and find the line that looks as follows:
$config_enforce_oldstyle_config = false;
Alter this line so that it reads as follows:
$config_enforce_oldstyle_config = true;
Note however that this method will only work on proFTPd Administrator version 0.9 or later, so
make sure to update the tool - this error shouldn't happen on PHP4 since it doesn't support
this functionality in the first place. As mentioned earlier you'd be doing yourself a favour by
updating to PHP5 (with XML support).
|
|
>> Compiling in support for "mod_quotatab" |
Adding support for "mod_quotatab" may be easier than it sounds, but there is a chance you'll
have to do this yourself - ie. recompiling proftpd. Before going to those extends you should
first check if you happen to already have the support we need - run the following command
and examine the output:
proftpd -l
A list of the compiled in modules should now be listed - compare this to the following list
of needed modules:
>> mod_sql.c
>> mod_sql_mysql.c
>> mod_quotatab.c
>> mod_quotatab_sql.c
If one or more of these modules are missing you should either consider checking to see if
there are any other packaged versions of proftpd that includes these modules, or you could
skip right to the solution that is most likely - recompiling it yourself.
To recompile the server you can simply follow the steps outlined in the install section in
this document, but if you're impatient and are used to compiling software you can stay
tuned for the short version.
Short version:
Recompile the software, but this time alter some of the parameters when running configure -
in short do something like this:
./configure --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql \
--with-includes=/usr/local/include/mysql/ --with-libraries=/usr/local/lib/mysql/
|
|
>> File listing always empty |
If you find that you file listing is always empty this might apply to you - this is an
error that has been confirmed on proFTPd version 1.3.0rc1. The cause of this is a bug
in the "HideNoAccess"-directive. This directive works fine on version 1.2.10 and below,
but assuming you installed a beta version for a reason - you'll, for now, have to set the
"HideNoAccess"-directive to "off" until an updated version of proFTPd is avaiable.
|
|
>> How do I upgrade? |
This is not an easy question due to the various different versions of both this tool and
PHP and for the most part I would recommend that you place the new version in a new
directory and install it as you first did by following the details sketched out for you
in this document (this does not apply for the database-specific parts.). There is relevant
information for how to do this in the install section.
>> Installing proFTPd Administrator
>> Upgrading from versions <= 0.7
>> Upgrading from versions <= 0.8
>> Upgrading from versions <= 0.9
The xml-based configuration-file, "configuration.xml", used by PHP5 enabled servers can be
copied directly to the new versions directory. The next thing you should do is go to
the configuration-tab in the new version of this tool and press submit on any of the
pages - this should take care of updating the configuration-file for use with your new copy
of proFTPd Administrator.
|
|
>> How do I secure this tool? |
This tool doesn't have any built in security, but considering the nature of the
application this wouldn't be the level where you'd want to secure it since global
access means a security risk no matter the quality of the implementation (exposure
always means that it's only a matter of time, and a login-system built into proFTPd
Administrator would be not be sufficient and would actually serve as a false sense
of security - much like the much flaunted "anti"-virus functionality found on your
computer BIOS). In other words you need to add the required security you yourself
have a need for.
The key is focusing on the servers that this application runs on top off:
- Web server (ie. Apache)
- MySQL
- PHP
The intended purpose is that you install these on your dedicated ftp-server and
administrate it via this tool - and nothing else. You then firewall out all, but
your own IP as well as set up basic access controls from within Apache.
I usually set it up so that the web server only listens on IP 127.0.01 (firewall
out port 80 on all other interfaces just to be sure). You then use SSH to set up
a tunnel to the computer (for extra security, use keys instead of ordinary
passwords), and administrate via that. This also allows you to securely
use ProFTPd Administrator, PHPMyAdmin, PHPSysInfo without the exposure. If done
correctly the only ports exposed to the public should be 21 (FTP) and 22 (SSH) -
in doubt use nmap from an external machine to check what services are exposed.
If you absolutely have to use it on the same server as web-pages open to the public
either set up an additional web-server on the same machine or use something like
virtual hosting (make sure you get it right as to not inadvertently expose critical
information) - I don't recommend using this solution, but it may be sufficient for
you if you take care setting it up.
|
|
>> Relative dates always have a time of 00:00:00 |
When you select expiration dates for accounts as well as use any of the drop down
menues used to select dates that are relative to the current time - you may find
that the dates are correct, but the time is allways set to midnight that day. This
is caused by a documented bug in PHP, and only applies to PHP version 5.0.0 - 5.0.2.
In other words you'll have to upgrade in order to see this bug go poof.
|
|
>> Is there any way to let users view their account details? |
Starting with version 1.0 of the software I've included a subset of this tool that
can be found in misc/user_info that can be used in order to allow users to
log on and view their account details including available transfer logs as well as
the current quota.
This subset of code uses the same format configuration as the rest of the tool meaning
you have the option of linking to the main-tools configuration, copying the current
configuration used with proFTPd Administrator or simply make a new one specifically for
this part of the package - I recommend the two latter since they give you the ability
configure a MySQL-user with less privileges than the one required by the main tool.
|
|
>> do_connect Function not implemented yet! |
This error is caused by the fact that you haven't or have erroneously configured the
database-connection that is used by this tool. This can easily be rectified by going
to the configure-tab and reconfiguring database-access if you are using PHP5 (if that
doesn't work compare your configuration.xml with the default one that comes with the
package), or by manually editing the file "include_config_oldstyle.php" if you are
still using PHP4.
|
|
>> All I get is a blank page |
I've had reports about this problem on some configurations, but the one that seems to
stand out in the crowd is Debian "Etch". In most cases the reason for this is either
a misconfigured PHP/Apache-setup or in some cases the parser itself crashing - on the
forementioned Debian version this is most commonly caused by a configuration trying to
load an old PHP4-installation as well as the newer PHP5 which understandably enough
doesn't work.
|
|
>> I get a blank page with what looks like code on it |
This error only occurs on a few configurations, again with Debian "Etch" one of the
most represented, and is caused by a typo most installations ignore. If you encounter
this problem you should upgrade to proFTPd Administrator v1.1 which encorporates a
fix.
|
|
>> Ftp users: 0, Server down |
If the status screen displays this message as well as the main page not showing any
connected users your problems are most probably related to either a misconfigured
path to the ftpwho-utility or the utility itself not running properly, but before
continueing please make sure that the server is actually running.
One thing that you should check first is that the ftpwho-utility runs from the command-
line without any errors as any error messages here may indicate a problem with the
server configuration. Other than that you should take note that the utility on the
administration page will be run with the same privileges as the web-server so that if
this user can't access your scoreboard-file (path configured in "proftpd.conf") then
neither can the utility. As a quick fix try giving other read access to the file
as well as all directories leading up to it.
|
|
>> I like this project, is there any way I can help ? |
If there are features that aren't working perfectly, or there are ways of
improving the way they function you are welcome to give it a try - it is
open-source after all. Especially when it comes to the status-part of the
page there are several systems I do not have access to, and therefore it
is impossible for me to develop the code for them. If you are using
NetBSD and OpenBSD, and have some skills with those systems and PHP you
could try and make the status-page work on those systems.
Other than that I suck at graphic-design and CSS - so feel free to modify
the CSS-files (feel free to use "Easy_Gray" and "Yellow" as a basis for your
work). The installation guide (this document) always need more content (be it
improvements or guides for installing on other distributions - that's your
choice).
For those of you familiar with PostgreSQL there have been made requests for
support for this database server, but as I have no experience with this
server I leave that to any willing soul that wants it to work with this
tool - the framework has been completed as of version 0.8 so the only thing
missing is the actual implementation.
If you're still not satisfied with the hints given here - feel free to jump
to the tools manual-section and check out the section called "Pending features
and changes".
|
|