Home arrow KDEV News arrow Proftpd with backend mysql on Mac Os X 10.4
Proftpd with backend mysql on Mac Os X 10.4 Print E-mail
Proftpd is a very good FTP Server, using the mysql backend you can create login accounts simply inserting a line into a table. This is very usefull if you plan to create interaction between a web application and the FTP service. In Mac Os X 10.4 the inetd support was removed, you have to configure it to run in standalone mode into the proftpd.conf file.
ProFTPd with Mysql Back-end on Mac OS X

What I need:

a> Mac os X Developer tools: http://developer.apple.com/tools/
b> MySQL ( www.entropy.ch) www.mysql.com)
c> ProFTPd: http://www.proftpd.org - ftp://ftp.proftpd.org/distrib/source/proftpd-1.2.9.tar.gz

a> Developer Tools
First of all you have to verify that Developer tools are installed. (from the root verify if  /Developer folder is present). You can download tools at  http://developer.apple.com/tools/  then install it as a standard package (require an Administrator's password).

With the developer kit you can compile source code.

b> MySQL
Follow the guide  http://www.entropy.ch/software/macosx/mysql/ and install the package, the guide is available in italian at http://www.tevac.com/entropy-ita/

c> ProFTPd

ProFTPd www.proftpd.org 

Now you can compile and configure ProFTPd.

curl -O ftp://ftp.proftpd.org/distrib/source/proftpd-1.2.9.tar.gz
tar xzvf proftpd-1.2.9.tar.gz
cd proftpd-1.2.9
./configure --with-modules=mod_sql:mod_sql_mysql --with-includes=/usr/local/include --with-libraries=/usr/local/lib/mysql
make install

ONow that you have proftpd installed you have to configure the mysql back-end. Download the SQL file with database creation and execute it with phpmyadmin.






SQL file content:
# Database : `proftpd`

# --------------------------------------------------------

# Table structure for table `ftpusers`

CREATE TABLE `ftpusers` (
`loginallowed` char(1) NOT NULL default 'Y',
`username` varchar(60) NOT NULL default 'NULL',
`uid` int(11) unsigned default '1000',
`gid` int(11) unsigned default '1000',
`groupname` varchar(50) default 'ftp',
`password` varchar(30) default 'NULL',
`homedir` varchar(255) default '/Users/ftp/default/',
`shell` varchar(15) NOT NULL default '/sbin/nologin',
`count` int(11) unsigned default '0',
`fretr` int(10) unsigned default '0',
`bretr` int(10) unsigned default '0',
`bstor` int(10) unsigned default '0',
`fstor` int(10) unsigned default '0',
`ftime` timestamp(14) NOT NULL,
`faddr` varchar(255) default 'NULL',
`fhost` varchar(255) default 'NULL',
`fcdir` varchar(255) default 'NULL',
PRIMARY KEY (`username`)

Create a mysql user for the connection to the back-end mysql and remember to set the password in old_password.

Change the configuration file of proftpd in /usr/local/etc/proftpd.conf to match your system
A sample file is available to http://www.kdev.it/config/proftpd.conf.tgz
This is a sample config:
ServerName "KDEV"
ServerType standalone
DefaultServer on
Port 21
Umask 022
MaxInstances 15
User ftp
Group ftp
PassivePorts 49152 49999
UseReverseDNS off
IdentLookups off

SQLAuthenticate on
SQLUserInfo ftpusers username password NULL NULL homedir shell
SQLAuthTypes Plaintext Backend
SQLConnectInfo proftpd@localhost:3306 proftpd password <--- insert your username and password
SQLUserWhereClause "LoginAllowed = 'Y'"
SQLDefaultGID 1000
SQLDefaultUID 1000
SQLGroupInfo ftpusers groupname gid username
SQLHomedirOnDemand on
SQLDefaultHomedir /Users/ftp/default/cd1/
#SQLDefaultHomedir homedir
SQLLog PASS updatelogin
SQLNamedQuery updatelogin UPDATE "count=count+1 WHERE username='%u'" ftpusers

ExtendedLog /var/log/proftpd.log
DefaultRoot ~
# Normally, we want files to be overwriteable.
<Directory /*>
AllowOverwrite off

Mac Os X 10.4 has no support for inetd, remember that the server type should be standalone


To start the daemon launch ./proftpd &


and try to connect 








< Prev   Next >

FoxBox dedicated website

A new website dedicated to
SMS /MMS foxbox is online!
foxbox website

SMPP server interface

You are searching SMS speed?

SMS gateway FoxBOx
buy foxbox
buy on FoxBox eShop

For further info contact us by mail This e-mail address is being protected from spam bots, you need JavaScript enabled to view it providing us the FoxBox model you need and your company details.

2009 KDEV di Davide Cantaluppi, P.IVA 02984320131
KDEV SMS è un servizio di KDEV System Development    FoxBox SMS-MMS Hardware Gateway - FoxBox appliance
SMS KDEV sms inbound SMS KDEV ricevi ed elabora tuoi SMS e invia SMS con altissime prestazioni

spacer.png, 0 kB
spacer.png, 0 kB