20- Deploy Red5 Application

  1. MAKE A WAR FILE: open a command prompt, and go to the directory where the application to deploy is located, like this:
    cd C:\Documents and Settings\Administrator\My Documents\Eclipse\testapp

    Now type in: ant -p
    (this will list all the targets in the ant build file for this project)

    Now type in:
    ant

    It should say BUILD SUCCESSFUL. This means you have built the war file.
  2. A new dist directory will have been created inside your project directory. Go to the dist directory of your project, for example: cd C:\Documents and Settings\Administrator\My Documents\Eclipse\testapp\dist and you will see the war file there called testapp.war. Copy that war file and paste it into the webapps directory where you installed Red5. For example: C:\Program Files\Red5\webapps. Within 10 minutes, this war file will be turned into a directory called testapp and the project will be located there. (Red5 service has a WarDeployerService that runs every 10 minutes) But first you need to restart red5 (next step).
  3. RESTART RED5: Open Control Panel, click on Administrative Tools, click on Services, find the Red5 service, right click on it and choose Stop, then right click on it again and choose Start
  4. CONFIGURE WARDEPLOYERSERVICE INTERVAL: If you don't want to wait 10 minutes for the war file to deploy itself, you can change that 10 minute value. Go to the conf directory where you installed Red5, for example: C:\Program Files\Red5\conf, open the red5-common.xml file in notepad, find the WarDeployerService bean and change the checkInterval value. By default it is 600,000 miliseconds (or 10 minutes).
    <bean id="warDeployService" class="org.red5.server.service.WarDeployer" init-method="init" destroy-method="shutdown">
        <property name="scheduler" ref="schedulingService"/>
        <property name="checkInterval" value="600000"/>
        <property name="deploymentDirectory" value="${red5.root}/webapps"/>
    </bean>
    

    (On your local computer you may want to make it smaller so you don't have to wait 10 minutes, but on your server, you may want to leave it 10 minutes, because you won't deploy it as often, and it may take up extra resources to set it lower.)
  5. TO MAKE CHANGES TO YOUR PROJECT AFTER LAUNCH: delete the war file and delete the new directory it creates. Copy the new war file into the webapps directory. Stop and start Red5, then wait 10 minutes for the WarDeployerService to deploy the war file and create the testapp directory.
« Back to Home