[root:~] # cd root
[root: download ] # wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.3.tar.gz
[root: download ] # tar -zxvf proftpd-1.3.3.tar.gz
[root: download ] # cd proftpd-1.3.3
[root: proftpd-1.3.3 ] # ./configure --sysconfdir=/etc
[root: proftpd-1.3.3 ] # make
[root: proftpd-1.3.3 ] # make install
[root: proftpd-1.3.3 ] # vi /etc/init.d/proftpd
#
# add this line :
#! /bin/sh
# Copyright (c) 2000-2001 SuSE GmbH Nuernberg, Germany.
# All rights reserved.
#
# Original author: Marius Tomaschewski
#
# Slightly modified in 2003 for use with SuSE Linux 8.1,
# by http://www.learnlinux.co.uk/
#
# Slightly modified in 2005 for use with SuSE Linux 9.2,
# by Falko Timme
#
# /etc/init.d/proftpd
#
### BEGIN INIT INFO
# Provides: proftpd
# Required-Start: $network $remote_fs $syslog $named
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Starts ProFTPD server
### END INIT INFO
# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}
# Force execution if not called by a runlevel directory.
test $link = $base && START_PROFTPD=yes # Modified by learnlinux.co.uk
test "$START_PROFTPD" = yes || exit 0 # Modified by learnlinux.co.uk
# Return values acc. to LSB for all commands but
# status (see below):
#
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
proftpd_cfg="/etc/proftpd.conf"
proftpd_bin="/usr/local/sbin/proftpd"
proftpd_pid="/usr/local/var/proftpd.pid"
[ -r $proftpd_cfg ] || exit 6
[ -x $proftpd_bin ] || exit 5
# Source status functions
. /etc/rc.status
# First reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting ProFTPD server: "
test -f /etc/shutmsg && rm -f /etc/shutmsg
/sbin/startproc $proftpd_bin
rc_status -v
;;
stop)
echo -n "Shutting down ProFTPD server: "
test -x /usr/local/sbin/ftpshut && /usr/local/sbin/ftpshut now && sleep 1
/sbin/killproc -TERM $proftpd_bin
test -f /etc/shutmsg && rm -f /etc/shutmsg
rc_status -v
;;
restart)
## If first returns OK call the second, if first or
## second command fails, set echo return value.
$0 stop
$0 start
rc_status
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
## Note: not (yet) part of LSB (as of 0.7.5)
$0 status >/dev/null && $0 restart
rc_status
;;
reload|force-reload)
## Exclusive possibility: Some services must be stopped
## and started to force a new load of the configuration.
echo -n "Reload ProFTPD server: "
/sbin/killproc -HUP $proftpd_bin
rc_status -v
;;
status)
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
echo -n "Checking for ProFTPD server: "
checkproc $proftpd_bin
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload,
## give out the argument which is required for a reload.
[ $proftpd_cfg -nt $proftpd_pid ] && echo reload
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload|try-restart|probe}"
exit 1
;;
esac
# Set an exit status.
rc_exit
[root: proftpd-1.3.3 ] # chmod 755 /etc/init.d/proftpd
[root: proftpd-1.3.3 ] # chkconfig --add proftpd
edit file /etc/proftpd.conf
Group nobody
DefaultRoot ~
IdentLookups off
ServerIdent on "FTP Server ready."
#
# comment (change #) in this line :
# Bar use of SITE CHMOD by default
#<Limit SITE_CHMOD>
# DenyAll
#</Limit>
[root: proftpd-1.3.3 ] # /etc/init.d/proftpd start
testing
yoga:/etc/init.d # ftp localhost
Trying ::1...
ftp: connect to address ::1Connection refused
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
220 FTP Server ready.
Name (localhost:root): prayoga
331 Password required for prayoga
Password:
230 User prayoga logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/" is the current directory
ftp> ls
200 PORT command successful
150 Opening ASCII mode data connection for file list
drwx------ 9 prayoga users 4096 Jul 11 16:33 Maildir
drwxr-xr-x 2 prayoga users 4096 Jul 8 19:44 bin
lrwxrwxrwx 1 prayoga users 20 Jul 11 16:43 commands.org.uk -> www/commands.org.uk/
drwxr-xr-x 22 prayoga users 4096 Jul 8 20:05 courier-imap-4.7.0
-rw-r--r-- 1 prayoga users 3414328 Dec 30 2009 courier-imap-4.7.0.tar.bz2
drwxr-xr-x 3 prayoga users 4096 Jul 11 16:42 www
226 Transfer complete
ftp> exit
221 Goodbye.
0 comments:
Post a Comment