Thursday, April 30, 2009

Running Flash Media Server 3.5 and Apache 2.2 together

Working on a project, I had to run Apache 2.2 server along with Adobe's Flash Media Server 3.5. The default installation, which includes apache server, is a kind of reverse proxy being implemented by FMS. It listens to port 80, and forwards all the packets which it is not able to understand to Apache HTTP server, which is running on some other port. This arrangement works fine for most of applications and provides a great way to stream live video especially through Adobe's RTMPT protocol.

My project required that the client continuously polls for some data, which is serviced by Apache. However, i noticed that after running without any glitches for some time, the FMS stops forwarding the packets to Apache. This is confirmed by apache log, which shows no requests from "localhost" or 127.0.0.1 after some time. Googling it was of no help, as i was not able to find any article or post regarding this problem (Okay, my googling skills are questionable, but then what is the harm of writing one post on this problem.)

Even after wearing my thinking cap, and banging my head on keyboard, i was not able to find the cause why FMS behaves this way. So the workaround i used is that i made Apache listen to port 80 (throwing FMS to some other port.). Then what remained was to reverse proxy FMS packets. Since i was using RTMPT protocol, with the help of some other posts, i was able to do so through these commands.

Reverse proxying /open/ to http://localhost:{FMS port number}/open/
and doing same for idle, close, and send.

After that, the arrangement worked fine.

No comments:

Post a Comment