PureFTP安装配置

PureFTP+Mysql验证

FTP的原理

21端口开放,用于连接。20端口用于传输数据!

匿名用户

anonymous

主动模式和被动模式

主动模式是客户端主动,例如用1030端口连接21,再开放103120端口传输数据,但是如果有防火墙的话,无法主动传输,服务器会打开大于1024端口并且通过客户端进行连接

tar -xjvf pure-ftpd-1.0.22.tar.bz2

./configure –prefix=/usr/local/pureftpd –with-mysql=/usr/local/mysql –with-paranoidmsg –with-shadow –with-welcomemsg –with-uploadscript –with-quotas –with-cookie –with-virtualhosts –with-virtualroot –with-diraliases –with-sysquotas –with-ratios –with-ftpwho –with-throttling –with-language=simplified-chinese

–with-mysql=/usr/local/mysql \ 此处的 /usr/local/mysql 请改为你的mysql实际安装路径.如果出现类似configure: error: Your MySQL client libraries aren’t properly installed 的错误,请将mysql目录下的 include/mysql下的mysql.h文件以及lib/mysql下的全部文件,连接(直接复制过去或许也可)到 /usr/lib 目录下(参考)

cp /usr/local/mysql/lib/libmysqlclent* /usr/lib(真正解决办法)

##运行 ldconfig,加载所有共享链接库

cp -a ftp /var/www/html/pureftp

make && make install

cp configuration-file/pure-config.pl /usr/local/pureftpd/sbin/

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

cp configuration-file/pure-ftpd.conf /etc

make /ftproot

生成pure-Ftp服务管理脚本

编辑contrib子目录里面的redhat.int文件

fullpath=/usr/local/sbin/$prog

改为

fullpath=/usr/local/pureftpd/sbin/$prog

pureftpwho=/usr/local/sbin/pure-ftpwho

改为

pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho

cp contrib/redhat.init /etc/init.d/pure-ftpd

chmod +x /etc/init.d/pure-ftpd

chkconfig –add pure-ftpd

安装user mamager for pure-ftpd进行Web管理pure-ftp

tar -xzvf ftp_v2.1.tar.gz

cp -a ftp /var/www/html/pureftp

在浏览器输入。IP/pureftp/install.php

一步一步的创建!!

Touch /etc/pureftp-mysql.conf

把下面复制到那个文件

############################################################################
#                                                                           #
# PureFTPd MySQL configuration file.                                        #
# Generated by the installation wizard for the ‘User manager for PureFTPd‘ #
# See http://machiel.generaal.net for more info                             #
# or read the README.MySQL for explanations of the syntax.                  #
#                                                                           #
############################################################################
# Optional : MySQL server name or IP. Don‘t define this for unix sockets.
MYSQLServer      127.0.0.1
# Optional : MySQL port. Don‘t define this if a local unix socket is used.
# MYSQLPort        3306
# Optional : define the location of mysql.sock if the server runs on this host.
MYSQLSocket      /tmp/mysql.sock
# Mandatory : user to bind the server as.
MYSQLUser       ftp
# Mandatory : user password. You must have a password.
MYSQLPassword    tmppasswd
# Mandatory : database to open.
MYSQLDatabase  ftpusers
# Mandatory : how passwords are stored
# Valid values are : "cleartext", "crypt", "md5" and "password"
# ("password" = MySQL password() function)
# You can also use "any" to try "crypt", "md5" *and* "password"
MYSQLCrypt       md5
# In the following directives, parts of the strings are replaced at
# run-time before performing queries :
#
# \L is replaced by the login of the user trying to authenticate.
# \I is replaced by the IP address the user connected to.
# \P is replaced by the port number the user connected to.
# \R is replaced by the IP address the user connected from.
# \D is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting.
# Query to execute in order to fetch the password
MYSQLGetPW       SELECT Password FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Query to execute in order to fetch the system user name or uid
MYSQLGetUID      SELECT Uid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : default UID - if set this overrides MYSQLGetUID
#MYSQLDefaultUID 1000
# Query to execute in order to fetch the system user group or gid
MYSQLGetGID      SELECT Gid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : default GID - if set this overrides MYSQLGetGID
#MYSQLDefaultGID 1000
# Query to execute in order to fetch the home directory
MYSQLGetDir      SELECT Dir FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : query to get the maximal number of files
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTAFS  SELECT QuotaFiles FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : query to get the maximal disk usage (virtual quotas)
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTASZ  SELECT QuotaSize FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : ratios. The server has to be compiled with ratio support.
MySQLGetRatioUL SELECT ULRatio FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MySQLGetRatioDL SELECT DLRatio FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Optional : bandwidth throttling.
# The server has to be compiled with throttling support.
# Values are in KB/s .
MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
# 2) Real and virtual users match.
# MySQLForceTildeExpansion 1
# If you upgraded your tables to transactionnal tables (Gemini,
# BerkeleyDB, Innobase...), you can enable SQL transactions to
# avoid races. Leave this commented if you are using the
# traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.
# MySQLTransactions On

/etc/pure-ftp.conf

加一句

MySQLConfigFile /etc/pureftpd-mysql.conf

Service pure-ftpd start

时间: 2024-12-29 11:25:30

PureFTP安装配置的相关文章

vsftpd的安装配置及lftp命令的使用

vsftpd(very secure FTP daemon)是一个基于GPL发布的类Unix系统上使用的FTP服务器软件,它是一个安全.高速.稳定的FTP服务器 一.FTP FTP(File Transfer Protocol,文件传输协议)用于Internet上的控制文件的双向传输.同时,它也是一个应用程序(Application).基于不同的操作系统有不同的FTP应用程序,而所有这些应用程序都遵守同一种协议以传输文件. 1.ftp基于C/S架构 client: ftp.lftp.lftpge

CentOS 6.9中Telnet的安装配置

Telnet:TCP/IP协议中的一员,是Internet远程登录服务的标准协议和主要方式.它为用户提供了在本地计算机上完成远程主机工作的能力.要开始一个Telnet会话,必须输入用户名和密码来登录服务器.Telnet是常用的远程控制Web服务器的方法,监听TCP的23号端口. xinetd:新一代的网络超级守护进程,经常用来管理多种轻量级的Internet服务.xinetd提供类似于inetd+tcp_wrapper的功能,但它更强大更安全.xinetd能够同时监听多个指定的端口,在接受用户请

使用LVS实现负载均衡原理及安装配置详解

转:http://www.cnblogs.com/liwei0526vip/p/6370103.html 使用LVS实现负载均衡原理及安装配置详解 负载均衡集群是 load balance 集群的简写,翻译成中文就是负载均衡集群.常用的负载均衡开源软件有nginx.lvs.haproxy,商业的硬件负载均衡设备F5.Netscale.这里主要是学习 LVS 并对其进行了详细的总结记录. 一.负载均衡LVS基本介绍 LB集群的架构和原理很简单,就是当用户的请求过来时,会直接分发到Director

47 监控系统基础及zabbix介绍、zabbix工作原理及安装配置、zabbix on CentOS7、zabbix配置

02    zabbix工作原理及安装配置 配置环境 node1192.168.1.120CentOS6.7 node2192.168.1.121CentOS6.7 1.安装配置zabbix #安装前准备 [[email protected] ~]#yum -y install mysql-server mysq [[email protected] ~]# mysql mysql> CREATE DATABASE zabbix CHARACTER SET utf8; mysql> GRANT

详解“FTP文件传输服务”安装配置实例

"FTP文件传输服务"安装配置实例 家住海边喜欢浪:zhang789.blog.51cto.com 目录 简介 ftp工作原理 常见的FTP服务 Vsftpd服务器的安装 Vsftpd.conf配置文件详解 配置FTP服务器实例 实例:配置匿名用户 实例:配置本地用户登录 实例:配置虚拟用户登录(MySQL认证) 实例:控制用户登录 实例:设置欢迎信息 分析vsftpd日志管理 FTP服务器配置与管理 简介 FTP 是File Transfer Protocol(文件传输协议)的英文简

redis应用之安装配置介绍

一.redis介绍: 1.redis定义: Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起,Redis的开发工作由VMware主持.redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set --有序集合)和hash(哈希类型).这些数据类型都

Linux下安装配置MongoDB数据库

说明: 操作系统:CentOS 5.X 64位 IP地址:192.168.21.130 实现目的: 安装配置MongoDB数据库 具体操作: 一.关闭SElinux.配置防火墙 1.vi /etc/selinux/config #SELINUX=enforcing #注释掉 #SELINUXTYPE=targeted #注释掉 SELINUX=disabled #增加 :wq!  #保存退出 setenforce 0 #使配置立即生效 2.vi /etc/sysconfig/iptables  

Linux下安装配置Apache服务器

Linux下安装配置Apache服务器 1. 安装Apache [[email protected] ~]# yum –y install httpd 2. 启动Apache [[email protected] ~]# systemctl start httpd 3. 查看进程 [[email protected] ~]# systemctl status httpd httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib

Exchange2016正式版功能介绍及全新安装配置

Exchange2016功能介绍及全新安装配置 说到Exchange服务相信很多人都在关注,微软在2015年更新了很多服务,从功能上来说确实做了很多优化及提升,具体就不多说了,微软在2015年10月1日发布了Exchange2016正式版,版本还是分为标准版和企业版,此次发布为多语言版本 同样微软在2015年发布了那些新产品呢 : 我们还是说说Exchange2016,从安装及官网文档上看微软从Exchange2010到Exchange2016角色上缩减了很多,从Exchange2010的Mai