Bitcoin Exchange Script

- Advertisement -

How to install Red5 Media Server on CentOS 7

Before installing any packages on the CentOS server instance, let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Install Java

First, let’s download the latest Java SE Development Kit 8 release from its official download page.

cd /opt/
wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" ""
tar xzf jdk-8u161-linux-x64.tar.gz

Install Java using alternatives.

alternatives --install /usr/bin/java java /opt/jdk1.8.0_161/bin/java 2
alternatives --config java

Setup javac and jar commands path using alternatives.

alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_161/bin/jar 2
alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_161/bin/javac 2
alternatives --set jar /opt/jdk1.8.0_161/bin/jar
alternatives --set javac /opt/jdk1.8.0_161/bin/javac

Setup global environment variables.

Setup JAVA_HOME variable:

export JAVA_HOME=/opt/jdk1.8.0_161

Setup JRE_HOME variable:

export JRE_HOME=/opt/jdk1.8.0_161/jre

Setup PATH variable:

export PATH=$PATH:/opt/jdk1.8.0_161/bin:/opt/jdk1.8.0_161/jre/bin

Install Red5

Obtain the latest version of the Red5 server.

cd ~

Extract the tarball.

tar xvzf red5-server-1.0.9-RELEASE.tar.gz

Rename the extracted folder red5.

 mv red5-server red5
 cd red5

Start the Red5 server in the background.

sh &

Now you can access the Red5 media server by using your IP address followed by port :5080. You will see the Red5 welcome page.

Configure autostart

If you want the Red5 media server to start automatically during boot, create a file named red5 in /etc/init.d.

sudo nano /etc/init.d/red5

Add the following lines to the file.


# Provides:             red5
# Required-Start:       $remote_fs $syslog
# Required-Stop:        $remote_fs $syslog
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    Red5 server

start() {
  cd /opt/red5 && nohup ./ > /dev/null 2>&1 &
  echo 'Service started' >&2

stop() {
 cd /opt/red5 && ./ > /dev/null 2>&1 &
 echo 'Service stopped' >&2

case "$1" in
    echo "Usage: $0 {start|stop|restart}"

Save CTRL + O and close the file CTRL + X.

Make the file executable.

sudo chmod ugo+x /etc/init.d/red5

Install the sysv-rc-conf package.

sudo apt-get install sysv-rc-conf

Turn Red5 autostart on.

sudo sysv-rc-conf red5 on

At this point you can start, stop and restart the Red5 server with the service commands.

sudo service red5 start
sudo service red5 stop
sudo service red5 restart

Finish installation

You can finish installing Red5 through your web browser. Open your web browser and navigate to HTTP://[your-ip-adresse:5080] with the actual IP address pointed towards your Vultr VPS. For example, you can install some of the demo applications by going to HTTP://your-ip-address:5080/installer/.

Your Red5 media server installation is now complete.

Get real time updates directly on you device, subscribe now.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy