HOWTO PureFTPD, MySQL Authenticaton and Usermanager
De Gentoo Linux Wiki
| Kernel & Hardware • Red y Servicios • Portage • Relacionado con el Sistema • Servidor X • Juegos • Misceláneos |
Tabla de contenidos |
[editar] Requerimientos
- PureFTPD - el servidor FTP
- Web server - para servir el USerManager
- PHP - el userManager esta hecho en PHP
- MySQL - Para almacenar los usuarios y configuraciones de estos
- Usermanager - la aplicación para añadir/modificar y borrar usuarios
[editar] Use flags
Necesitas asignar estos USE flags para seguir con esta guía:
- mysql - Añade soporte mysql para pure-ftpd y PHP
- posix - Añade soporte posix para PHP
- session - Añade soporte session para PHP
- pcre - Añade soporte pcre para PHP
Si te falta alguna de estos USe añádelos al /etc/make.conf code> y actualiza el php
# emerge -avu php
[editar] Instalar los paquetes
Tener pure-ftpd instalado es fácil, emerge el paquete pure-fptd.
# emerge -av pure-ftpd
The pure-ftpd usermanager is not in Portage, so download and install it manually. Change path to your website document folder:
# cd /var/www/localhost/htdocs
Get the tar ball:
# wget http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz
Untar, this wil create the Usermanager in the folder ftp code>:
# tar zxf ftp_v2.1.tar.gz
For the created folder, change owner to the proper user/group:
# chown -R apache:apache ftp
Make sure install code> is named install.php code>
# cd ftp # mv install install.php
Make config.php code> writable
# chmod 664 config.php
[editar] Configure Usermanager
Fireup the install.php code> in your favorite webbrowser:
http://localhost/ftp/install.php
Follow the installation wizard, you will be guided in 7 steps
- Choose New installation, create a new database.
- Fill in the hosts/username/password to administrate Mysql, this information is used to create the ftpusers database
- Fill in the hosts/username/password for the ftpusers database, this information is used by pure-ftpd to connect to Mysql
- Fill in all the stuff, this information is used by the Usermanager in PHP to modify the ftpusers database
- When done press the Save button to write the configuration to the
config.php code> file
- When done press the Save button to write the configuration to the
- Fill in a proper password for the Administrator user, this is used to login in the Usermanager
- Press the Change button to save the password
- Copy all text in the gray block from Step B, paste the text in
/etc/pureftpd-mysql.conf code> and save it - Close the installation wizard
Note Make sure u have a valid password for the ftpusers database user. It must not be empty, or pure-ftpd will fail to start.
[editar] Configure PureFTPD
Like all configuration files on Gentoo, the pure-ftpd configuration file is placed in /etc/conf.d code>.
Open /etc/conf.d/pure-ftpd code>
# nano -w /etc/conf.d/pure-ftpd
Uncomment the configuration flag
IS_CONFIGURED="yes"
Add the mysql authenticator at the end of the file
AUTH="-l mysql:/etc/pureftpd-mysql.conf"
Save and exit nano.
[editar] Start PureFTPD
Start the FTP server
# /etc/init.d/pure-ftpd start
If it fails to start, check the log file
# tail /var/log/messages
If it succeeds, let pure-ftpd start automatically
# rc-update add pure-ftpd default
[editar] Add users
Open the Usermanager, it is an web application so go to
http://localhost/ftp/
Log in with the password as defined in the installation wizard (Step 5). You should now be able to add/delete/modify virtual users.
[editar] Clean up
When all is set and done there are some loose ends we have to take care off.
There is a serious security breach when the install.php code> is public accessible. So delete it or rename it
To delete # rm /var/www/localhost/htdocs/ftp/install.php Or rename # mv /var/www/localhost/htdocs/ftp/install.php /var/www/localhost/htdocs/ftp/install
Delete the downloaded Usermanager tarball
# rm /var/www/localhost/htdocs/ftp_v2.1.tar.gz
[editar] Credits
- I was unsatisfied by the HOWTO_PureFTPD_with_MySQL_Auth_and_PhpMyAdmin so that's why i wrote this HOWTO
- Myself
[editar] Feedback
¿Preocupaciones o elogios? Por favor, usa nuestra sección de discusión.
