
51
FLASH
MEDIA
SERVER
4.5
CONFIGURATION
AND
ADMINISTRATION
Configuring the server
Last updated 11/28/2012
Mapping virtual directories to physical directories
Flash Media Server stores recorded streams and video and audio files in default locations in the application directory.
In some scenarios, you might want to specify particular locations for these resources, but without restricting access by
application or application instance. By mapping a virtual directory to a physical directory, you do not need to copy
resources to Flash Media Server’s application directory, and you can retain your existing classification and
categorization of resources.
To map a virtual directory for an application, you can use the
<VirtualDirectory>
element in the Vhost.xml or the
Application.xml file. This element provides various options:
•
You can specify a virtual directory name or not. When a name is specified, the server maps the name to the specified
directory and first looks for the stream in the specified directory.
•
You can specify multiple physical directories for a single virtual directory. Use multiple
<Streams>
tags.
•
When specified in an application-specific Application.xml file,
<VirtualDirectory>
controls only the storage
location of resources for that application. Any instance of the application can access video files in that location
(unlike with
<storageDir>)
, but other applications cannot.
•
When specified in the virtual-host Application.xml file or the Vhost.xml file,
<VirtualDirectory>
controls the
storage location of all applications on that virtual host. All applications on the virtual host can access video files in
the specified location, although Adobe recommends that if you want control at the virtual host level, you configure
the
<VirtualDirectory>
tag in Vhost.xml file instead of the virtual-host Application.xml file.
If you are creating a new virtual directory for a File object (as opposed to a stream), you must also enable the
VirtualDirectoryForFile
option in the Server.xml file. For more information, see “
Enable virtual directory
mappings for server-side File objects
” on page 44.
The order in which the server determines the correct directory to use for streams is as follows:
1
Virtual directory (as specified in
<VirtualDirectory>
)
2
Storage directory (as specified in
<storageDir>
)
3
Default location (the streams folder in the application directory)
Note:
Adobe strongly recommends that folders that store streams always contain only streams and no other application
files.
Virtual directory example: vod
One usage scenario for this element is to specify a directory to use for a specific vod application and put video files in
this directory to stream them instantly. You would use the
<VirtualDirectory>
element in the application-specific
Application.xml file. To map a directory in this way, edit the application-specific Application.xml file to include the
virtual directory, as shown in the following example:
<Application>
<StreamManager>
<VirtualDirectory>
<!-- Specifies application specific virtual directory mapping for recorded
streams. -->
<Streams>/;C:\my_videos</Streams>
</VirtualDirectory>
</StreamManager>
</Application>
This code overrides the VHost.xml file’s mapping of '/' (if it exists) for this application only. To play a file in the virtual
directory, such as
C:\my_videos\sample.flv
, a client connects to the vod application and calls
NetStream.play()
: