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这个文件

修改后如下:

扫描二维码关注公众号,回复: 296740 查看本文章

# 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,前面在配置中有修改。

 

   

 

猜你喜欢

转载自hoochiang.iteye.com/blog/2351266
今日推荐