Run
Api2File is simple to run on Linux, Windows or Docker. Each hosting model has it's quirks, which are explained below.
These guides assume the installation and configuration steps have been completed.
Windows
Windows is perhaps the most involved in terms of hosting Api2File. The primary difficulty comes from pre-existing services running on the Windows OS that utilise the standard SMB port (445).
Manually starting Api2File
For testing purposes, the easiest way to start Api2File is via the Command Line Interface (or CLI). All log messages are written to the console and the application is easy to stop and start during testing.
Execute the api2file.cli.exe file by double clicking it from an Explorer window or running it from a command line.
Windows Service
Api2File for windows ships with a Windows service executable. This executable allows Api2File to be installed as a windows service and be started automatically on system boot or without an interactive user logon.
From a command prompt, execute the following command to install Api2File as a service api2file.WindowsService.exe install.
The windows service attributes can be administered using Windows' services.msc control panel page.
Changes made to the apis.yaml file are not automatically picked up by the Windows service. Restart the service to cause the configuration to be reloaded and changes to be applied.
Freeing up port 445
If Api2File is run directly on windows, it is likely the following error will be encountered:
Application failed to start. Application configuration is invalid: Property: 'Server -> IpAddress' - Message: 'Port 445 not available for use.'
To enable Api2File to use port 445 on the local windows machine as a machine administrator:
- sc stop lanmanserver
- sc config lanmanserver start=disabled
- reboot computer
The above commands disable the local 'Server' service on Windows. This will prevent local disks & printers being shared, but will allow Api2File to serve API data on the standard SMB port.
Linux
Linux doesn't come bundled with any services that use the same network ports as Api2File so the service will normally start without any additional system configuration.
Starting Api2File
From the installation directory, run ./api2file.cli to start Api2File.
Testing Api2File is running correctly
Testing can be done from any computer on the same network as the server with Api2File . Any SMB compatible client can be used.
Windows
Windows file explorer is the most readily available SMB client on windows. Using either Map Network Drive or Add network location specify the name or IP address of the server running Api2File .
Linux
It is recommended to use smbclient to test on Linux. Smbclient can be installed using the systems' package manager (such as apt-get or yum).