Advanced VsFTP and ProFTP user management skills in Linux (1)

Source: Internet
Author: User
Tags gz file

BKJIA Original: an old application on the Internet in the FTP service. So far, Interner has a wide range of applications, but what makes administrators have a headache is their user management, which is both complicated and complicated, how can this problem be solved? MySQL can be combined with ProFTP or VsFTP to build an efficient, stable, and centrally managed FTP server. This article describes how to build an FTP server based on the MySQL database for convenient management.
I. Software Version selection:
To build a database-based FTP server, you must first select the appropriate software. The details of the selected software are as follows:
◆ Linux RHEL5;
◆ MySQL version MySQL-standard-5.1.30-1.rhel5.src.rpm;
◆Ftpserver proftpd-1.3.2.tar.gzand vsftpd-2.2.1.tar.gz;
Using the pam program of mysqlpam_mysql-0.8rc1.tar.gz;
It should be noted that the "development tools" item must be selected when RHEL5 is customized for installation; otherwise, the software packages required for software compilation and debugging must be installed separately. Second, make sure that the MySQL and FTP servers are not installed on the Linux system. If yes, uninstall them first. Again, do not use ProFTPD and VsFTPD on the same computer, this will cause unexpected problems. The reader selects one of them based on their own needs and specific functions of the software.
Create a program installation directory
Run the following command as the root user throughout the installation process:
# Cd/soft/programe
# Mkdir mysq
Note the case sensitivity of the directory name.
# Mkdir proftpd
# Mkdir pam_mod
The installation directory of MySQL is/soft/program/mysql, the installation directory of ProFTPD is/soft/program/proftpd, and the installation directory of pam_mysq1.so is/soft/program/pam_mod, /storage is an existing directory where all FTP users upload and download files.
Install MySQL
◆ Add a user and group for MySQL management:
# Groupadd mysqlgrp
# Useradd-g mysqlgrp mysqladm
# Passwd mysqladm
◆ Switch to the directory where the MySQL-stan-dard-5.1.30-1.rhel5.src.rpm file is located, perform the following steps to install:
# Rpm-ivh MySQL-stan-dard-5.1.30-1.rhel5.src.rpm
This command is used to extract the mysql-5.1.30.tar.gz file and store it in the following directory.
# Cd/usr/src/redhat/SOURCE
# Tar zxvf mysqt-5.1.30.tar.gz
# Cd mysql-5.1.30
#./Configure Prefix =/soft/program/mysql -- with-extra-charsets = all
The "-- prefix =/soft/program/mysql" parameter is used to specify the Mysql installation directory, and "-- with-extra-charsets = all" is used to support all character sets.
# Make
# Make install
◆ Initialize the database
# Cd/soft/program/mysql/bin
#./Mysql_install_db
◆ To ensure security, modify the owner information and access mode of the database storage directory/soft/program/mysqll/var as the default directory for database storage.
# Cd/soft/program/mysql
# Chown-R mysqladm: mysqlgrp var
# Chmod-R go-wrx var
◆ Modify the configuration file
# Cd/soft/program/mysql/share/mysql
# Cp my-small.cnf/etc/my. cnf
# Cd/etc
Add the following content to the my. cnf file:
[Mysql]
User = mysqladm # Use mysqladm to start MySQL #
Default-character-set = utf8 # indicates the use of the UTF-8 character set, this character set is more universal, also good support for Chinese, of course, you can also directly use GBK.
[Clent]
Default-character-set = utf8
◆ Start
There are two ways to start, one is manual start, the other is automatic start, the Manual start operation is as follows:
# Cd/soft/program/mysql/bin
#./Mysqld_safe &
The following content must be added to/etc/rc. d/rc/local to automatically start the MySQL database at startup:
If [-x/soft/program/mysql/bin/mysqld_safe]; then
Install_path_name/bin/mysqld_safe &
Fi
◆ Change the Administrator Password
Run the following command to change the database password:
# Cd/soft/program/mysql/bin
#./Mysqladmin-h localhost-u root password '123'
The preceding command indicates the default database management account root used by-h host on the local machine. Note that the root user is not the root user in Linux and the password is set to 123456.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.