Random Linux

Linux, video games and web hosting

To install ProFtp on CentOS, the first thing that you will want to do is to make sure that vsFTP is not already installed on your server.

[email protected][~]#yum remove vsftpd

Then, you will want to go into the /usr/src directory and download the latest version of ProFTP to that folder.

[email protected] [~]#cd /usr/src
[email protected] [/usr/src]# wget ftp://proftpd.mirrors.tds.net/pub/ProFTPD/distrib/source/proftpd-1.3.4rc1.tar.gz
–2011-03-07 03:25:48– ftp://proftpd.mirrors.tds.net/pub/ProFTPD/distrib/source/proftpd-1.3.4rc1.tar.gz
=> `proftpd-1.3.4rc1.tar.gz’
Resolving proftpd.mirrors.tds.net…
Connecting to proftpd.mirrors.tds.net||:21… connected.
Logging in as anonymous … Logged in!
==> SYST … done. ==> PWD … done.
==> TYPE I … done. ==> CWD /pub/ProFTPD/distrib/source … done.
==> SIZE proftpd-1.3.4rc1.tar.gz … 59791418
==> PASV … done. ==> RETR proftpd-1.3.4rc1.tar.gz … done.
Length: 59791418 (57M)

100%[===========================================================================================================================================================>] 59,791,418 1019K/s in 34s

2011-03-07 03:26:24 (1.66 MB/s) – `proftpd-1.3.4rc1.tar.gz’ saved [59791418]

Then, you will want to decompress the file.

[email protected][/usr/src]#tar -xzvf proftpd-1.3.4rc1.tar.gz

That should create a folder in the /usr/src named proftpd-1.3.4rc1. Go into that folder and we can configure and install it all with one line.

[email protected][/usr/src]#cd proftpd-1.3.4rc1
[email protected][/usr/src/proftpd-1.3.4rc1]#./configure && make && make install

And go back a folder and delete the proftp folder and the tar file. We won’t need those again.
[email protected][/usr/src/proftpd-1.3.4rc1]#cd ..
[email protected][/usr/src]#rm -rfv proftpd-1.3.4rc1 proftpd-1.3.4rc1.tar.gz

Once that is done, we will need to symlink the proftp binary to the /usr/sbin folder.

[email protected][/usr/src]#ln -s /usr/local/sbin/proftpd /usr/sbin/proftpd

Once that is done, we will create the script in /etc/init.d to allow it to start at boot time.

[email protected][/usr/src]#nano /etc/init.d/proftpd

And paste this into that file:

# $Id: proftpd.init,v 1.1 2004/02/26 17:54:30 thias Exp $
# proftpd This shell script takes care of starting and stopping
# proftpd.
# chkconfig: – 80 30
# description: ProFTPD is an enhanced FTP server with a focus towards \
# simplicity, security, and ease of configuration. \
# It features a very Apache-like configuration syntax, \
# and a highly customizable server infrastructure, \
# including support for multiple ‘virtual’ FTP servers, \
# anonymous FTP, and permission-based directory visibility.
# processname: proftpd
# config: /etc/proftp.conf
# pidfile: /var/run/proftpd.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = “no” ] && exit 0

[ -x /usr/sbin/proftpd ] || exit 0



start() {
echo -n $”Starting $prog: ”
daemon proftpd
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd

stop() {
echo -n $”Shutting down $prog: ”
killproc proftpd
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd

# See how we were called.
case “$1″ in
status proftpd
if [ -f /var/lock/subsys/proftpd ]; then
echo -n $”Re-reading $prog configuration: ”
killproc proftpd -HUP
echo “Usage: $prog {start|stop|restart|reload|condrestart|status}”
exit 1

exit $RETVAL

Then save the file and exit. We will want to make that executable as well.

[email protected] [/usr/src]#chmod 755 /etc/init.d/proftpd

After that you will need to edit line 30 in /usr/local/etc/proftpd.conf and change the group to nobody.

[email protected] [/usr/src]#nano -w +30 /usr/local/etc/proftpd.conf

Then change that group line to say nobody. User should already say nobody when you open that file.

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

Also, if you would like your FTP users to be able to change the permissions of their files, you will want to comment out lines 39-42. So it should go from this:
# Bar use of SITE CHMOD by default


# Bar use of SITE CHMOD by default
#  DenyAll

Once that is done, all that we need to do is tell it to start on boot and start the ftp server. So, first you will run this.

[email protected] [/usr/src]#chkconfig –levels 235 proftpd on

Then finally, start the ftp server.

[email protected] [/usr/src]#/etc/init.d/proftpd start
Starting proftpd: [ OK ]

If you see the OK there, it should be started and ready to connect. Also to check on the status of the ftp server, you can run the following:

[email protected] [/usr/src]#service proftpd status
proftpd (pid 15853) is running…

Also, once it is in the /etc/init.d folder, you are able to start, stop and restart the FTP server with the service command, such as
service proftpd stop
service proftpd start
service proftpd restart
service proftpd status

March 7th, 2011

Posted In: How To

Tags: , , ,

Leave a Comment