Red5 is an open-source media server for live streaming solutions that are written in Java. It provides a powerful platform that supports streaming Video (FLV, F4V, MP4, 3GP), Audio (MP3, F4A, M4A, AAC), and RTMP/RTMPT protocols for maximum flexibility. This article will guide you on how to install Red5 Server on CentOS/RHEL 9/8.

Advertisement

Prerequisites

  • A CentOS/RHEL 8 or 9 instance with root privileges.
  • Sufficient storage space for the server software and media files.
  • An installed Java Development Kit (JDK), as Red5 is a Java-based application.

Step 1: Update the System

First, you should start by updating your system to the latest packages. Open the terminal and execute the following command:

sudo yum update -y 

Step 2: Install the Java Development Kit (JDK)

Since Red5 is a Java application, you need to install the Java Development Kit. If you don’t have JDK installed in your system, use the following command:

sudo yum install java-1.8.0-openjdk-devel -y 

To verify the Java installation, run:

java -version 

This will output the version of Java that is currently active on your system.

Step 3: Install Ant

Apache Ant is a Java library and command-line tool that helps in driving processes described in build files as targets and extension points dependent upon each other. Use the following command to install Ant:

sudo yum install ant -y 

Verify the installation with the command:

ant -version 

Step 4: Download and Install Red5 Server

Now we can move on to downloading and installing the Red5 server. Navigate to the /usr/local directory:

cd /usr/local/ 

Download the latest version of the Red5 server using wget:

sudo wget https://github.com/Red5/red5-server/releases/download/v1.3.19/red5-server-1.3.19-server.tar.gz 

Extract the downloaded tar file:

sudo tar xvfz red5-server-1.3.19-server.tar.gz 

Rename the extracted directory to red5:

sudo mv red5-server red5 

Step 5: Configure Red5 Server

Navigate to the red5 directory:

cd red5 

Make the Red5.sh file executable:

sudo chmod +x red5.sh 

Step 6: Run Red5 Server

Now you can start the Red5 server with the following command:

./red5.sh 

This will start the Red5 server, and it should be accessible on the default port 5080.

Step 7: Enable Red5 Server at Boot

In order to ensure that Red5 server starts automatically at boot time, you need to create a systemd service file. Open a new service file in /etc/systemd/system/:

sudo nano /etc/systemd/system/red5.service 

Add the following content:

Save and close the file. Now reload the systemd manager configuration:

sudo systemctl daemon-reload 

Enable the Red5 service to start on boot:

sudo systemctl enable red5 

You can start, stop, and check the status of the Red5 server with the following commands respectively:

sudo systemctl start red5 
sudo systemctl stop red5 
sudo systemctl status red5 

Conclusion

Now, you have successfully installed the Red5 server on your CentOS/RHEL 8 or 9. You can start creating applications for streaming audio and video over the internet. Make sure to secure your server and customize the Red5 server settings as per your specific needs.

Share.

16 Comments

  1. I have successfully install java and red5 now I can red5 demo page I had install but when click to connect it not connecting with red5 server when I check in chrome browser console I see this error ” POST http://localhost/fcs/ident2 net::ERR_CONNECTION_REFUSED” let me know what I did wrong I have java 1.8.0_111 and red5 1.0.8m13 version I am running on centos vps server purchased from godaddy. let me know if you can help me

  2. Hello Rahul,
    Thank you for the guide it helped me a lot, I have installed this in CentOS 6 and setup went well,
    but, in Install Table i haven’t found any link and it is blank, can you please guide ?

  3. please help me

    stuck setup prgogress in:

    [WARN] [Launcher:] org.red5.server.scope.Scope – Invalid scope rejected: Scope [name=null, path=/default, type=APPLICATION, autoStart=true, creationTime=1449488305868, depth=1, enabled=true, running=false]
    [WARN] [Launcher:] org.red5.server.scope.Scope – Scope not added to parent
    [INFO] [Launcher:] org.red5.server.scope.WebScope – Webscope already registered
    [INFO] [Launcher:/installer] org.red5.server.scope.WebScope – Webscope already registered
    [INFO] [Launcher:/live] org.red5.server.scope.WebScope – Webscope already registered
    [INFO] [Launcher:/vod] org.red5.server.scope.WebScope – Webscope already registered
    [INFO] [Launcher:/installer] org.red5.server.service.Installer – Installer service created
    [INFO] [Launcher:/chat] org.red5.server.scope.WebScope – Webscope already registered

  4. Can you tell me why this happeded when tring to install?
    $ ant prepare
    Buildfile: build.xml does not exist!
    Build failed
    instead of Bulid successfull.

    Thank you

  5. Rahul
    i have latest java version

    [root@localhost ~]# java -version
    java version “1.7.0_45”
    Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
    Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

  6. PLEASE HELLP ME……….

    WHAT IS THIS

    [root@localhost red5]# ./red5.sh
    Running on Linux
    Starting Red5
    Red5 root: /usr/local/red5
    Configuation root: /usr/local/red5/conf
    Selected libraries: (10 items)
    file:/usr/local/red5/red5.jar
    file:/usr/local/red5/conf/
    file:/usr/local/red5/plugins/
    file:/usr/local/red5/plugins/tomcatplugin-1.3.jar
    file:/usr/local/red5/plugins/tomcat-juli-slf4j-1.5.0.jar
    file:/usr/local/red5/plugins/jasper-6.0.36.jar
    file:/usr/local/red5/plugins/catalina-6.0.36.jar
    file:/usr/local/red5/plugins/tomcat-coyote-6.0.36.jar
    file:/usr/local/red5/plugins/jasper-el-6.0.36.jar
    file:/usr/local/red5/plugins/ecj-3.7.2.jar

    Root: /usr/local/red5
    Deploy type: bootstrap
    Logback selector: org.red5.logging.LoggingContextSelector
    Exception in thread “main” java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.red5.server.Bootstrap.bootStrap(Bootstrap.java:118)
    at org.red5.server.Bootstrap.main(Bootstrap.java:49)
    Caused by: java.lang.NoClassDefFoundError: org/slf4j/bridge/SLF4JBridgeHandler
    at org.red5.server.Launcher.launch(Launcher.java:51)
    … 6 more
    Caused by: java.lang.ClassNotFoundException: org.slf4j.bridge.SLF4JBridgeHandler
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    … 7 more

    • Hi,
      Please confirm what version of JAVA are you using ? Also we have added one more step ( Step #4) in above tutorial, Please check that and complete it.

  7. Hello, i was Installing Red5 the way you wrote down up above.
    I iwould like to add a few things for ppl may having the same Problems like me.

    1) in this Java Installtion Link :
    http://tecadmin.net/steps-to-install-java-on-centos-5-6-or-rhel-5-6/
    The Url contains an Authorisation code like allmost the most Links for JDK so its Neccessary to download the desired version from the oracle archive (Oracla account needed)
    2) i recognized you forgett to explain (for us windows gui junkies) that you may use annoter user than root to execute and may only be able to change and install something only as root, so the sudo command is left here.
    3) After Installation and Build of red 5 a common error would be thisone when startup

    “Failed to get local hostname java.net.UnknownHostException”

    This belongs to the hostfile—
    there must be added at least one line:

    127.0.0.1 YOURPCSNAME
    infront of the 127.0.0.1…. line that allready exists.

    and btw for us windows ppl host file is editable in vim with

    vim /etc/hosts

    to save ESC (2times) than hit :wq and ENTER

    Man Your tutorial here is great but for us windows guys linux terminal sometimes iss the hell itselfs

    greetz

  8. You have a mistake in ‘echo ‘export JAVA_HOME=/opt/jdk1.7.0_17′ >> /etc/bashrc’ it must be ‘echo ‘export JAVA_HOME=/opt/jdk1.7.0_25′ >> /etc/bashrc’
    🙂

  9. WeSaveYourCopyRights on

    Ηello therе! Thiѕ article сould nοt be
    written anу better! Reading thгough
    this post remindѕ me of my рrevious roommаtе!

    He alwaуs kept pгeaсhing аbout this.
    ӏ will forward thіѕ articlе to him.

    Fаiгly certain hе’s going to have a very good read. Thank you for sharing!

  10. Thanks in support of sharing such a nice thinking, article is fastidious, thats why
    i have read it completely

Exit mobile version