apache FTP server 没法登陆

apache FTP server 没法登陆

apache FTP server 无法登陆

从http://mina.apache.org/ftpserver/downloads.html下载的Apache FtpServer 1.0.5 Release 解压后,运行。网页中输入ftp://localhost  提示输入账号密码,怎么也登陆不上!

因为默认的ftpd.bat 并未读取配置文件。

将ftpd.bat res/conf/ftpd-typical.xml保存为myftpd.bat,来将配置文件参数传入,执行该文件后就可以了。

在java程序中嵌入该服务器,新建java工程,并将apache-ftpserver-1.0.5commonlib 下的包加载进来,commonclasses下的log4j.properties加到src目录下,apache-ftpserver-1.0.5res放到工程目录下;

FtpServerFactory serverFactory = new FtpServerFactory();

FtpServer server = serverFactory.createServer();

// start the server

server.start();

此时也还不可以,因为也没读配置文件,加入下面代码:

PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();

userManagerFactory.setFile(new File(“此处是users.properties的路径”));

运行后服务就开启了!

apache FTP server 没法登陆

相关文章:

你感兴趣的文章:

标签云: