(轉載)Windows 上搭建Apache FtpServer

來源:互聯網
上載者:User

標籤:最新版   cat   加密   最新   inf   百度   rate   添加   home   

第一步:下載Apache FTPServer

可以到官網下載:http://mina.apache.org/ftpserver-project/downloads.html 目前最新版本是Apache FtpServer 1.0.6 Release,我這裡下載的就是1.1版本

第二步:解壓Apache FTPServer

將下載下來的壓縮包解壓到本地,我的是放在D盤根目錄下,其目錄結構如: 

 

第三步:修改設定檔1.修改D:\apache-ftpserver-1.0.6\res\conf\users.properties這個檔案

在該設定檔中可以增加使用者

# 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.# Password is "admin"ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3ftpserver.user.admin.homedirectory=D:/Program Filesftpserver.user.admin.enableflag=trueftpserver.user.admin.writepermission=trueftpserver.user.admin.maxloginnumber=0ftpserver.user.admin.maxloginperip=0ftpserver.user.admin.idletime=0ftpserver.user.admin.uploadrate=0ftpserver.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

#密碼 配置新的使用者
ftpserver.user.lxw.userpassword=123456
#主目錄
ftpserver.user.lxw.homedirectory=./res/home
#目前使用者可用
ftpserver.user.lxw.enableflag=true
#具有上傳許可權
ftpserver.user.lxw.writepermission=true
#最大登陸使用者數為20
ftpserver.user.lxw.maxloginnumber=20
#同IP登陸使用者數為2
ftpserver.user.lxw.maxloginperip=2
#空閑時間為300秒
ftpserver.user.lxw.idletime=300
#上傳速率限制為480000位元組每秒
ftpserver.user.lxw.uploadrate=48000000
#下載速率限制為480000位元組每秒
ftpserver.user.lxw.downloadrate=48000000

PS:如果不希望匿名登入的話,可以將匿名使用者這個配置注釋掉

2.修改D:\apache-ftpserver-1.0.6\res\conf\ftpd-typical.xml這個檔案
<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>        <!-- 預設連接埠是2121,可以修改為自己的連接埠 -->        <nio-listener name="default" port="2121">              <ssl>                <keystore file="./res/ftpserver.jks" password="password" />            </ssl>        </nio-listener>    </listeners>    <file-user-manager file="./res/conf/users.properties" encrypt-passwords="clear"/>    <!-- 添加encrypt-passwords="clear",將密碼加密方式修改給clear 這樣配置密碼的時候就不用md5加密了--></server>
第四步:啟動FTPServer

開啟CMD命令視窗,切換到D:\apache-ftpserver-1.0.6\bin這個目錄下 輸入以下命令:

service installftpd.bat res/conf/ftpd-typical.xml

注意:第二條命令的執行需要在環境變數中配置JAVA_HOME,否則會報錯,自行百度。

運行結果如:

 

PS:FTPServer started 說明FTP服務已經啟動成功

第五步:訪問FTP

在遊覽器中,輸入ftp://ip:2121進行訪問,如果連接埠修改了,要換成對應的連接埠,ip就是FTP所在的伺服器的ip,訪問如所示:

 

第六步:FTPServer的啟動與關閉

如果將這個dos命令列關掉,則ftp服務停止。因此需要把第四步的啟動製作成bat檔案,內容為:

d:cd D:\apache-ftpserver-1.0.5\binftpd.bat res/conf/ftpd-typical.xml

隨便起一個名字xx,命名為xx.bat,點擊即可啟動ftp伺服器。

(轉載)Windows 上搭建Apache FtpServer

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.