Home arrow Tutorials arrow Old Tutorials arrow ProFTPD on Mac OS X 10.4 with MySQL 5.0 back-end
ProFTPD on Mac OS X 10.4 with MySQL 5.0 back-end PDF Print E-mail
How to install and configure ProFTPD on Mac OS X 10.4 with MySQL 5.0 back-end.

ProFTPD on Mac OS X 10.4 with MySQL 5.0 back-end.

 

Step1 - Mac OS X Developer Tools
Once you have finished to install Mac OS X 10.4 and done all System Updates, you have to install Mac OS X Developer Tools.
You can find Developer Tools package on the Installation DVD or download it at this address: http://developer.apple.com/tools/
Admin password required for the installation.
Reboot your server.

 

Step2 - MySQL 5.0
Install MySQL 5.0 is very easy, you have to visit this address: http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg
Download the right version for your server [ Mac OS X 10.4 (PowerPC, 32-bit), Mac OS X 10.4, (PowerPC, 64-bit) or Mac OS X 10.4 (x86) ]
Mount the dmg and install the package.
Then drag the PrefPane over the System Preferences icon on your Dock.

 

Step3 - ProFTPD
Download ProFTPD on your desktop from this address: ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.1rc2.tar.gz
Untar the package and rename the folder to "proftpd", then open a Terminal shell.

cd /Users/your_user/Desktop/proftpd/
./configure --with-modules=mod_sql:mod_sql_mysql --with-includes=/usr/local/mysql/include --with-libraries=/usr/local/mysql/lib
make
make install

 

Step4 - Create MySQL Table for ProFTPD
We suggest you to install PhpMyAdmin, downloadable from this address: http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.10.0.2-all-languages-utf-8-only.tar.gz?download
You have to execute some SQL commands and create the database and the table where you will insert your FTP Users.

Create the database and call it "proftpd".
Then create the table using the "create table command" that follow.

#
# 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`)
) TYPE=MyISAM;

Now you have to create a new MySQL User to use with the ProFTPD configuration.
For example: mysql_proftpd

Step5 - Configure proftpd.conf
Before you start to configure ProFTPD, you have to create a new System User, creating a new account.
For example: macosx_proftpd
Now you have to configure ProFTPD editing the configuration file.

sudo pico /usr/local/etc/proftpd.conf

This is a configuration example:

# 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 "FTP Kdev"
ServerType standalone
DefaultServer on
UseReverseDNS off
IdentLookups off
SystemLog /var/log/proftp

# Port 21 is the standard FTP port.
Port 21
PassivePorts 60000 65535

# 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

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

SQLAuthenticate on
SQLUserInfo ftpusers username password NULL NULL homedir shell
SQLAuthTypes Plaintext Backend
SQLConnectInfo mysql_proftpd@localhost:3306 mysql_proftpd mysql_proftpd(password)
SQLUserWhereClause "LoginAllowed = 'Y'"
SQLDefaultGID 70
SQLDefaultUID 70
SQLGroupInfo ftpusers groupname gid username
SQLHomedirOnDemand on
SQLDefaultHomedir /ftp/default
#SQLDefaultHomedir homedir
SQLLog PASS updatelogin
SQLNamedQuery updatelogin UPDATE "count=count+1 WHERE username='%u'" ftpusers

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

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

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

# A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous ~ftp>
User macosx_proftpd
Group macosx_proftpd

# We want clients to be able to login with "anonymous" as well as "ftp"
UserAlias anonymous ftp

# Limit the maximum number of anonymous logins
MaxClients 10

# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>

Step6 - Create the StartupItem
In order to automatically start the ProFTPD Service at the boot you have to create a StartupItem.
You have to create the directory for ProFTPD.

cd /Library/StartupItems/
mkdir ProFTPD

And iside this directory you have to create StartupParameters.plist

pico StartupParameters.plist

With this contents.

{
Description = "FTP server";
Provides = ("ProFTPD");
Messages =
{
start = "Starting ProFTPD service";
stop = "Stopping ProFTPD service";
};
}

And the file ProFTPD.

pico ProFTPD

With this contents.

#!/bin/sh

##
# Start ProFTPD
##
. /etc/rc.common

StartService ()
{
ConsoleMessage "Starting ProFTPD server"
/usr/local/sbin/proftpd
}

StopService ()
{
ConsoleMessage "Stopping ProFTPD server"
A=`ps -ax | grep proftpd | awk {'print $1'} | head -1`
kill -9 $A
}

RunService "$1"

Then change tje privileges of the folder.

chown -R root:wheel ProFTPD/

 

Step7 - sbin nologin
Finally edit the shells file.

sudo pico /etc/shells

And add /sbin/nologin at the end of he file.

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/sbin/nologin

 
< 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?
KDEV SMS
http://www.smskdev.it

Login Form






Lost Password?
No account yet? Register

SMS iPhone

KDEV sms for iPhone
KDEV SMS iPhone
          Try it now!

Partner

Artera propone servizi di registrazione domini internet, hosting professionale, housing e server dedicati

Mblox is the world's largest mobile transaction network.

 

 

 




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