mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-02 13:42:13 +08:00
2532d2e8fc
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1815 af4574ff-66df-0310-9fd7-8a98e5e911e0
129 lines
4.1 KiB
XML
129 lines
4.1 KiB
XML
<sect2>
|
|
<title>Configuring <application>ProFTPD</application></title>
|
|
|
|
<sect3><title>Config files</title>
|
|
|
|
<para><filename>/etc/proftpd.conf</filename></para>
|
|
<para>This is a simple, download-only sample configuration. See the ProFTPD
|
|
documentation in <filename class="directory">/usr/share/doc/proftpd</filename>
|
|
and consult the website at <ulink url="http://www.proftpd.org/"/>
|
|
for example configurations.</para>
|
|
|
|
<screen><userinput><command>cat > /etc/proftpd.conf << "EOF"</command>
|
|
# This is a basic ProFTPD configuration file
|
|
# It establishes a single server and a single anonymous login.
|
|
|
|
ServerName "ProFTPD Default Installation"
|
|
ServerType standalone
|
|
DefaultServer on
|
|
|
|
# Port 21 is the standard FTP port.
|
|
Port 21
|
|
# 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 that the server normally runs at.
|
|
User proftpd
|
|
Group proftpd
|
|
|
|
# Normally, we want files to be overwritable.
|
|
<Directory /*>
|
|
AllowOverwrite on
|
|
</Directory>
|
|
|
|
# A basic anonymous configuration, no upload directories.
|
|
<Anonymous ~proftpd>
|
|
User proftpd
|
|
Group proftpd
|
|
# We want clients to be able to login with "anonymous" as well as "proftpd"
|
|
UserAlias anonymous proftpd
|
|
|
|
# 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>
|
|
<command>EOF</command></userinput></screen></sect3>
|
|
|
|
|
|
<sect3><title>proftpd init.d script</title>
|
|
|
|
<screen><userinput><command>cat > /etc/rc.d/init.d/proftpd << "EOF"</command>
|
|
#!/bin/sh
|
|
# Begin $rc_base/init.d/proftpd
|
|
|
|
# Based on sysklogd script from LFS-3.1 and earlier.
|
|
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
|
|
|
. /etc/sysconfig/rc
|
|
. $rc_functions
|
|
|
|
case "$1" in
|
|
start)
|
|
echo "Starting FTP Server..."
|
|
loadproc /usr/sbin/proftpd
|
|
;;
|
|
|
|
stop)
|
|
echo "Stopping FTP Server..."
|
|
killproc /usr/sbin/proftpd
|
|
;;
|
|
|
|
reload)
|
|
echo "Reloading FTP Server..."
|
|
reloadproc /usr/sbin/proftpd
|
|
;;
|
|
|
|
restart)
|
|
$0 stop
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
|
|
status)
|
|
statusproc /usr/sbin/proftpd
|
|
;;
|
|
|
|
*)
|
|
echo "Usage: $0 {start|stop|reload|restart|status}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# End $rc_base/init.d/proftpd
|
|
<command>EOF
|
|
chmod 755 /etc/rc.d/init.d/proftpd</command></userinput></screen>
|
|
|
|
<para>Create the symbolic links to this file in the relevant <filename
|
|
class="directory">rc.d</filename> directories with the following
|
|
commands:</para>
|
|
<screen><userinput><command>cd /etc/rc.d/init.d &&
|
|
ln -sf ../init.d/proftpd ../rc0.d/K28proftpd &&
|
|
ln -sf ../init.d/proftpd ../rc1.d/K28proftpd &&
|
|
ln -sf ../init.d/proftpd ../rc2.d/K28proftpd &&
|
|
ln -sf ../init.d/proftpd ../rc3.d/S32proftpd &&
|
|
ln -sf ../init.d/proftpd ../rc4.d/S32proftpd &&
|
|
ln -sf ../init.d/proftpd ../rc5.d/S32proftpd &&
|
|
ln -sf ../init.d/proftpd ../rc6.d/K28proftpd</command></userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|