Public domain
cd /usr/src
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/pure-ftpd-1.0.29.tar.bz2"
su - install
cd /usr/src
tar xf pure-ftpd-1.0.29.tar.bz2
cd pure-ftpd-1.0.29
./configure \
--prefix=/usr \
--with-altlog \
--with-puredb \
--with-extauth \
--with-cookie \
--with-throttling \
--with-ftpwho \
--with-ratios \
--with-quotas \
--with-uploadscript \
--with-virtualhosts \
--with-diraliases \
--with-peruserlimits \
--with-rfc2640 \
--with-language=english
make && make install-strip DESTDIR=/usr/local/encap/pure-ftpd-1.0.29
cd /usr/local/encap/pure-ftpd-1.0.29/
mv usr/share/man usr/
cd /usr/local/encap
mkencap pure-ftpd-1.0.29/
logout
cd /usr/local/encap
epkg pure-ftpd-1.0.29
groupadd ftpgroup
useradd -g ftpgroup -d /dev/null -s /etc ftpuser
pure-pw useradd pejman -u ftpuser -d /home/ftpusers/pejman -r 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,127.0.0.1/32
-r <allow client ip>/<mask>
-R <deny client ip>/<mask>
pure-pw passwd pejman
pure-pw usermod pejman -n 1000 -N 10
-n <max number of files>
-N <max Mbytes>
pure-pw show pejman
pure-pw userdel pejman
pure-pw mkdb
__ _ _____
| | |_|___ _ _ _ _ | __|___ ___ _ _ ___ ___
| |__| | | | |_'_| |__ | -_| _| | | -_| _|
|_____|_|_|_|___|_,_| |_____|___|_| \_/|___|_|
----==--
---==---(_)__ __ ____ __
--==---/ / _ \/ // /\ \/ /
-=====/_/_//_/\_,_/ /_/\_\
#!/bin/bash
#
# Startup Script
#
DAEMON="pure-ftpd"
PID_FILE="/var/run/pure-ftpd.pid"
START="/usr/sbin/pure-ftpd"
STOP="kill -TERM $(cat ${PID_FILE})"
TIMEOUT="5"
PARAM=" --logpid \
--ipv4only \
--chrooteveryone \
--daemonize \
--maxclientsnumber 50 \
--maxclientsperip 5 \
--noanonymous \
--fortunesfile /etc/issue \
--pidfile /var/run/pure-ftpd.pid \
--dontresolve \
--anonymouscantupload \
--maxidletime 3 \
--maxdiskusagepct 95 \
--altlog stats:/var/log/pureftpd.log \
--nochmod \
--antiwarez \
--userbandwidth 10 \
--minuid 1000 \
--umask 077:077 \
--peruserlimits 3:0 \
--customerproof \
--createhome \
--login puredb:/etc/pureftpd.pdb \
--userbandwidth 5120:5120
"
start()
{
echo "Starting ${DAEMON} : ${START} "
PROCESS=$(ps -A | egrep " ${DAEMON}$")
if [ "${PROCESS}" == "" ]; then
if [ -f "${PID_FILE}" ] ; then
rm "${PID_FILE}"
fi
${START} ${PARAM}
ps -A | egrep " ${DAEMON}$"
echo
fi
}
stop()
{
echo -n "Stopping ${DAEMON} "
${STOP}
sleep 1
for I in $(seq 1 $TIMEOUT); do
PROCESS=$(ps -A | egrep " ${DAEMON}$")
if [ "${PROCESS}" == "" ]; then
break
else
echo -n "${I} "
fi
sleep 1
done
echo
ps -A | egrep " ${DAEMON}$"
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
sleep 1
start
;;
*)
echo "usage $0 start|stop|restart"
;;
esac
# Start Pure-FTPd Server :
if [ -x /etc/rc.d/rc.pure-ftpd ]; then
/etc/rc.d/rc.pure-ftpd start
fi
#!/bin/bash
# Stop Pure-FTPd server:
if [ -x /etc/rc.d/rc.pure-ftpd ]; then
/etc/rc.d/rc.pure-ftpd stop
fi
chmod +x /etc/rc.d/rc.pure-ftpd
chmod +x /etc/rc.d/rc.local_shutdown
/etc/rc.d/rc.pure-ftpd start
BY: Pejman Moghadam
TAG: epkg, ftp, pureftp
DATE: 2011-07-28 23:41:53