Apache FTPServer搭建FTP

Apache FtpServer是纯Java写的开源FTP服务器。

下载地址http://mina.apache.org/ftpserver/
在这里我们先不讲FTPServer的开发,主要简单认识下如何搭建FTP。

1.下载Apache FtpServer 1.0.5 Release
http://mina.apache.org/ftpserver/downloads.html

2. 解压缩到本地 

3.       修改F:/FTP/ftpserver-1.0.5/apache-ftpserver-1.0.5/res/conf/users.properties这个文件
修改后如下:
# with the License.  You may obtain a copy of the License at
#
http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
 
ftpserver.user.admin.userpassword=admin
ftpserver.user.admin.homedirectory=./res/home
ftpserver.user.admin.enableflag=true
ftpserver.user.admin.writepermission=true
ftpserver.user.admin.maxloginnumber=0
ftpserver.user.admin.maxloginperip=0
ftpserver.user.admin.idletime=0
ftpserver.user.admin.uploadrate=0
ftpserver.user.admin.downloadrate=0
 
ftpserver.user.anonymous.userpassword=
ftpserver.user.anonymous.homedirectory=./res/home
ftpserver.user.anonymous.enableflag=true
ftpserver.user.anonymous.writepermission=false
ftpserver.user.anonymous.maxloginnumber=20
ftpserver.user.anonymous.maxloginperip=2
ftpserver.user.anonymous.idletime=300
ftpserver.user.anonymous.uploadrate=4800
ftpserver.user.anonymous.downloadrate=4800
 
 
4.       修改F:/FTP/ftpserver-1.0.5/apache-ftpserver-1.0.5/res/conf/ftpd-typical.xml
修改后内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<!--
           Licensed to the Apache Software Foundation (ASF) under one or more
           contributor license agreements. See the NOTICE file distributed with
           this work for additional information regarding copyright ownership.
           The ASF licenses this file to you under the Apache License, Version
           2.0 (the "License"); you may not use this file except in compliance
           with the License. You may obtain a copy of the License at
           http://www.apache.org/licenses/LICENSE-2.0 Unless required by
           applicable law or agreed to in writing, software distributed under the
           License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
           CONDITIONS OF ANY KIND, either express or implied. See the License for
           the specific language governing permissions and limitations under the
           License.
-->
<server xmlns="http://mina.apache.org/ftpserver/spring/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
   http://mina.apache.org/ftpserver/spring/v1 http://mina.apache.org/ftpserver/ftpserver-1.0.xsd      
   "
id="myServer">
<listeners>
           <nio-listener name="default" port="21">
               <ssl>
                <keystore file="./res/ftpserver.jks" password="password" />
            </ssl>
           </nio-listener>
</listeners>
<file-user-manager file="./res/conf/users.properties" encrypt-passwords = "clear"/>
</server>
 
在这里切记将<file-user-manager file="./res/conf/users.properties" encrypt-passwords = "clear"/>
密码加密方式修改为clear
 
 
5.       安装FTPServer
进入CMD命令F:/FTP/ftpserver-1.0.5/apache-ftpserver-1.0.5/bin这个目录下执行
service install 回车
ftpd.bat res/conf/ftpd-typical.xml 回车
 
截图如下:
 

6.       测试连接FTP,这里端口为默认21,前面在配置中有修改。

  

在以后的介绍中,我们将介绍修改为FTPS加密传输。本文档只是铺垫,准备工作。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值