Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

WCS server can be deployed in Amazon Elastic Compute Cloud (EC2) by two the following ways:

  1. Setting up Linux virtual machine and installing WCS from the scratch
  2. WCS automatic deployment from Amazon AWS Marketplace

Table of Contents

Setting up Linux virtual machine and installing WCS from the scratch

This way is useful if you need fine OS tuning, additional modules installation and so on. Launch a Linux virtual machine by this AWS manual, set it up on your need, then install WCS by quick or detailed installation manual.

WCS automatic deployment from Amazon AWS Marketplace

1. Open Web Call Server page on Amazon AWS Marketplace and click 'Continue to Subscribe':

...

11. Open WCS server web interface https://host.amazonaws.com:8888 in your browser and accept security exception. On license key page enter your commercial or 30 days trial license key:

Image Removed

12. Use the Instance ID of the launched virtual machine as the administrator password:

1312. Check WebRTC streaming from web camera and playing the stream using Two-way Streaming web example:

WCS deployment from AWS Marketplace image with custom settings

AWS Marketplace image contains only basic WCS settings. To customize the server, it is necessary to connect to the instance via SSH and restart WCS. However, to get ready to launch server "out of the box", it is possible to set up user script to reconfigure the server during the first start. This can be useful, for example, to deploy autoscaling group.

1. In EC2 Console go to "Instances - Instances" section and click "Launch instance"

Image Added

2. Choose Marketplace AMI "Web Call Server" using search string

Image Added

3. Review AMI information

Image Added

4. Choose instance type

Image Added

5. Scroll down "Configure Instance Details" page until the end and insert custom update and setup script to "User data" text box

Image Added

The setup script example to update WCS to latest build and to configure Origin server for WebRTC and RTMP streams publishing

Code Block
languagebash
themeRDark
titleOrigin setup script
collapsetrue
#!/bin/bash

# Stop WCS before reconfiguring
PID="$(pgrep -f 'com.flashphoner.server.Server' | grep -v bash)"
if [ -n "$PID" ]; then
    service webcallserver stop
fi

# Update WCS to the latest build (optionally, set to false if you don't)
UPDATE=true
if $UPDATE; then
    cd /tmp
    wget --timeout=10 --no-check-certificate https://flashphoner.com/download-wcs5.2-server.tar.gz -O wcs5-server.tar.gz
    if [ $? -eq 0 ]; then
        mkdir -p FlashphonerWebCallServer-5.2-latest && tar xzf wcs5-server.tar.gz -C FlashphonerWebCallServer-5.2-latest --strip-components 1
        cd FlashphonerWebCallServer-5.2-latest
        chmod +x install.sh
        ./install.sh -silent
        cd ..
        rm -rf FlashphonerWebCallServer-5.2-latest wcs5-server.tar.gz
    fi
fi

# Configuration setup
WCS_CONFIG=/usr/local/FlashphonerWebCallServer/conf/flashphoner.properties
JVM_CONFIG=/usr/local/FlashphonerWebCallServer/conf/wcs-core.properties

#CDN settings
CDN_ROLE=origin
CDN_IP=0.0.0.0
echo -e "\ncdn_enabled=true" >> $WCS_CONFIG
echo -e "\ncdn_ip=$CDN_IP" >> $WCS_CONFIG
echo -e "\ncdn_role=$CDN_ROLE" >> $WCS_CONFIG
echo -e "\ncdn_nodes_resolve_ip=false" >> $WCS_CONFIG

# Request keyframes from WebRTC publishers every 5 seconds
echo -e "\nperiodic_fir_request=true" >> $WCS_CONFIG

# Disable RTMP keepalives to publish from OBS
echo -e "\nkeep_alive.enabled=websocket,rtmfp" >> $WCS_CONFIG

# Configure heap settings
HEAP_SIZE=512m
sed -i -e "s/^\(-Xmx\).*\$/\1$HEAP_SIZE/" $JVM_CONFIG

# Start WCS after reconfiguring
PID="$(pgrep -f 'com.flashphoner.server.Server' | grep -v bash)"
if [ -n "$PID" ]; then
    service webcallserver restart
else
    service webcallserver start
fi

# Disable internal firewall, ports are allowed/blocked on security group level
iptables -F

6. Configure security group. By default, the security group will be created from AMI settings. Add the necessary ports

Image Added

7. Click "Review and Launch". If all the parameters are correct, click "Launch"

Image Added

Server instance will be launched

Image Added

8. Open WCS web interface, publish test stream in Two Way Streaming example and play it

Image Added

Known issues

1. After migration to Amazon Linux 2 AMI as basic image, systemd is used for services management

Symptoms: the command

Code Block
languagebash
themeRDark
sudo service webcallserver start

returns

Code Block
themeRDark
Redirecting to /bin/systemctl start webcallserver.service

the command

Code Block
languagebash
themeRDark
sudo service webcallserver check_update

does not work

Solution:

a) use systemctl to start, stop, restart WCS

Code Block
languagebash
themeRDark
sudo systemctl start webcallserver
sudo systemctl stop webcallserver
sudo systemctl restart webcallserver

b) use webcallserver script to check updates

Code Block
languagebash
themeRDark
cd /usr/local/FlashphonerWebCallServer/bin
sudo ./webcallserver check_update
sudo ./webcallserver update