• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Why are there 2 directories for media - 1 under webroot and 1 under applications?

Guest
May 26, 2009 May 26, 2009

Copy link to clipboard

Copied

Hi,

I have installed FMS and we are evalauating it as a streaming server.

If I understand the documentation correctly, all the media files for streaming need to be stored in this directory:

/..../applications/vod/media

However, if I want the file to be available (downloadable) over http, it needs to be located under webroot.

/..../webroot/

Now my question is, why can't I just create a symbolic link in .../webroot/media to point at .../applications/vod/media.

In general, we'd like to make every file streamable and downloadable.

My thinking is, the sym link allow us to not have to upload every file to two places.

Am I missing something?  Are there security concerns?  What is the idea behind having 2 directories?  I assume that the FMS can handle streaming and downloading of a file at the same time.

Jeph

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Jun 02, 2009 Jun 02, 2009

Jay is right.

The server was configured with two directories because many customers don't want their media available for download over HTTP. The vod/media folder is for RTMP streaming only. Other customers need their media available over HTTP as well as RTMP. The webroot/vod folder is for these files.

Here's how the configuration works:

If you look in the fms.ini file (rootinstallationfolder/conf), you'll see two parameters that set the location of vod media files:

VOD_COMMON_DIR = C:\Program Files\

...

Votes

Translate

Translate
Guest
Jun 02, 2009 Jun 02, 2009

Copy link to clipboard

Copied

You can create a symbolic link... there's just no built in facilities for FMS to do it automatically. You'd need to do the Apache configuration yourself... but there's n oreason you couldn't make Apache's httproot point to the applications/vod/media folder.

The thing to understand is that there isn't any real integration between FMS and Apache... FMS just proxies HTTP requests to a given port (configured in fms.ini). Whatever happens to be listening on that port is responsible for handling the request after FMS hands it off.

As for security concerns, they are the same as any other HTTP server installation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 02, 2009 Jun 02, 2009

Copy link to clipboard

Copied

Jay is right.

The server was configured with two directories because many customers don't want their media available for download over HTTP. The vod/media folder is for RTMP streaming only. Other customers need their media available over HTTP as well as RTMP. The webroot/vod folder is for these files.

Here's how the configuration works:

If you look in the fms.ini file (rootinstallationfolder/conf), you'll see two parameters that set the location of vod media files:

VOD_COMMON_DIR = C:\Program Files\Adobe\Flash Media Server 3.5\webroot\vod

VOD_DIR = C:\Program Files\Adobe\Flash Media Server 3.5\applications\vod\media

These parameters are used in the <Streams> tag of the Application.xml configuration file in the rootinstallationfolder/applications/vod folder. They tell FMS that it can stream files from either of those locations.

/webroot is the Apache webroot. The Apache httpd.conf file (rootinstallationfolder\Apache2.2\conf) sets the location of the webroot folder. Anything under this folder can be downloaded.

For streaming only, put the files in the vod/media folder. For streaming + downloading, put the files in the webroot/vod folder.

HTH,

Jody

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 10, 2009 Jun 10, 2009

Copy link to clipboard

Copied

Jody you are great!!!:)

But I have another question for you.

I understand all passage to store file for RTMP protocol and also for HTTP protocol but now I have a simple dubt.

What is the code to take a file from the application/vod/media and not from webroot/vod.

Thanks for all answers!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 10, 2009 Jun 10, 2009

Copy link to clipboard

Copied

The same RTMP string streams the file from both locations.

To play the file over HTTP (if the file is in the webroot\vod directory), use an http:// string.

If you installed Apache with FMS, open the following in a browser (substitute a domain name or IP address for "localhost" if the browser isn't on the same computer as Apache/FMS):

http://localhost/videoplayer.html

The webroot\vod folder contains the sample file "sample2_1000kbps.f4v".

You can stream that file from the video player over RTMP with the following url:

rtmp://localhost/vod/mp4:sample2_1000kbps.f4v

You can progressively download the same file over HTTP with the url:

http://localhost/vod/sample2.1000kbps.f4v

HTH,

Jody

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2009 Jun 10, 2009

Copy link to clipboard

Copied

fraxdevel:

I understand all passage to store file for RTMP protocol and also for HTTP protocol but now I have a simple dubt.

What is the code to take a file from the application/vod/media and not from webroot/vod.

If you don't touch any of the default configs, and don't write any custom scripts, there is no code to do this. You're not expected to put different files with the same name in both the VOD_COMMON_DIR and the VOD_DIR. If you want different streams for PD and RTMP, use different names, or don't put them in the common directory.

I think that, with the default settings, any stream you play from VOD will look in VOD_COMMON_DIR (webroot/vod) first, and only if there's no such file will it then check VOD_DIR (applications/vod/media). But I don't think this ordering is documented, or even necessarily intended; that's just the way it happens to work in 3.5. Which means any settings-based workarounds aren't guaranteed to work in future versions. But if you want to try it, just swap the paths in fms.ini, or go into Application.xml and swap the VOD_COMMON_DIR and VOD_DIR lines, and RTMP clients should (with this version of FMS) get the application/vod/media version instead of the webroot/vod version.

The question is, what are you trying to accomplish here? If you have some kind of complicated deployment scheme that's uploading the files this way, it's probably easier to change your deployment than to change your delivery. But if you want to, you can use server-side AS and/or a C++ plugin to adjust the virtual stream name or change the physical mapping for it or whatever, to ensure that RTMP gets the file you want.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 10, 2009 Jun 10, 2009

Copy link to clipboard

Copied

I think that, with the default settings, any stream you play from VOD will look in VOD_COMMON_DIR (webroot/vod) first, and only if there's no such file will it then check VOD_DIR (applications/vod/media). But I don't think this ordering is documented, or even necessarily intended; that's just the way it happens to work in 3.5

This is not true.

With the default settings (I changed nothing), streaming only comes from /..../applications/vod/media. 

This is why I asked the question in the first place.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2009 Jun 10, 2009

Copy link to clipboard

Copied

LATEST

jephperro2 wrote:

I think that, with the default settings, any stream you play from VOD will look in VOD_COMMON_DIR (webroot/vod) first, and only if there's no such file will it then check VOD_DIR (applications/vod/media). But I don't think this ordering is documented, or even necessarily intended; that's just the way it happens to work in 3.5

This is not true.

With the default settings (I changed nothing), streaming only comes from /..../applications/vod/media. 

This is why I asked the question in the first place.

Your sentence is a bit ambiguous. Maybe our docs are ambiguous and need to be clarified?

Does "streaming only comes from..." mean "streaming-only files (as opposed to streaming-or-download files) come from..." or "streaming (with or without downloading) comes from only..."?

As Jody's answer to your initial post explained, streaming-only comes from applications/vod/media; streaming-or-download comes from webroot/vod; so if you only care about streaming, that comes from either one.

The question is, what happens if you put different files, with the same name, in both locations? I haven't tested that recently, but from the fact that fraxdevel was asking how to get the one in applications/vod/media, it seems like a good bet that my memory is right here (for a rare change), and the one you get is the one in webroot/vod. But again, whatever happens is something you shouldn't rely on in future versions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines