Deploy an application
Register an application with the server
To connect to an application, the server must know that the application exists. This process is called registering the application with the server. To register an application with the server, create a folder for the application in the applications folder. For example, create the following folder to register an application called “myApplication”:
The client-side code that connects to the application looks like the following:
To create instances of an application, create subfolders. For example, the following folder creates an instance of myApplication called “room1”:
The client-side code that connects to the application instance looks like the following:
Every application must have a folder in the applications folder. Usually, the application folder contains the server-side script and any media assets, but the folder can also be empty. It can also contain an application-specific Application.xml file.
By default, the applications folder is in the root installation folder (C:\Program Files\Adobe\Adobe Media Server 5\applications, on Windows). To configure the location of the applications folder, edit the fms.ini or the Vhost.xml configuration file. In the fms.ini file, edit the following parameter: VHOST.APPSDIR = C:\Program Files\Adobe\Adobe Media Server 5\applications. In the Vhost.xml file, edit the AppsDir element.
Copy server-side script files to the server
Copy server-side script files for an application to the folder you registered on the server. For example, for an application called “videoPlayer”, copy the main.asc file to rootinstall/applications/videoPlayer. You can also place server-side scripts in “scripts” subfolder. For example, you can use either of these locations:
To replace a running application, copy the new files, then use the Administration Console to restart the application.
Packaging server-side files
Adobe Media Server includes a command-line archive compiler utility, far.exe, which lets you package server-side scripts into a FAR file, which is an archive file like a ZIP file, to simplify deployment. You can also use the archive compiler utility to compile server-side script files to bytecode (with the file extension .ase) to speed the time required to load an application instance.
A large application can contain multiple server-side script files stored in different locations. Some files are located in the application directory and others are scattered in the script library paths that are defined in the server configuration file. To simplify deployment of your media application, you can package your server-side JS, ASC, and ASE files in a self-contained Adobe Media Server archive file (a FAR file).
The FAR file is a package that includes the main script file (which is either main.js, main.asc, main.ase, applicationName.js, applicationName.asc, or applicationName.ase) and any other script files that are referred to in the main script.
The syntax for running the archive compiler utility to create a script package is as follows:
c:\> far -package -archive <archive> -files <file1> [<file2> ... <fileN>]
The following table describes the command-line options available for far -package.
Specifies the name of the archive file, which has a .far extension.
-files file1 [ file2 ... fileN ]
Specifies the list of files to be included in the archive file. At least one file is required.
If the main script refers to scripts in a subdirectory, the hierarchy must be maintained in the archive file. To maintain this hierarchy, Adobe recommends that you run the FAR utility in the same directory where the main script is located.
Copy media files to the server
Copy video and audio files to the streams/_definst_ folder in the application folder:
If an application connects to an instance of the application, for example, nc.connect("rtmp://fms.example.com/someapplication/someinstance"), place the streams in the following folder:
There are several ways to configure the server to look for media files stored in other locations. For example, the vod streaming service that installs with the server is configured to look for media files in the rootinstall/applications/vod/media folder.
Copy client-side files to a web server
You can deploy SWF files and HTML files on any web server. The SWF file contains the NetConnection.connect() call that connects to the application on Adobe Media Server. The HTML file is a container for the SWF file. For more information, see the Flash documentation at www.adobe.com/support/flash.
For more information about deploying AIR applications, see the Adobe AIR documentation at www.adobe.com/support/air.
By default, Adobe Media Server 5.0 and later install with Apache HTTP Server. If you installed and enabled the web server, you can deploy SWF files and HTML files from the same computer on which Adobe Media Server is installed. You can also deploy JPG, GIF, and many other file types. For a complete list of the file types Apache serves by default, see the rootinstall/Apache2.4/conf/httpd.conf file.
By default, Apache is configured with the following aliases:
To serve files over HTTP, place the files in the rootinstall/webroot folder or an appropriate subfolder. To serve CGI programs, place the files in the rootinstall/Apache2.4/cgi-bin folder.
You can also add subfolders to these folders. Subfolders cannot use the following names from the fmshttpd.conf file: icons, error, SWFs, vod, or cgi-bin. In addition, subfolder names cannot use the following reserved words: open, send, idle, fcs, fms.
By default, Apache is configured to serve all HTTP content from the rootinstall/webroot folder. If you want to provision the server to serve files from application-specific directories, edit the httpd.conf Apache configuration file.