Here you will learn how to develop and deploy an Aspera Embedded Server.
For an embedded server deployment you need a SSH server installed on the target machine. For Linux, Solaris and other POSIX systems you can use the SSH server that came with your system. If you are using Windows you will need to install a SSH server, please reference the SSH server options for Windows or contact us for assistance. To get your application to act as a server for FASP transfers you will need the following files, all of these files are found in the Aspera Redistributable Package:
- Aspera Transfer Engine (ascp or ascp.exe) - This is used to initiate the transfers.
- Aspera Configuration File (aspera.conf) - This is an XML based file that contains the configuration for the server.
- Aspera License File (aspera-license) - This is the license file that should be used for your setup
- Aspera SSH port Checker (aspshell.exe) - This is optional, and ensures that the SSH port opened by the Server is not used for anything except the Aspera transfers and browsers.
- Asper Client Browser (ascmd.exe) - This is optional, but is required if you need to support file browsing for an Aspera Client.
- Dependencies - This is optional and if needed would be included with the transfer engine found in the Redistributable Package.
In order to use server functionality you need to have an Aspera Server License. The license file that is available in the Redistributable Package is a free Aspera Connect license that is not capable of supporting server functionality. To get more information or to obtain a license please contact your Aspera Account Manager.
Now that you have your needed files and SSH running you need to package and deploy all of the files to the target machine along with your custom application; you can copy these files to any directory, however, it is imperative that they are all in the same directory. You will also need to add ascp and ascmd to the system path. There are several ways to accomplish this, for example:
- Add the location of ascp and ascmd to the System Path.
- Copy the files ascp and ascmd to the system directory (this is not recommended).
- Create a soft symbolic link to ascp and ascmd in the system directory (/usr/bin).
All configuration on the server is done by editing the aspera.conf file. You can learn more about the configuration options by reviewing the aspera.conf example file. To configure the path to the Aspera transfer engine in your FASP Manager environment you should call one of the following methods (depending on what language you are using), if you do not FASP Manager may be able to detect and use the ascp transfer engine at runtime, however, by setting it manually you ensure it will run successfully and avoid ambiguity if multiple copies of ascp are installed.
For example, you could run the following command in C# or Java to set the path to C:\\Program Files\Aspera\Enterprise Server\bin\ascp.exe.
Environment.setFasp2ScpPath("C:\\Program Files\\Aspera\\Enterprise Server\\bin\\ascp.exe");
That is actually all it takes to support FASP transfers. With the above commands you will be able to connect to the server and perform transfers. If you wish to take further control over the behavior you can use the following commands. For the full list of options and methods please see the API Docs.
To subscribe your instance of FASP Manager for notifications about the transfers being initiated to your server by Aspera Clients you can call the following method (depending on the language you are using), if the argument is true FASP Manager will write the management port to a file that is used by ascp, if false FASP Manager will delete the management port file if it already exists.
A potential drawback to the subscription method above is that your server allows transfers even when your custom application is not running. If you would prefer not to let any transfers happen if your application is not running you can either, choose a random local port number on the machine (high numbers are best for this purpose) or use the methods below to set a port. You also need to create a plain text file on the filesystem that contains the port number you have chosen. This file should be named "[your_app_name].port" and should be located in the /var/run/aspera directory of the ascp installation. You should leave this file on the system even when your application is not running.
To receive transfer events in your application you need to add a global listener/callback to FASP Manager, this can be accomplished by use the following method.