Install and configure the FTP service in linux

Source: Internet
Author: User
Tags apache php php software
Install and configure the FTP service in linux-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Install and configure the FTP service in linux

Author: Still personal homepage: http://mypipe.go1.icpcn.com time:

I. Environment:

1. RedHat linux AS3
2. pureftp + mysql + webpurftp

Ii. related software:

1. pure-ftp-1.0.20.tar.gz // provides ftp service software
2. mysql-3.23.58-1.src.rpm // mysql source package
3. http-2.0.54.tar.gz
4. php-4.3.4.tar.gz
5. ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz // decrypt php Software
6. webpureft.01.tar.gz // provides a web interface for managing ftp users.

Iii. installation and configuration

1. Install MySQL.

In the Redhat linux AS3 system, the MySQL Server service is not provided by default, and only related software packages outside the service are installed. Therefore, we need to download the MySQL source code package and re-compile it. (We recommend that you use ?? Both the PM and BIN Packages may cause errors during compilation of other mysql-used packages ).


# Rpmbuild -- rebuild mysql-3.23.58-1.src.rpm

# Cd/usr/src/redhat/RPMS/

# Rpm-ivh mysql-server-3.23.58-1.i386.rpm

# Chkconfig -- level 35 mysqld on

#/Etc/rc. d/init. d/mysqld start

# Pstree | grep mysqld

# Netstat-an | grep: 3306

# Mysqladmin-u root-p password 123456 // change the password to 123456


2. Install the HTTP service

# Tar zxvf http-2.0.54.tar.gz

# Cd http-2.0.54

#./Configure -- prefix =/usr/local/apache

# Make

# Make install


3. install php

# Tar zxvf php-4.3.4.tar.gz

# Cd php-4.3.4

#./Configure -- with-mysql -- with-apxs2 =/usr/local/apache/bin/apxs

# Make

# Make install

# Cp php. ini-dist/usr/local/lib

// Or the "/usr/local/lib/php" directory, but it is best to go to the "/usr/local/lib" directory, because the Zend may not be able to be decrypted or garbled in combination below.


3. Integrate apache php

# Vi/usr/local/apache/conf/httpd. conf

// Add the following code to LoadModule php4_module modules/libphp4.so (if this line is not available, add it by yourself. Of course, add the following code to generate libphp4.so:

--> AddType application/x-httpd-php. php

--> AddType application/x-httpd-source. phps

--> DirectoryIndex index. php // Add index. php

--> ServerName 10.2.1.6: 80 // remove the comment, modify its domain name, or change it to its own ip Address

#/Usr/local/apache/bin/apacheectl start

# Vi/usr/local/apache/htdocs/test. php



// Open IE and enter http: // 10.2.1.6/test. php. If it is correct, the php test page will appear. You should pay attention to the version information of the Zend icon in the left test under the page, because it will change after Zend is installed below.


4. Install Zend Optimizer

# Tar zxvf ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz

# Cd ZendOptimizer-2.5.10a-linux-glibc21-i386

#./Install. sh

// If the installation interface is displayed, there are two main options:/usr/local/lib (php. INI file path) and/usr/local/apache/bin/apachectl, and then OK and OK to complete the installation process.

# Rm-rf/usr/local/lib/php. ini

# Cp/usr/local/Zend/etc/php. ini/usr/local/lib // copy the modified php. ini back.

#/Usr/local/apachectl restart

// Open IE and test again (refresh). If the left content of the Zend icon changes, this indicates that Zend Optimizer is successfully installed! (Note: The Zend version information you have installed must be displayed .)


5. Install the ftp service

# Tar zxvf pure-ftp-1.0.20.tar.gz

# Cd pure-ftp-1.0.20

#./Configure -- help | grep less // you can view many related configuration information.

#./Configure -- prefix =/usr/local/pureftpd \

-- With-mysql \
-- With-virtualchroot \
-- With-virtualroot \
-- With-virtualhosts \
-- With-cookie \
-- With-quotas \
-- With-diraliases \
-- With-sysquotas \
-- With-uploadscript
-- With-ratios \
-- With-paranoidmsg
-- With-peruserlimits \
-- With-largefile \
-- With-throttling \
-- With-welcomemsg \
-- With-language = simplified-chinese

# Make

# Make install

# Cd configuration

# Cp pure-config.pl/usr/local/pureftpd/sbin

# Chmod + x/usr/local/pureftpd/sbin/pure-config.pl

# Mkdir/data/ftp // the directories of virtual users are under the "/data/ftp" directory.

# Cd ../contrib

# Vi redhat. ini // script for starting the ftp service

Modify: fullpath =/usr/local/sbin/$ prog

--> Fullpath =/usr/local/pureftpd/sbin/$ prog

Modify: pureftpwho =/usr/local/sbin/pureftpwho

--> Pureftpwho =/usr/local/pureftpd/sbin/pureftpwho

# Cp redhat. init/etc/rc. d/init. d/purftpd

# Chmod 750/etc/rc. d/init. d/pureftpd

# Chkconfig -- add pureftpd

# Chkconfig -- level 35 pureftpd on

# Mkdir/var/ftp

# Chown ftp: ftp/var/ftp


6. install and configure webpureftp

# Tar zxvf webpureft1_1.tar.gz

# Cd webpureftp0.1/SQL

# Vi pureftp_0.1. SQL // database script

Before "drop table if exists depart_info;", add:

--> Create database pureftp; // the DATABASE to be created. Do not forget the extra points.

--> USE pureftp;

# Mysql-u root-p
# Cd ../docs

# Vi pureftpd-mysql.conf

Modify the statement to --> MYSQLUser root // mysql Administrator

--> MYSQLPassword 123456 // password of the mysql Administrator

--> MYSQLDatabase pureftp // imported ftp Database

# Cp pure-ftpd.conf/etc

# Cp pureftpd-mysql.conf/etc

# Cd ../config

# Vi config. inc. php

Change to: --> $ default_ftp_root = "/data/ftp/" // create the parent directory of the virtual user directory (note: "/" cannot be less, otherwise, the user logs in to the directory under the root directory .)

--> $ Obj_db = new db ("localhost", "root", "123456", "pureftp ");

# Cd ../../

# Cp-a webpureftp2.1/usr/local/apache/htdocs/webpureftp


Open IE, enter http: // 10.2.1.6/webpureftp, user: admin, password: admin. (If you have garbled characters, check that you have installed Zend. This step is mainly used in combination with php. ini or the php. ini path is incorrect ,)

Log on to the ftp service: ftp: // 10.2.1.6 (ftp 10.2.1.6 21)

If you only want to allow login by the configured virtual user, you only need to modify the/etc/pure-ftpd.conf File

AnonymousOnly no ---> AnonymousOnly yes.


At this point, the entire installation configuration process is basically completed, as for the ftp detailed configuration, see the relevant documentation (configuration file:/etc/pure-ftpd.conf)
Related Article

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.