cancel
Showing results for 
Search instead for 
Did you mean: 

FTP Server Port range

drhalogen
Champ in-the-making
Champ in-the-making
How to config ftpDataPortLow and ftpDataPortHigh for FTP server passive mode?

i edit tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.xml

   <config evaluator="string-compare" condition="FTP Server">
          <serverEnable enabled="true"/>
          <dataPorts rangeFrom="62000" rangeTo="64000"/>

but it seems it does not take effect,
from netstat -an | grep ipaddress
4 REPLIES 4

drhalogen
Champ in-the-making
Champ in-the-making
I am using alfresco 2.9, no clues about ftp port range in log files,
Can direct idea about the usage of the configuration? 


01:57:44,756 WARN  [org.springframework.remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
01:57:48,339 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
01:57:49,237 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] No changes were made to the schema.
01:57:50,622 INFO  [org.alfresco.repo.admin.ConfigurationChecker] The Alfresco root data directory ('dir.root') is: /root/alfresco/alf_data
01:57:50,663 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
01:57:51,086 INFO  [org.alfresco.repo.module.ModuleServiceImpl] Found 0 module(s).
01:57:56,178 ERROR [org.alfresco.smb.protocol] Failed to get local domain/workgroup name, using default of WORKGROUP
01:57:56,178 ERROR [org.alfresco.smb.protocol] (This may be due to firewall settings or incorrect <broadcast> setting)
01:57:56,232 INFO  [org.alfresco.ftp.server] Starting server FTP …
01:57:56,301 WARN  [org.alfresco.util.OpenOfficeConnectionTester] A connection to OpenOffice could not be established.
01:57:56,304 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.6.0_07-b06; maximum heap size 506.313MB
01:57:56,305 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 2.9.0 (B 683) schema 116 - Installed version 2.9.0 (B 683) schema 116

drhalogen
Champ in-the-making
Champ in-the-making
the log4j.properties file i found is in

tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties

# FTP server debugging
log4j.logger.org.alfresco.ftp.protocol=debug
log4j.logger.org.alfresco.ftp.server=debug

drhalogen
Champ in-the-making
Champ in-the-making
I am using native server of Alfresco 2.9B
I just start 2.9B then use FTP Server functions, and test passive port range issue
So…. should I / can I switch to JLAN server?

I am not sure if 2.9B is running JLAN server or not, it seems that what I have studied about dataports is for JLAN server
but I don't know if alfresco 2.9B is running that or not.

compaqnx7300
Champ in-the-making
Champ in-the-making
Edit ServerConfigurationBean.java (repository project). Put code below in "protected void processFTPServerConfig(Config config)" for example after getting root directory and before ftp debug:

      // Check if a data port range has been specified

      elem = config.getConfigElement("dataPorts");
      if ( elem != null) {

         // Check for the from port range value

         int rangeFrom = -1;
         int rangeTo = -1;

         String rangeStr = elem.getAttribute("rangeFrom");
         if ( rangeStr != null && rangeStr.length() > 0) {

            // Validate the range string

            try {
               rangeFrom = Integer.parseInt(rangeStr);
            }
            catch (NumberFormatException ex) {
               throw new InvalidConfigurationException("Invalid FTP rangeFrom value, " + rangeStr);
            }
         }

         // Check for the to port range value

         rangeStr = elem.getAttribute("rangeTo");
         if ( rangeStr != null && rangeStr.length() > 0) {

            // Validate the range string

            try {
               rangeTo = Integer.parseInt(rangeStr);
            }
            catch (NumberFormatException ex) {
               throw new InvalidConfigurationException("Invalid FTP rangeTo value, " + rangeStr);
            }
         }

         // Validate the data port range values

         if ( rangeFrom == -1 || rangeTo == -1)
            throw new InvalidConfigurationException("FTP data port range from/to must be specified");

         if ( rangeFrom < 1024 || rangeFrom > 65535)
            throw new InvalidConfigurationException("Invalid FTP data port rangeFrom value, " + rangeFrom);

         if ( rangeTo < 1024 || rangeTo > 65535)
            throw new InvalidConfigurationException("Invalid FTP data port rangeTo value, " + rangeTo);

         if ( rangeFrom >= rangeTo)
            throw new InvalidConfigurationException("Invalid FTP data port range, " + rangeFrom + "-" + rangeTo);

         // Set the FTP data port range

         ftpConfig.setFTPDataPortLow(rangeFrom);
         ftpConfig.setFTPDataPortHigh(rangeTo);
      }
After this modification definition <dataPorts rangeFrom="50000" rangeTo="50100" /> in file-servers-custom.xml should work.