How To Install RED5 Server on Centos 5.3

In this how to i will describe how to install RED5 server on Centos 5.3. This how to can be used to install RED5 server on Centos 4 and Fedora 8 – 11 as well. RED5 is open source flash server written in java supports streaming audio/video, recording client streams, shared objects, live stream publishing etc.

1) Download and Install Java

RED5 server depends on Java. CentOS 5.3 comes with OpenJDK 1.6 and install it using yum.

yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

2) Download and Install Ant & Ivy (Apache Project)

Ant will need to compile RED5 server code. Ant comes in binary form, so just download and install it in /usr/local directory.

cd /usr/src
wget http://mirrors.isu.net.sa/pub/apache//ant/binaries/apache-ant-1.8.2-bin.tar.bz2
tar jxvf apache-ant-1.8.2-bin.tar.bz2
mv apache-ant-1.8.2 /usr/local/ant

cd /usr/src
svn co https://svn.apache.org/repos/asf/ant/ivy/core/trunk ivy
cd ivy
ant jar
cp build/artifact/jars/ivy.jar /usr/local/ant/lib/

3) Export Variables for Ant and Java

export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:/usr/local/ant/bin

Also export these variables in /etc/bashrc to become available for every user login or for any terminal opens.

echo ‘export ANT_HOME=/usr/local/ant’ >> /etc/bashrc
echo ‘export JAVA_HOME=/usr/lib/jvm/java’ >> /etc/bashrc
echo ‘export PATH=$PATH:/usr/local/ant/bin’ >> /etc/bashrc

4) Download and Install RED5 Server

Here the latest version available for RED5 is 0.7 on site but download from google code using svn as the tarball of 0.7 on site is missing some of the files.

cd /usr/src
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
mv red5 /usr/local/
cd /usr/local/red5
ant prepare
ant dist

you will see a ton of lines, but you should get at last

BUILD SUCCESSFUL

that’s mean its install and now copy the conf directory from dist/ and test the red5 installation.

cp -r dist/conf .
./red5.sh

If it shows Installer service created in the last then everything is fine here, press ctrl+c and move to next step to create init script.

5) Init Script

Now we will create init script for red5 to start, stop and restart easily.

vi /etc/init.d/red5

download https://www.sohailriaz.com/downloads/red5.txt and copy / paste code in it. The init script code also be viewed below.

#!/bin/sh
# For RedHat and cousins:
# chkconfig: 2345 85 85
# description: Red5 flash streaming server
# processname: red5

PROG=red5
RED5_HOME=/usr/local/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid

# Source function library
. /etc/rc.d/init.d/functions

[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5

RETVAL=0

case “$1″ in
start)
echo -n $”Starting $PROG: ”
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG

fi
[ $RETVAL -eq 0 ] && success $”$PROG startup” || failure $”$PROG startup”
echo
;;
stop)
echo -n $”Shutting down $PROG: ”
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
;;
restart)
$0 stop
$0 start
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
*)
echo $”Usage: $0 {start|stop|restart|status}”
RETVAL=1
esac

exit $RETVAL

Enable executable permission

chmod +x /etc/init.d/red5

Now start the service

/etc/init.d/red5 start

check status

/etc/init.d/red5 status
red5 (pid  XXXXX) is running…

again you can do stop, restart.

6) Test

Now test the RED5 installation by opening following URL in browser

http://yourip:5080/

you will see red5 page like this

red5_11

and demos can be find here.

http://yourip:5080/demos/

red5_21

You can use simple port tester tool that determines which ports the Flash Player is able to connect through to the Red5 server. Put your server address or IP in HOST when using port tester. You should get SUCCESS on RTMP or port 1935. If not please check your firewall.

http://yourip:5080/demos/port_tester.html

red5_3

7) ISSUE

When you run ./red5.sh, it will show you Installer service created. Thats mean everything runs fine and red5 server is up. But if you went to port_tester.swf using demos above or your application shows connections FAILS, this is an issue of RTMPT and RTMPTS. You can see it by running

/usr/local/red5/red5.sh

output trancated

[INFO] [main] org.red5.server.tomcat.TomcatLoader – RTMPT server bean was not found
[INFO] [main] org.red5.server.tomcat.TomcatLoader – RTMPS server bean was not found

output truncated

If you see this you have to uncomment the RTMPT and RTMPTS TomcatLoader in/usr/local/red5/conf/red5-core.xml

vi /usr/local/red5/conf/red5-core.xml

Search for a lines

<!– RTMPT –>
<!–
<bean id=”rtmpt.server” class=”org.red5.server.net.rtmpt.TomcatRTMPTLoader” init-method=”init” lazy-init=”true”>

Remove the <!– from start of <bean and –> from end of </bean>

Same goes for RTMPS

<!– RTMPS –>
<!–
<bean id=”rtmps.server” class=”org.red5.server.net.rtmps.TomcatRTMPSLoader” init-method=”init” lazy-init=”true”>

Remove the <!– from start of <bean and –> from end of </bean>

Restart the red5 services and connection fails problem will be fixed.

If you any question please use comments.

Related Posts

482 thoughts on “How To Install RED5 Server on Centos 5.3

  1. @Scott: get me output of following commands
    iptables -L -n | grep 1935
    netstat -anpt | grep 1935
    ——————
    Regards,

  2. # iptables -L -n | grep 1935
    ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:1935

    # netstat -anpt | grep 1935
    tcp 0 0 :::1935 :::* LISTEN 28941/java

  3. hello
    Are these messages helpful?

    0000 00 17 31 af be b2 00 0c 29 1a 4c 9b 08 00 45 00 ..1…..).L…E.
    0010 00 b6 2f 8d 40 00 40 06 de 6c 83 01 13 3c 83 01 ../.@.@..l…<..
    0020 13 0a 07 8f 0d a0 77 fe 7f 1d 65 ae a4 a7 50 18 ……w…e…P.
    0030 39 08 c2 53 00 00 03 00 00 00 00 00 81 14 00 00 9..S…………
    0040 00 00 02 00 07 5f 72 65 73 75 6c 74 00 3f f0 00 ….._result.?..
    0050 00 00 00 00 00 05 03 00 05 6c 65 76 65 6c 02 00 ………level..
    0060 05 65 72 72 6f 72 00 04 63 6f 64 65 02 00 1e 4e .error..code…N
    0070 65 74 43 6f 6e 6e 65 63 74 69 6f 6e 2e 43 6f 6e etConnection.Con
    0080 6e 65 63 74 2e 52 65 6a 65 63 74 65 64 00 0b 64 nect.Rejected..d
    0090 65 73 63 72 69 70 74 69 6f 6e 02 00 23 4e 6f 20 escription..#No
    00a0 73 63 6f 70 65 20 22 6f 66 6c 61 44 65 6d 6f 22 scope "oflaDemo"
    00b0 20 6f 6e 20 74 68 69 73 20 73 65 72 76 65 72 2e on this server.
    00c0 00 00 c3 09 ….

    i also failed to run port tester and i captured above log with tethereal.
    it seems demo files are not setup correctly on my environment.

  4. @Sohail: Address is http://pluno.com:5080 and I’ve restarted the red5 service.

    It’s also worth mentioning that from a remote location, nmap shows port 1935 as open.

    Thanks again for your help, looking forward to hearing back.

  5. Hi, I tried installing Red5 0.9 on CentOS. Everything was successfully installed but when I duplicate the oflaDemo and rename it to ‘StreamTest’ name and changed the ‘webAppRootKey’ value to ‘StreamTest’ in the web.xml file in WEB-INF folder, it don’t stream. I get the error

    (306) Connections: true | true
    (3085) connected?: true
    (3205) NetConnection.onStatus:
    description = No scope ‘streamTest’ on this server.
    code = NetConnection.Connect.Rejected
    level = error
    How can I make this work. I have done the same for previous version (0.7) and it worked. Any idea or suggestion?

  6. @Alfie: Is it same name in web.xml and scope name, because i see difference in case.
    StreamTest in web.xml file and no scope ‘streamTest’ on this server.
    —————
    Regards,

  7. @Sohail: aha, so in theory I just need to add an iptables rule just like the rule I have already:

    -A RH-Firewall-1-INPUT -p tcp -m tcp –dport 1935 -j ACCEPT

    …except modified to allow all traffic on port 1935 from localhost. Does that sound right?

    I’m a relative novice with iptables, can you offer a suggestion for what the needed iptable rule might look like?

    Thanks again!

  8. Hi Sohail. I cannot find what my problem is. I installed and all worked fine. Made the tests and at first the ports in the ofla test showed ok. But now:
    – all the ports on the test fail

    – when I go to the installer page it opens but get: Net status: NetConnection.Connect.Failed
    Net status: NetConnection.Connect.Closed
    Trying to connect to war location

    – I run /etc/init.d/red5 status
    and get
    red5 (pid 4655) is running…

    – I run cd /usr/local/red5 and ./red5.sh
    and get a huge report that ends with
    09:10:35,126 |-INFO in ch.qos.logback.classic.joran.action.LevelAction – ch.qos level set to WARN

    Setting default logging context: default
    [INFO] [main] org.red5.server.Launcher – Red5 Server 1.0.0 RC1 $Rev: 4091 $ (htt p://code.google.com/p/red5/)
    Red5 Server 1.0.0 RC1 $Rev: 4091 $ (http://code.google.com/p/red5/)
    [INFO] [main] org.springframework.context.support.FileSystemXmlApplicationContex t – Refreshing org.springframework.context.support.FileSystemXmlApplicationConte xt@fcfa52: startup date [Wed May 05 09:10:35 CEST 2010]; root of context hierarc hy
    [INFO] [main] org.springframework.beans.factory.config.PropertyPlaceholderConfig urer – Loading properties file from class path resource [red5.properties]
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFacto ry – Pre-instantiating singletons in org.springframework.beans.factory.support.D efaultListableBeanFactory@79ee2c2c: defining beans [placeholderConfig,red5.commo n,red5.core,context.loader,pluginLauncher,tomcat.server]; root of factory hierar chy
    [INFO] [main] org.springframework.context.support.FileSystemXmlApplicationContex t – Refreshing org.springframework.context.support.FileSystemXmlApplicationConte xt@7ca522a6: startup date [Wed May 05 09:10:37 CEST 2010]; root of context hiera rchy
    [INFO] [main] org.springframework.beans.factory.config.PropertyPlaceholderConfig urer – Loading properties file from class path resource [red5.properties]
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFacto ry – Pre-instantiating singletons in org.springframework.beans.factory.support.D efaultListableBeanFactory@630f41e9: defining beans [placeholderConfig,red5.serve r,jmxFactory,jmxAgent,serializer,deserializer,statusObjectService,rtmpCodecFacto ry,rtmptCodecFactory,remotingCodecFactory,streamableFileFactory,filePersistenceT hread,sharedObjectService,streamService,providerService,consumerService,bandwidt hFilter,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.facto ry.config.MethodInvokingFactoryBean#1,streamExecutor,playlistSubscriberStream,cl ientBroadcastStream]; root of factory hierarchy
    [INFO] [main] org.red5.server.service.WarDeployer – War deployer service created
    [INFO] [main] org.springframework.context.support.FileSystemXmlApplicationContex t – Refreshing org.springframework.context.support.FileSystemXmlApplicationConte xt@10f268de: startup date [Wed May 05 09:10:43 CEST 2010]; parent: ApplicationCo ntext ‘red5.common’
    [INFO] [main] org.springframework.beans.factory.config.PropertyPlaceholderConfig urer – Loading properties file from class path resource [red5.properties]
    [WARN] [main] org.springframework.beans.factory.config.CustomEditorConfigurer – Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [j ava.net.SocketAddress; offending editor instance: org.apache.mina.integration.be ans.InetSocketAddressEditor@2a8a1977
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFacto ry – Pre-instantiating singletons in org.springframework.beans.factory.support.D efaultListableBeanFactory@62ac06d4: defining beans [customEditorConfigurer,place holderConfig,rtmpMinaConnManager,rtmpHandler,rtmpMinaIoHandler,rtmpTransport,rtm pMinaConnection,rtmptConnManager,rtmptHandler,rtmptServlet,rtmptConnection]; par ent: org.springframework.beans.factory.support.DefaultListableBeanFactory@630f41 e9
    [INFO] [main] org.red5.server.net.rtmp.RTMPMinaTransport – RTMP Mina Transport b ound to /0.0.0.0:1935
    [INFO] [main] org.red5.server.net.rtmp.RTMPMinaTransport – RTMP Mina Transport S ettings
    [INFO] [main] org.red5.server.net.rtmp.RTMPMinaTransport – Connection Threads: 4
    [INFO] [main] org.red5.server.net.rtmp.RTMPMinaTransport – I/O Threads: 16
    [INFO] [main] org.red5.server.net.rtmp.RTMPMinaTransport – TCP No Delay: true
    [INFO] [main] org.red5.server.net.rtmp.RTMPMinaTransport – Receive Buffer Size: 65536
    [INFO] [main] org.red5.server.net.rtmp.RTMPMinaTransport – Send Buffer Size: 271 360
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFacto ry – Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@62ac06d4: defining beans [customEditorConfigurer,placeholderC onfig,rtmpMinaConnManager,rtmpHandler,rtmpMinaIoHandler,rtmpTransport,rtmpMinaCo nnection,rtmptConnManager,rtmptHandler,rtmptServlet,rtmptConnection]; parent: or g.springframework.beans.factory.support.DefaultListableBeanFactory@630f41e9
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFacto ry – Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@79ee2c2c: defining beans [placeholderConfig,red5.common,red5. core,context.loader,pluginLauncher,tomcat.server]; root of factory hierarchy
    [INFO] [main] org.springframework.context.support.FileSystemXmlApplicationContex t – Closing ApplicationContext ‘red5.common’: startup date [Wed May 05 09:10:37 CEST 2010]; root of context hierarchy
    [INFO] [main] org.springframework.beans.factory.support.DefaultListableBeanFacto ry – Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@630f41e9: defining beans [placeholderConfig,red5.server,jmxFa ctory,jmxAgent,serializer,deserializer,statusObjectService,rtmpCodecFactory,rtmp tCodecFactory,remotingCodecFactory,streamableFileFactory,filePersistenceThread,s haredObjectService,streamService,providerService,consumerService,bandwidthFilter ,schedulingService,warDeployService,remotingClient,object.cache,keyframe.cache,f lv.impl,flvreader.impl,mp4reader.impl,mp3reader.impl,org.springframework.beans.f actory.config.MethodInvokingFactoryBean#0,org.springframework.beans.factory.conf ig.MethodInvokingFactoryBean#1,streamExecutor,playlistSubscriberStream,clientBro adcastStream]; root of factory hierarchy
    org.springframework.beans.factory.BeanCreationException: Error creating bean wit h name ‘red5.core’ defined in class path resource [red5.xml]: Instantiation of b ean failed; nested exception is org.springframework.beans.BeanInstantiationExcep tion: Could not instantiate bean class [org.springframework.context.support.File SystemXmlApplicationContext]: Constructor threw exception; nested exception is o rg.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘rtmpTransport’ defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address alre ady in use
    at org.springframework.beans.factory.support.ConstructorResolver.autowir eConstructor(ConstructorResolver.java:285)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:993)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:897)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb ject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe an(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory. preInstantiateSingletons(DefaultListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplicationContext.finish BeanFactoryInitialization(AbstractApplicationContext.java:872)
    at org.springframework.context.support.AbstractApplicationContext.refres h(AbstractApplicationContext.java:423)
    at org.red5.server.Launcher.launch(Launcher.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.red5.server.Bootstrap.bootStrap(Bootstrap.java:135)
    at org.red5.server.Bootstrap.main(Bootstrap.java:50)
    Caused by: org.springframework.beans.BeanInstantiationException: Could not insta ntiate bean class [org.springframework.context.support.FileSystemXmlApplicationC ontext]: Constructor threw exception; nested exception is org.springframework.be ans.factory.BeanCreationException: Error creating bean with name ‘rtmpTransport’ defined in class path resource [red5-core.xml]: Invocation of init method faile d; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:1 41)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy .instantiate(SimpleInstantiationStrategy.java:107)
    at org.springframework.beans.factory.support.ConstructorResolver.autowir eConstructor(ConstructorResolver.java:277)
    … 18 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creati ng bean with name ‘rtmpTransport’ defined in class path resource [red5-core.xml] : Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb ject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe an(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory. preInstantiateSingletons(DefaultListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplicationContext.finish BeanFactoryInitialization(AbstractApplicationContext.java:872)
    at org.springframework.context.support.AbstractApplicationContext.refres h(AbstractApplicationContext.java:423)
    at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:140)
    at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:106)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct orAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC onstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:1 26)
    … 20 more
    Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind(Native Method)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java: 137)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:77)
    at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocket Acceptor.java:251)
    at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocket Acceptor.java:48)
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor.registerHandle s(AbstractPollingIoAcceptor.java:521)
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor.access$200(Abs tractPollingIoAcceptor.java:65)
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(A bstractPollingIoAcceptor.java:405)
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnabl e.java:64)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:603)
    at java.lang.Thread.run(Thread.java:636)
    Bootstrap complete

    and when I run
    iptables -L -n | grep 1935
    netstat -anpt | grep 1935
    I get
    tcp 0 0 :::1935 :::* LISTEN 4655/java
    tcp 0 0 ::ffff:79.143.179.78:1935 ::ffff:87.218.210.121:49737 ESTABLISHED 4655/java
    I would really appreciate your help on this one. Sorry for the long text. Thanks a lot.

  9. @Darwin: Thanks for the post, but this article/thread is related to installing Red5 on CentOS 5.3 whereas the tutorial you’ve mentioned is for installing on Windows so that link isn’t much help.

  10. @Sohail: Here’s some more interesting info:

    When I run the port_tester applet using ‘localhost’ it fails across the board. When I run the port_tester applet using ‘pluno.com’ it succeeds for most ports and then the port tester hangs on testing the last port.

    When I run nmap from localhost or from a remote host, it shows port 1935 as open.

    When I telnet into port 1935 from localhost or from a remote host, it establishes a connection.

    So it doesn’t look like there’s anything wrong with the iptables – the firewall allows connection to port 1935 from all locations.

    Why, then, would the applet fail when using ‘localhost’? This one is puzzling…

  11. @Scott: For localhost it will always failed :). because when you run any flash application like porttester, its downloaded and runs on your system browser. Thats means now localhost for porttester is your machine and you machine not running any of the flash server.
    Therefore always used your server IP address or name to check the connectivity and thats what you have to use in your flash application on server. Never use localhost for any flash application.
    I hope it will clear your confusion and it prove you have good running RED5 server.
    ——————
    Regards,

  12. @ Sohail: Aha! Many thanks! It’s funny – I’ve been setting this up for a contracted developer and I’ve been telling them all along that everything I can tell from a sys admin perspective shows that Red 5 is working.

    Many thanks for your help with this issue, and thanks again for writing this tutorial – looks like it did work for me after all!

  13. Hello,
    I hav e followed all your instructions step by step and all path vars are setted properly but still getting an error. Please help.

    Thanks in advance.

    localhost red5]# ant prepare
    Buildfotile: build.xml

    BUILD FAILED
    /usr/local/red5/build.xml:5: Class org.apache.tools.ant.taskdefs.ConditionTask doesn’t support the nested “antversion” element.

  14. Ok. Sorted …
    I had to delete one config file and now it works.
    But I face a new issue.
    When I run the port_tester applet using SERVER IP it fails on all ports(80,443,1935).

    When I run nmap from localhost or from a remote host, it shows port 1935 as open.

    The iptables – the firewall is stoped.

    PLEASE HELP.

  15. @ seemore: See section 7 of this guide, titled “Issue”. It explains how to enable the beans for RTMPT and RTMPS, which should result in your port test succeeding.

    Also worth noting that for the port tester you’ll need to use your domain name or IP address instead of 127.0.0.1 or localhost (see Sohail’s earlier responses to my issues – seems like the same problem you’re having)

    Thanks again Sohail for helping us all with this, you’re an asset to the community!

  16. Sohail:

    Thank you for this awesome article.

    Regarding the init script, can you give an example of a script that can be run by a user (eg. red5user) not by root?

    I’m new to linux, and I’ve tried your script logging in as red5user, but I got permission denied when writting the pid files I guess.

    Thank you.

  17. Scott , Sohail Riaz ,
    Thank you for you response. I still cannot get it run …:(
    The server is CentOS 5.4 and I the service iptables is not running.
    Red5 is running but when I try run the installer I’m getting the follow error :
    Trying to connect to war location
    Net status: NetConnection.Connect.Failed
    Net status: NetConnection.Connect.Closed
    Trying to connect to war location
    Net status: NetConnection.Connect.Failed
    Net status: NetConnection.Connect.Closed
    Trying to connect to war location
    Net status: NetConnection.Connect.Failed
    Net status: NetConnection.Connect.Closed
    Trying to connect to war location
    Net status: NetConnection.Connect.Failed
    Net status: NetConnection.Connect.Closed

    ……

    The server IP is 78.46.84.107 and the ports of Red5 are default. 5080, 1935 …

    Please help.
    Thanks a lot in advance.

  18. It seems to be some trick in the config files but I don’t have any clue what could be 🙁

  19. Ok … Fixed but …
    New issue. As soon as I copy my Red5 app to /webapps directory and the issue “Net status: NetConnection.Connect.Failed” is back. Sooo strange because this app was working without any issue long time on our other server.

    Any idea ?

  20. I fought a lot with the red5. It seems that the problem most of the people have is due to the fact that latest version of red5 is buggy anf needs more work. As far as I found afther a lot of google search is that the latest stable version is 0.6.3. My 2 cents.

  21. Well, after more then 10 hours playing with settings, folders and permissions it is working properly now.

    Thanks for the help guys.

  22. I have installed and it went thru all installation successfully, But when i try to connect it failed.. I have folloed all instructions and there is no firewall as well.

    Please advise what to do .

    Thanks
    Nilesh

  23. @Sohial,

    Hi, Thank you for this information. I followed your instructions and have red5 running and working as you described.
    I have 1 problem that I cannot find a solution to.
    After the fresh install of red5, the addition of your script, I run /etc/init.d/red5 start and get OK. I run the port tester and get success on RTMP and 1935 only. Just as in your picture.
    However, if I run /etc/init.d/red5 stop then add to webapp then run /etc/init.d/red5 start I get OK but the port test then fails.
    I cannot get into the app installation section either. It just says:

    Trying to connect to war location
    Net status: NetConnection.Connect.Failed
    Net status: NetConnection.Connect.Closed

    Would you be able to tell me what is going wrong here please?

    Thanks

    Dean

  24. seemore:

    Mate can you please tell us what you did to get it going. I am having exactly the same problem as you.

    Works perfect after 1st install but then fails from then on after.

    Your info would be much appreciated.

    Regards,

    Dean

  25. Dean,
    It is a long story but you can try :

    # ant –noconfig -version
    # ant -version

    If this doesn’t help then I’ll tell you what else you can do, but I think this will be enough.

  26. Hi seemore,

    Thank you for your response. I tried what you said but it still does not work.
    When I type the command you gave me, it says,
    Apache Ant version 1.8.1 compiled on April 30 2010

    I have tried removing red5 and reinstalling it, I have tried turning my firewall in WHM off even though I have the correct ports open and still I cannot get it to connect.

    I have even rebooted my dedicated server to see if there was not a 2nd instance of red5 running. Still no luck. Grhhhhhhhhhh…

  27. Ok.
    Shut iptables down just for the test
    # service iptables stop

    Export Variables for Ant and Java again

    Then clean your ../red5/webapps dir.
    Reinstall oflademo and try again

    Hope this will help. If no, we move ahead.

  28. @seemore

    After messing around for hours and hours, I finally decided to remove ant and red5 completely.
    rm -rf red5
    rm -rf ant

    I reinstalled ant and red5 however I installed an older version of red5 0.8.0 and used another script I found to start and stop red5.
    Success!
    My only problem now is that as soon as I put 1 particular app in the webapps folder and restart red5, it gets stuck at Bootstrap message and goes not further.
    If I then remove that webapp all works fine again.

    Im new to these webapps and not really sure whats going on here but I keep plotting along with it and try.
    If you have any suggestions, that would be great.

    Regards,

    Dean

  29. I have come to the conclusion that this webapp simply must not be compatible with versions above 0.7.0.
    I cannot install 0.7.0 as it fails on dependencies.
    I tried to install apache ant 1.7.1 and then 0.7.0 but again it fails dependencies.
    Im thinking it must have something to do with tomcat. I really do not know. I am still learning linux and do not have enough knowledge to know how to deal with dependencies.
    I think ill just pay the extra for the company who makes the software to install it for me if I cant get it.

  30. If the server is running normal after fresh install and you only have a problem with the apps you are tring to install in /webapps dir, then the solution is only one. Ask the developer of those apps are they compatible with your version of Red5. No one else can help in this situation. Only the developer of your apps.

  31. Yeah I finally figured that must have been the problem. What I was doing earlier was installing red5 and uploading the webapp straight away.
    Then I was restarting red5, and being new to all this, I didnt realise that it was not fully starting and hanging at the Boostrap.
    So this last time, I reinstalled ant and red5 and started it. All was good. Then I upped the app and re5 failed. so removed the app and it sterted perfect again.

    I did not know that an incompatible app would kill red5.

    That learned me!

    Thanks for your help and suggestions Seemore. I would have given up earier otherwise!

  32. Problem with .meta files.
    It does not moving *.meta files to /public_html/recorder/
    It is moving *.flv files to /public_html/recorder/

    Any ideay?

  33. I have install red5 it work properly.I have put sip folder in webapps.but it show error:2010-06-14 17:40:36,422 [NioProcessor-1] ERROR org.red5.server.webapp.sip.RTMPUser – RTMPUser stopStream exception java.lang.NullPointerException
    please help me

    please help me.

  34. Hi, I want to chat conference by using red5 and flex. it is working very fine locally but when i upload it on the server and access my application it does not working it is giving me the error NetConnection.Connect.Failed
    Please help me to solve this issue

  35. Hi,

    I have installed REd 5 on my server successfully. But when I am running Home page http://81.26.217.184:5080/ , The test RED 5 video is not playing right. It gets hang in middle.

    Also I have tested it with progressive video play and RED 5 streaming video play. But Streaming video is running slow.

    Please help me. Any clue why it is happening.

    Great Thanks in advance.

    Regards,
    Kumar Sekhar

  36. Thanks for this good how to.
    I also need version red5 0.7.0 for a appicatios thats not compatible with newer versions.

    I have found the 0.7.0 source here http://red5.googlecode.com/svn/java/server/tags/0_7_0/

    [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
    [ivy:resolve] :: UNRESOLVED DEPENDENCIES ::
    [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
    [ivy:resolve] :: jmx#jmxremote;1.0.1: not found
    [ivy:resolve] :: jmx#jmxtools;1.2.1: not found
    [ivy:resolve] :: jmx#rmissl;1.0.1: not found
    [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::

    Ive found hole google for this jar files but still no result.
    Can someone that has 0.7.0 running fine maybe upload this files? I be verry happy with that.

    Tnx a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *