Hello All.
I am trying to run Apache FTP server on a Linux box and I ma having problems
with the port binding.
I have setup iptables on the Linux machine to redirect ports 20 and 21 to
10120 and 10121 respectivly.
In my application code, I set the port number on the ListenerFactory to
10121 which appears to work (as I can see the port binding using a netstat
-a).
How do I set the port binding for the FTP data connection (20) in my code?
I have tried the following:
ListenerFactory ftpfactory = new ListenerFactory();
ftpfactory.setPort(10121);
DataConnectionConfigurationFactory dataConnFactory = new
DataConnectionConfigurationFactory();
dataConnFactory.setActiveLocalPort(10120);
ftpfactory.setDataConnectionConfiguration(dataConnFactory.createDataConnectionConfiguration());
serverFactory.addListener("default",
ftpfactory.createListener());
ftpServer = serverFactory.createServer();
Using the code above does not yeld the result that I was expecting (a
binding to 10120) as I cannot see it using netstat -a and the connection
does not appear to work.
Can anyone advise me on how to configure the port binding for the FTP data
port.
Regards