How to get started with Ant Media Server ?
Ant Media Server is a software that can stream live and VOD videos.
It supports adaptive streaming on the fly and records live videos in several formats like HLS, MP4, etc.
Download and save the Ant Media Server Community/Enterprise Edition from http://antmedia.io to your disk. Ant Media Server is being tested on ubuntu 14.04 and 16.04 versions on CI.
Open a terminal and go to the directory where you have downloaded Ant Media Server Zip file
cd path/to/where/ant-media-server....zip
Download the install_ant-media-server.sh
shell script
wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh
chmod 755 install_ant-media-server.sh
Call the download script file by giving ant-media-server zip file. The command below installs Ant Media Server and starts the service. Ant Media Server zip files are in format ant-media-server-<community|enterprise>-<version>-<date>.zip
sudo ./install_ant-media-server.sh ant-media-server*.zip
You can check the service if it is running
sudo service antmedia status
You can stop/start the service anytime you want
sudo service antmedia stop
sudo service antmedia start
Open your browser and type http://SERVER_IP_ADDRESS:5080
to go to the web panel. If you're having difficulty in accessing the web panel, there may be a firewall that blocks accessing the 5080 port.
In order to server run properly you need to open some network ports. Here are the ports server uses
Generally port forwarding is used to forward default ports to the server's ports in order to have easy of use. For instance let's forward 80 to 5080, just type the command below.
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 5080
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 5443
After running the command above, the request goes to 80, 443 is being forwarded to 5080, 5443 consecutively
To List port forwarding run the command below
sudo iptables -t nat --line-numbers -L
To delete a port forwarding run the command below
iptables -t nat -D PREROUTING [LINE_NUMBER_IN_PREVIOUS_COMMAND]
If you want the server to reload port forwarding after reboot, we need to install iptables-persistent package and save rules like below
sudo apt-get install iptables-persistent
Above command will install iptables-persistent package, after that just run the command below everytime you make a change and want it to be persistent
sudo sh -c "iptables-save > /etc/iptables/rules.v4"