Deploying your red5 application - rajdeeprath/red5-development-series GitHub Wiki

Following the previous lessons, If you have created and tested your red5 application well enough you are probably ready to deploy your project to a red5 server and run it from there.

Just to be clear i wont be talking about various hosting options, cloud services etc. This lesson is just about deploying your completed red5 application on a red5 server and running it. For simplicity we wil be considering the application project "myapp" that we have been discussing all along in each lesson.

Applications can be deployed to red5 in 2 ways:
  • Deploying the entire application folder along with sub folders into the production red5 media server's webapps directory.

  • Packaging application into a war archive file and deploying it to red5 media server's webapps folder.

In both case, once the application files have been deployed into red5's web-apps folder, you must restart red5 media server. In contrast to raw folders, a war package has an ability to auto-unpack on red5. We discuss this along this page.

DEPLOYING APPLICATION FOLDER TO RED5 MEDIA SERVER

If you built your application use using an application template, or red5-plugin generated facet or the maven template and used a red5-rntime based local server to debug it, your application is already good to be deployed for production.

App structure

You can simply copy the myapp output folder from your {RED5HOME}/webapps and relocate it your production site {RED5HOME}/webapps. Finally restart the prod server for the application to run.

DEPLOYING APPLICATION WAR TO RED5 MEDIA SERVER

A better and more professional way to deploy applications is to use the war format. The 'war' file format is like a simple archive packaging the content of the myapp application. All you need to do is select all files from the application's root and package them into a war archive. You can do this with any standard archiving software such as winzip / 7zip.

SCREENCAST - PACKAGING RED5 APPLICATION AS WAR.

Alt text for your video

On the production side, when you deploy a war package into the {RED5HOME}/webapps folder, the periodic process - Red5's WarDeployer service, will unpack the war and deploy the application to server.

This means you do not need to restart the media server. This is also known as Hot deployment!!. The war deployment service can be configured in {RED5HOME}/conf/red5.properties file by editing the value for the property - war.deploy.server.check.interval. The value presented here is in milliseconds. Set it to something shorter like 15000 or so if you want your application to be deployed sooner. This value is basically the periodic poll interval of the war deployment service.

... 
war.deploy.server.check.interval=600000 
... 

Save changes and close the file once done. And always remember to restart the server if you made configuration changes such as this.

SPECIAL NOTE FOR MAVEN USERS

If you are using the maven template to create your red5 application, you can use the maven-war-plugin, to compile and package your application files into a war archive automatically. For more information and configuration options on maven-war-plugin, you can check out the official site. This is a standard and recommended practice for professional level development workflow.