Article

  • 2 years

    10 months

    YetiShare / Plugins / FTP Upload

    2093

How to setup ProFTPD with the FTP Plugin

Install ProFTPD & MySQL module (on CentOS):

yum install proftpd proftpd-mysql 
chkconfig proftpd on

On Ubuntu:

sudo apt-get install proftpd-basic proftpd-mod-mysql
sudo update-rc.d proftpd defaults

Configure the /etc/proftpd.conf file with proftpd.conf.alt1.txt.

Troubleshooting

Via the FTP client:

Status:Connection established, waiting for welcome message...
Response:220 ProFTPD 1.3.3g Server (sitename.com) [::ffff:1.0.0.254]
Command:USER admin
Response:331 Password required for admin
Command:PASS ************
>Response:530 Login incorrect.
Error:Could not connect to server

Check your proftpd.log file for clues. 

tail /var/log/proftpd/proftpd.log

If you see errors similar to this:

Dec 01 06:49:33 cdn.sitename.com proftpd[19226] cdn.sitename.com (redlorry919.plus.com[::ffff:1.0.0.254]): FTP session opened.
Dec 01 06:49:33 cdn.sitename.com proftpd[19226] cdn.sitename.com (redlorry919.plus.com[::ffff:1.0.0.254]): error creating '/ftp_accs/admin': Permission denied
Dec 01 06:49:33 cdn.sitename.com proftpd[19226] cdn.sitename.com (redlorry919.plus.com[::ffff:1.0.0.2549]): notice: unable to use '~/' [resolved to '/ftp_accs/admin/']: No such file or directory

Make sure you do not have SELinux running. You can disable it until the next reboot by calling this:

setenforce 0
If you're having connection or firewall issues, see here:

https://support.mfscripts.com/public/kb_view/43/
More info: http://www.electrictoolbox.com/switch-off-selinux-...

Error:  warning: unable to determine IP address of 'host'. Add the host to the server hosts file:
nano /etc/hosts
Error:
[ ok ] Stopping ftp server: proftpd.
[....] Starting ftp server: proftpdmail proftpd[1534]: Fatal: Group: Unknown group 'nobody' on line 20 of '/etc/proftpd/proftpd.conf'
In proftpd.conf ensure this is set:
# Set the user and group that the server runs as
User nobody
Group nogroup

 

Alternative proftpd.conf

Depending on your ProFTPD setup you may find the setup detailed in the FTP plugin settings does not fully function. Try replacing the contents of your /etc/proftpd.conf file with the attached proftpd.conf.alt1.txt. Ensure you replace all the values in square brackets so it can connect to your database. This is a standalone config file so there's no need for sql.conf and modules.conf.

Useful Commands

Restart ProFTPD:

service proftpd restart

Install ProFTPD & MySQL module:

yum install proftpd proftpd-mysql 

Start in debug mode: (stop the proftpd service first)

proftpd -n -d 20
SQL Log File:
/var/log/proftpd/sql.log
If you can login fine when ProFTPD is started in debug mode but not normally, look in the SQL Log File. If you have an error like this:
'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)'
This is because selinux is blocking it.

Force stop all any processes on port 21:
fuser -k 21/tcp

External Resources

http://www.howtoforge.com/virtual_hosting_with_pro...