You are here
Hi all,
The goal of this post is to describe all the steps leading to a successfull FTP Server Installation with the following features :
- FTP Server compatible with Debian 7 or CentOS 7 (might also be available for lower versions)
- FTP Mysql user and group accounts
- Web management interface (WebUI) for user, group, config, log management
I need to define a dedicated directory for all my customers, so that they can upload their files over my platefrom.
I need an "admin" user that has access to the root directory and can browse the other directories.
I need every users to be able to upload their files in their own directory ie. users must be chrooted.
I need to be able to create users and groups under Mysql with the Web management interface.
I need to be able to consult logs over the Web management interface.
I need a protected Web management interface.
I will try to detail all the steps leading to a successfull and peaceful install.
Feel free to add your tips, wishes and participate in the elaboration of this FTP Server host.
Webmin install
After a fresh Debian or CentOS install, please execute your system update ("yum -y update" for CentOS7 and "apt-get -y update" for Debian7) :
CentOS 7:
Debian :
You should be able to login to Webmin on "https://localhost:10000"
Knowledge is sharing, and vice versa !
Install required software - CentOS 7
#Install MySQL :
#Starts the service
#Enable service startup at boot
#Set the password for you MySQL / MariaDB install :
#Install Apache :
#Start the Apace service
#Enable the Apache service at boot
#Firewall Management
#Add HTTP port 80 port to firewall
#Add HTTPS 443 port to firewall
#Add Mysql 3306 port to firewall - In case you are behind a NAT only - Not mandatory !!!
#Add FTP Service on ports 20 and 21 to firewall rule
#Add Webmin port 10000 to firewall
#Reloads firewall config
Knowledge is sharing, and vice versa !
Install required software - Debian 7
#Install Mysql, PHP5, Apache, phpMyAdmin :
#Enable PHP5 mod for Apache :
#MySQL configuration
#Firewall Management
#Add HTTP port 80 port to firewall
#Add HTTPS 443 port to firewall
#Add Mysql 3306 port to firewall - In case you are behind a NAT only - Not mandatory !!!
#Add Webmin port 10000 to firewall
#Saves firewall config
Knowledge is sharing, and vice versa !
Thanks for sharing :)
Thanks very much for sharing Julien! :) Sorry TurnKey couldn't give you what you needed OOTB this time, we really appreciate you sharing your work. We may even use it to create a new FTP server appliance in the future?! :)
Configure Mysql to allow phpMyAdmin from your Web Front End
This part is not mandatory and you must do it if and only if know what you are doing.
Goal : allow phpMyAdmin to access the MySQL database of your FTP Server from your Web Server.
In this situation, you have 3 hosts :
- 192.168.1.2 => webserver (port 80) - Linux
- 192.168.1.3 => your NAS (Synology, Thecus or anything with mass redundant storage and NFS protocol embedded) - Linux
- 192.168.1.4 => ftpserver (port 20 and 21) - Linux
Because you only need to manage the database of your ftpserver, you don't need a new phpMyAdmin install.
Here is how you can do this.
On your webserver :
#Edit your the know hosts file
#Record your /etc/hosts file when it looks like this :
In most cases, phpMyadmin is installed on "/var/www/html/pma" or "/var/www/html/phpmyadmin/".
#Edit the config of your webserver :
#Find the section that begings with the Authentication type and add yours with cookie auth :
Once you've defined that, you need to allow MySQL to be managed from a remote host.
#On your ftpserver, launch MySQL and execute the following commands :
#From ftpserver shell :
#Show the current user list :
#Create a root (or other admin) user with all Hosts (%), then check it's working
#Apply the privileges to the new root@% user :
#Check the user list :
Now, you should be able to :
- see your ftpserver host in the list of servers available through your phpMyAdmin hosted on webserver.
- access your ftpserver MySQL database through it
Knowledge is sharing, and vice versa !
Add extra repository in CentOS7 : EPEL
Source : http://www.cyberciti.biz/faq/installing-rhel-epel-repo-on-centos-redhat-...
Goal : ease the install of commonly used software such as "htop" (and many others) when playing with yum
EPEL stands for : Extra Packages for Entreprise Linux
#Just tell yum he can use the EPEL repository.
Knowledge is sharing, and vice versa !
Installation of the FTP Server
Goal : chose and install the FTP server
- FTP Server compatible with Debian 7 or CentOS 7 (might also be available for lower versions)
- FTP Mysql user and group accounts
- Web management interface (WebUI) for user, group, config, log management
I need to define a dedicated directory for all my customers, so that they can upload their files over my platefrom.
I need an "admin" user that has access to the root directory and can browse the other directories.
I need every users to be able to upload their files in their own directory ie. users must be chrooted.
I need to be able to create users and groups under Mysql with the Web management interface.
I need to be able to consult logs over the Web management interface.
I need a protected Web management interface.
I need to be able to activate / deactivate any user.
I need to be able to add some notes to each FTP account (email, company, telephone).
My choice went to pure-ftpd beause it's robust, and more easily configurable thatn proftpd.
Also the pure-ftpd web interfaces are more up to date that proftpd.
#Install pureftpd server from : http://www.pureftpd.org/project/pure-ftpd/download
Et voila! The software is now installed in /usr/local/sbin/pure-ftpd
#Add FTP Group and FTP User :
Source : https://pure-ftpd-webui.org/wiki/Pure-FTPd%2BMySQL%20installation#CentOS
#Create the MySQL Database and its user access :
#Install the PureFTPD WebUI
Source : https://github.com/mazay/pure-ftpd-webui ZIP : https://github.com/mazay/pure-ftpd-webui/archive/master.zip
#Add the main pure-ftpd configuration file :
#Create the pure-ftpd-mysql.conf file :
#Start Apache and MySQL (MariaDB)
#Begin the installation of the WebUI files
Source : https://pure-ftpd-webui.org/wiki/Pure-FTPd%20WebUI%20installation#CentOS:
You have already build FTP table (ftpd) and it's admin user (userlist)
You can watch the tables by sending the SQL command : "SHOW TABLES;" if needed
Now we want to add the main admin user of the Admin Panel :
#Copy the pureftpd-web-ui files into the right directory and manage security
#Add Apache Alias for pureftpd WebUI
#Disable SELinux
#Restart Apache
#Open your web browser to test :
Change the IP to match YOUR configuration... http://192.168.1.4/pure-ftpd-webui/install.php
Knowledge is sharing, and vice versa !
Configuring Pure-ftpd-webui
When you hit the install URL : http://192.168.1.4/pure-ftpd-webui/install.php
#You will need to change the access to the config file :
#You need to enter the right MySQL and user credentials.
It should look like this :
MySQL host : localhost
MySQL admin login : pureftpd
MySQL admin password : USE THE PASSWORD YOU DEFINED for the "pureftpd" MysqL user
MySQL database : pureftpd
Pure-ftpd-webui user : admin
Pure-ftpd-webui password : USE THE PASSWORD YOU DEFINED for the "admin" Pure-ftpd-webui user
Then, click Next button (bottom right)
# Add the address of the FTPWHO script to the pureftpd-webui application :
Knowledge is sharing, and vice versa !
Add new comment