Install Red5 on cPanel/WHM (CentOS) server



  • On a default cPanel install these ports are allowed. If not (please ask your server admin) try turning off the firewall for a short time:
    WHM -> ConfigServer Security&Firewall -> [Firewall Disable]
    If this solves the problem, you must configure csf to accept connections on these ports.



  • Red5 installation issues on a WHM VPS, CentOS 5.5 "virtuozzo"

    I am having a problem, facing an error when running "ant prepare"

    [property] java.io.IOException: Cannot run program "/bin/env": java.io.IOException: error=12, Cannot allocate memory
    

    After hunting a lot for this I just got some tweaks to handle this exception, and every one has been using the way to handle this error.
    I found a simple Java program (source below) which actually reproduces the error when running on a machine (WHM 11.26.8, CENTOS 5.5 i686 "virtuozzo") in my case. I am using a simple Java program only to reproduce the problem for the experts here so that they can provide a good solution to fix the problem I am facing during the Red5 Installation on the same VPS.
    Java Program (DoRuntime.java)

    import java.io.*;
    
    public class DoRuntime {
       public static void main(String args[]) throws IOException {
    
          Runtime runtime = Runtime.getRuntime();
    
          long total = runtime.totalMemory();
          long max = runtime.maxMemory();
          long free = runtime.freeMemory();
          System.out.println("total: " + total);
          System.out.println("max: " + max);
          System.out.println("free: " + free);
    
          Process process = runtime.exec("/bin/ls");
          InputStream is = process.getInputStream();
          InputStreamReader isr = new InputStreamReader(is);
          BufferedReader br = new BufferedReader(isr);
          String line;
    
          while ((line = br.readLine()) != null) {
             System.out.println(line);
          }
       }
    }
    

    According to the references I found, if we are suck with the said error, we would need to specify the heap size on runtime(or set in conf)when running Java applications. So I tried to run the same program on my VPS where I was actually facing trouble during the Red5 Installation. Here I got exactly the same error (as in Red5 installation) when I run "java DoRuntime" with the above code in it.

    [/usr/local/j2se]# java DoRuntime
    total: 5177344
    max: 532742144
    free: 4972208
    Exception in thread "main" java.io.IOException: Cannot run program "/bin/ls": java.io.IOException: error=12, Cannot allocate memory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
            at java.lang.Runtime.exec(Runtime.java:610)
            at java.lang.Runtime.exec(Runtime.java:448)
            at java.lang.Runtime.exec(Runtime.java:345)
            at DoRuntime.main(DoRuntime.java:15)
    Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
            at java.lang.ProcessImpl.start(ProcessImpl.java:81)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
            ... 4 more</init> 
    

    So when i tried to follow those options to specify the Heap Size while executing the above program, the system could not let Java avail the specified heap size. Following is what I got.

     [/usr/local/j2se]# java "-Xms512m -Xmx512m" DoRuntime
    Invalid initial heap size: -Xms512m -Xmx512m
    Could not create the Java virtual machine.
    
    ```Above even could not work with "-Xms1m -Xmx1m" or any other values. Same error was being resulted.
    
    Any ways, I now tried to figure it out that what the hell is the problem now. I, then, just found some thing related to modify the SWAP space on the Linux machine on which all this sh!t is happening. And as I am not a very good in Linux, so I started searching on how could I modify SWAP Space, and blah blah…. finally when I got well stated tutorial for that I started going on. and what I got was just where I am currently stuck at...... :/ The WHM VPS "virtuozzo" is not letting me modify Swap size.
    
    I am currently trying to get a workaround to fix this issue and posted a thread at
    http://www.linuxquestions.org/questions/linux-general-1/swap-space-problem-833192/
    
    But I am still stuck on it, and need a good solution if there is. I really need to install Red5 on the VPS mentioned. I even don't know if the problem is with the VPS.
    
    Thanks


  • Do you have a 32 bit or 64 bit architecture?



  • Hello,

    I follow the instructions on Windows 2008 with all libraries copied into c:\Program Files (x86)\Red5\webapps\JabberCamApp\WEB-INF\lib\

    • commons-dbcp-1.4.jar
    • mysql-connector-java-5.1.13-bin.jar
    • tomcat-dbcp.jar

    but I'm still experiencing:
    [WARN] [WrapperSimpleAppMain] org.apache.catalina.core.NamingContextListener - Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]

    Can you please help we with some suggestions?



  • Great info!

    This also may be helpful: here is a tutorial for installing latest JDK from their site and latest Red5 from subversion:
    http://www. videochat-scripts.com/installed-red5-08-rc3-with-jdk-1613-on-linux/



  • I'm using CentOS 6 with Red5 0.8.0. I've almost got this thing working, but am still getting the following error in /usr/local/red5/log/error.log despite having tomcat-dbcp.jar and commons-dbcp-1.4.jar in /usr/local/red5/webapps/ChatrouletteApp/WEB-INF/lib. Any help would be immensely appreciated. The applications show up properly in the Red5 admin panel, but of course don't work yet as a result of this problem.

    2011-10-24 10:49:56,111 [main] WARN  o.a.c.core.NamingContextListener - Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]
    


  • Question: How do I test it to know if it is installed correctly? I have a working admin login but no clue what to do with it.

    I am trying to add the RVC 8 but even though it loads on the site, provides the popup to input a user name, nothing else happens when clicking start.

    Also, the config instructions indicate I can turn of the login but I cannot find those options in config file?



  • After reading your posts, it seems you are confusing RVC with SVC. These two are different.



  • Hi

    I have a problem when start red5 . here is a log file for your ref.

    Setting default logging context: default
    [INFO] [main] org.red5.server.Launcher – Red5 Server 1.0.0 RC3 $Rev: 4407 $ (http://code.google.com/p/red5/)
    Red5 Server 1.0.0 RC3 $Rev: 4407 $ (http://code.google.com/p/red5/)
    [INFO] [main] org.springframework.context.support.FileSystemXmlApplicationContext – Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@7b5a6029: startup date [Fri Sep 07 09:24:02 SGT 2012]; root of context hierarchy
    [INFO] [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader – Loading XML bean definitions from class path resource [red5.xml]
    [INFO] [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader – Loading XML bean definitions from class path resource [jee-container.xml]
    [INFO] [main] org.springframework.beans.factory.config.PropertyPlaceholderConfigurer – Loading properties file from class path resource [red5.properties]
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFactory – Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@44cbbe: defining beans [placeholderConfig,red5.common,red5.core,context.loader,pluginLauncher,tomcat.server]; root of factory hierarchy
    [INFO] [main] org.springframework.context.support.FileSystemXmlApplicationContext – Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@fc54796: startup date [Fri Sep 07 09:24:02 SGT 2012]; root of context hierarchy
    [INFO] [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader – Loading XML bean definitions from class path resource [red5-common.xml]
    [INFO] [main] org.springframework.beans.factory.config.PropertyPlaceholderConfigurer – Loading properties file from class path resource [red5.properties]
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFactory – Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2ba99347: defining beans [placeholderConfig,red5.server,rmiRegistry,mbeanServer,org.springframework.jmx.support.ConnectorServerFactoryBean#0,mbeanExporter,serializer,deserializer,minaEncoder,minaDecoder,statusObjectService,rtmpCodecFactory,rtmptCodecFactory,remotingCodecFactory,streamableFileFactory,filePersistenceThread,sharedObjectService,streamService,providerService,consumerService,schedulingService,warDeployService,remotingClient,object.cache,keyframe.cache,flv.impl,flvreader.impl,mp4reader.impl,mp3reader.impl,org.springframework.beans.factory.config.MethodInvokingFactoryBean#0,org.springframework.beans.factory.config.MethodInvokingFactoryBean#1,streamExecutor,fileConsumer,playlistSubscriberStream,clientBroadcastStream]; root of factory hierarchy
    [INFO] [main] org.springframework.remoting.rmi.RmiRegistryFactoryBean – Creating new RMI registry
    [INFO] [main] org.springframework.jmx.support.ConnectorServerFactoryBean – JMX connector server started: javax.management.remote.rmi.RMIConnectorServer@79b4748
    [INFO] [main] org.springframework.jmx.export.annotation.AnnotationMBeanExporter – Registering beans for JMX exposure on startup
    [INFO] [main] org.springframework.jmx.export.annotation.AnnotationMBeanExporter – Bean with name ‘org.springframework.jmx.support.ConnectorServerFactoryBean#0′ has been autodetected for JMX exposure
    [INFO] [main] org.quartz.core.SchedulerSignalerImpl – Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
    [INFO] [main] org.quartz.core.QuartzScheduler – Quartz Scheduler v.1.8.5 created.
    [INFO] [main] org.quartz.simpl.RAMJobStore – RAMJobStore initialized.
    [INFO] [main] org.quartz.core.QuartzScheduler – Scheduler meta-data: Quartz Scheduler (v1.8.5) ‘Red5_Scheduler’ with instanceId ‘vps.healthbook.sg1346981043069′
    Scheduler class: ‘org.quartz.core.QuartzScheduler’ – running locally.
    NOT STARTED.
    Currently in standby mode.
    Number of jobs executed: 0
    Using thread pool ‘org.quartz.simpl.SimpleThreadPool’ – with 4 threads.
    Using job-store ‘org.quartz.simpl.RAMJobStore’ – which does not support persistence. and is not clustered.

    [INFO] [main] org.quartz.impl.StdSchedulerFactory – Quartz scheduler ‘Red5_Scheduler’ initialized from default resource file in Quartz package: ‘quartz.properties’
    [INFO] [main] org.quartz.impl.StdSchedulerFactory – Quartz scheduler version: 1.8.5
    [INFO] [main] org.quartz.core.QuartzScheduler – Scheduler Red5_Scheduler_$vps.healthbook.sg1346981043069 started.
    [INFO] [main] org.springframework.jmx.export.annotation.AnnotationMBeanExporter – Bean with name ’schedulingService’ has been autodetected for JMX exposure
    [INFO] [main] org.springframework.jmx.export.annotation.AnnotationMBeanExporter – Bean with name ‘clientBroadcastStream’ has been autodetected for JMX exposure
    [INFO] [main] org.springframework.jmx.export.annotation.AnnotationMBeanExporter – Located MBean ‘org.springframework.jmx.support.ConnectorServerFactoryBean#0′: registering with JMX server as MBean [org.red5.server:name=org.springframework.jmx.support.ConnectorServerFactoryBean#0,type=RMIConnectorServer]
    [INFO] [main] org.springframework.jmx.export.annotation.AnnotationMBeanExporter – Located MBean ’schedulingService’: registering with JMX server as MBean [org.red5.server:name=schedulingService,type=QuartzSchedulingService]
    [INFO] [main] org.red5.server.service.WarDeployer – War deployer service created
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFactory – Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2ba99347: defining beans [placeholderConfig,red5.server,rmiRegistry,mbeanServer,org.springframework.jmx.support.ConnectorServerFactoryBean#0,mbeanExporter,serializer,deserializer,minaEncoder,minaDecoder,statusObjectService,rtmpCodecFactory,rtmptCodecFactory,remotingCodecFactory,streamableFileFactory,filePersistenceThread,sharedObjectService,streamService,providerService,consumerService,schedulingService,warDeployService,remotingClient,object.cache,keyframe.cache,flv.impl,flvreader.impl,mp4reader.impl,mp3reader.impl,org.springframework.beans.factory.config.MethodInvokingFactoryBean#0,org.springframework.beans.factory.config.MethodInvokingFactoryBean#1,streamExecutor,fileConsumer,playlistSubscriberStream,clientBroadcastStream]; root of factory hierarchy
    [INFO] [main] org.springframework.jmx.export.annotation.AnnotationMBeanExporter – Unregistering JMX-exposed beans on shutdown
    [INFO] [main] org.quartz.core.QuartzScheduler – Scheduler Red5_Scheduler
    $vps.healthbook.sg1346981043069 shutting down.
    [INFO] [main] org.quartz.core.QuartzScheduler – Scheduler Red5_Scheduler
    $vps.healthbook.sg1346981043069 paused.
    [INFO] [main] org.quartz.core.QuartzScheduler – Scheduler Red5_Scheduler
    $_vps.healthbook.sg1346981043069 shutdown complete.
    [INFO] [main] org.springframework.jmx.support.ConnectorServerFactoryBean – Stopping JMX connector server: javax.management.remote.rmi.RMIConnectorServer@79b4748
    [INFO] [main] org.springframework.remoting.rmi.RmiRegistryFactoryBean – Unexporting RMI registry
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFactory – Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@44cbbe: defining beans [placeholderConfig,red5.common,red5.core,context.loader,pluginLauncher,tomcat.server]; root of factory hierarchy
    Exception org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘red5.common’ defined in class path resource [red5.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.FileSystemXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.beans.factory.config.MethodInvokingFactoryBean#0′ defined in class path resource [red5-common.xml]: Invocation of init method failed; nested exception is java.lang.ClassNotFoundException:
    org.red5.io.flv.impl.FLVReader

    Pls advice
    Gopi



  • the Red5 discussion group may be able to help


Log in to reply