This tutorial goes to point out you the way to run your individual video-sharing web site with AVideo (previously YouPHPTube) on Ubuntu 20.04. AVideo is an open-source, self-hosted different to video-sharing web sites like YouTube, Vimeo, and many others. With AVideo, customers can add movies to your server and share it with the Web.

AVideo Options

  • Limitless and simultaneous dwell streams and you’ll have limitless customers related to every dwell stream.
  • Import and encode movies from different websites instantly from the Web
  • Bulk encoding from native video listing
  • Make personal movies
  • Completely built-in operate with Youtube, syncing your movies with Youtube
  • Transcode a number of codecs of multimedia recordsdata to MP4, WebM and MP3 file
  • Help Amazon S3 (Easy Storage Service)
  • Responsive website format. AVideo appears to be like unimaginable on any gadget. (You possibly can select YouTube or Netfilx model format.)
  • Person channels and consumer playlists
  • Subscribe to channels you want
  • You possibly can monitor the efficiency of your movies with up-to-date metrics and experiences in AVideo Statistics.
  • Lengthen website functionalities with plugins.
  • search engine marketing Optimized
  • iOS and Android apps obtainable

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

AVideo Server Necessities

First, it’s best to know {that a} single-core CPU just isn’t viable for a video sharing web site, as a result of the encoding course of will use lots of CPU useful resource.

Then select the server specs in accordance with the variety of customers your website have.

  • If you happen to simply need to use it to share your individual movies, you want a server with not less than 2 CPU cores and 4GB RAM. You should purchase a robust VPS (digital personal server) from Contabo with little or no value.
  • If you happen to anticipate you website to have dozens of customers, then you’ll be able to take into account the Contabo additional massive VPS, which has 10 CPU cores, 60GB RAM, 1Gbit/s port velocity, 1.6TB disk house, limitless site visitors however prices simply 26.99 Euros/month.
  • When your website grows past that, you can purchase a devoted server.

Software program Necessities for Putting in AVideo on Ubuntu 20.04

AVideo requires PHP and MySQL/MariaDB. To comply with this tutorial, it’s best to have already arrange a LAMP stack or LEMP stack. If you happen to favor to make use of Apache internet server, then set up LAMP stack.

If you happen to favor to make use of Nginx internet server, then set up LEMP stack.

Notice: AVideo assist with Nginx is barely experimental. Your website could have points if you happen to use Nginx.

You additionally want a site identify. I registered my area identify at NameCheap as a result of the worth is low and so they give whois privateness safety free for all times.

AVideo is comprised of two elements.

  • The principle half is the entrance finish stream server, which permits customers to observe present movies.
  • The opposite half is the encoder, which permits customers to add their movies.

The general public encoder makes use of the area identify https://encoder1.avideo.com. If you happen to don’t need customers to depart your website when importing movies, that you must arrange your personal encoder. I’ll present you ways on this article. With out additional ado, let’s get began.

Step 1: Obtain AVideo on Ubuntu 20.04 Server

Log into your Ubuntu 20.04 server by way of SSH. Then go to the online root listing.

cd /var/www/

Clone the AVideo streamer repository from Github.

sudo apt set up git
sudo git clone https://github.com/WWBN/AVideo.git

Then go into the listing.

cd AVideo/

Clone the AVideo encoder repository from Github.

sudo git clone https://github.com/WWBN/AVideo-Encoder.git

It is going to be saved as AVideo-Encoder. We rename it to add, so customers can have a greater thought of what this URL is for when importing movies.

sudo mv AVideo-Encoder add

Subsequent, we have to make www-data (the online server consumer) because the proprietor of the online root.

sudo chown www-data:www-data /var/www/AVideo/ -R

Step 2: Set up Dependencies

AVideo makes use of FFmpeg to encode movies. We will simply set up FFmpeg from the default Ubuntu repository.

sudo apt set up ffmpeg

To learn and write meta info in multimedia recordsdata, we have to set up the libimage-exiftool-perl package deal.

sudo apt set up libimage-exiftool-perl

You additionally want to put in some frequent PHP extensions.

sudo apt set up php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline php7.4-curl php7.4-gd

To fetch movies from different websites, we have to set up YouTube-DL. Although it’s included within the Ubuntu repository, but it surely’s outdated. We’ll set up YouTube-DL from the Python Package deal Index, which at all times comprises the most recent model of YouTube-DL.

sudo apt set up python3-pip
sudo -H pip3 set up youtube-dl

It’s crucial that you just use the most recent model, otherwise you may not have the ability to obtain movies from different websites. We will create a Cron job to robotically verify and set up the most recent model.

sudo crontab -e

Add the next line on the finish of the Crontab file to strive upgrading YouTube-DL day by day.

@day by day sudo -H pip3 set up –upgrade youtube-dl > /dev/null

Step 3: Create Database and Person in MariaDB

Log into MariaDB database server with the next command. Since MariaDB is now utilizing unix_socket plugin to authentication consumer login, there’s no must enter MariaDB root password. We simply must prefix the mysql command with sudo.

sudo mysql

Then create a database for AVideo. This tutorial names the database AVideo. You should use no matter identify you want.

create database AVideo;

Create the database consumer. Once more, you should use your most well-liked identify for this consumer. Exchange your-password together with your most well-liked password.

create consumer [email protected] recognized by ‘your-password’;

Grant this consumer all privileges on the AVideo database.

grant all privileges on AVideo.* to [email protected];

We additionally must create a separate database for the encoder.

create database AVideoEncoder;

Create a consumer for this database.

create consumer [email protected] recognized by ‘your-password’;

Grant privileges.

grant all privileges on AVideoEncoder.* to [email protected];

Flush the privileges desk and exit.

flush privileges;

exit;

Step 4: Setting Up Net Server

We will use Apache or Nginx internet server.

Apache

If you happen to favor Apache, create a digital host file for AVideo with a command-line textual content editor like Nano.

sudo nano /and many others/apache2/sites-available/avideo.conf

Put the next textual content into the file. Exchange the red-colored textual content together with your precise knowledge. I take advantage of a subdomain on this tutorial. You should use your most important area identify if you happen to favor. Don’t overlook to set DNS A report for the area identify in your DNS report supervisor. Additionally, be aware that the doc root listing is case-sensitive and you shouldn’t add a ahead slash on the finish.

ServerName tube.yourdomain.com
DocumentRoot /var/www/AVideo

DirectoryIndex index.php
Choices +FollowSymLinks
AllowOverride All
Require all granted

ErrorLog ${APACHE_LOG_DIR}/avideo.error.log
CustomLog ${APACHE_LOG_DIR}/avideo.entry.log mixed

 

Save and shut the file. Then allow this digital host.

sudo a2ensite avideo.conf

We have to allow the rewrite module.

sudo a2enmod rewrite

Restart Apache for the modifications to take impact.

sudo systemctl restart apache2

Now go to tube.yourdomain.com and you may be redirected to the setup wizard web page (tube.yourdomain.com/set up/index.php). If you happen to see the default Apache web page as a substitute of the setup wizard, then that you must disable the default digital host.

sudo a2dissite 000-default.conf

And restart Apache.

Earlier than getting into any info within the setup wizard, we have to allow HTTPS.

Nginx

If you happen to favor Nginx, create a avideo.conf file in /and many others/nginx/conf.d/ listing.

sudo nano /and many others/nginx/conf.d/avideo.conf

Put the next textual content into the file. Exchange the red-colored textual content together with your precise knowledge. I take advantage of a subdomain on this tutorial. You should use your most important area identify if you happen to favor. Don’t overlook to set DNS A report for the area identify in your DNS report supervisor. Additionally be aware that the doc root listing is case-sensitive.

server {
pay attention 80;
server_name tube.yourdomain.com;

root /var/www/AVideo;
index index.php index.html index.htm;
charset utf-8;
client_max_body_size 2G;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

access_log /var/log/nginx/avideo.entry.log;
error_log /var/log/nginx/avideo.error.log;

location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
embrace fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

location = /add/index.php
rewrite ^(.*)$ /add/view/index.php final;

location = /add/isAdmin
rewrite ^(.*)$ /add/view/isAdmin.php final;

location = /add/removeStreamer
rewrite ^(.*)$ /add/view/removeStreamer.php final;

location = /add/precedence

location = /add/standing

location = /add/serverStatus

location = /add/add
rewrite ^(.*)$ /add/view/add.php final;

location = /add/listFiles.json

location = /add/deleteQueue

location = /add/saveConfig

location = /add/youtubeDl.json
rewrite ^(.*)$ /add/view/youtubeDl.json.php final;

location = /add/ship.json

location = /add/streamers.json

location = /add/queue.json

location = /add/queue
rewrite ^(.*)$ /add/view/queue.php final;

location = /add/login
rewrite ^(.*)$ /add/objects/login.json.php final;

location = /add/logoff
rewrite ^(.*)$ /add/objects/logoff.json.php final;

location /add/ {
rewrite “^/getImage/([A-Za-z0-9=/]+)/([A-Za-z0-9]{3})$” /add/objects/getImage.php?base64Url=$1&format=$2 final;
rewrite “^/getImageMP4/([A-Za-z0-9=/]+)/([A-Za-z0-9]{3})/([0-9.]+)$” /add/objects/getImageMP4.php?base64Url=$1&format=$2&time=$Three final;
}

location /add/getSpiritsFromVideo
rewrite ^/getSpiritsFromVideo/([A-Za-z0-9=/]+)/([0-9]+)/([0-9]+)$ /add/objects/getSpiritsFromVideo.php?base64Url=$1&tileWidth=$2&totalClips=$Three final;

location /add/getLinkInfo

}

Save and shut the file. Then take a look at Nginx configuration.

sudo nginx -t

If the take a look at is profitable, reload Nginx for the modifications to take impact.

sudo systemctl reload nginx

Now go to tube.yourdomain.com and you may be redirected to the setup wizard web page (tube.yourdomain.com/set up/index.php). Earlier than getting into any info within the setup wizard, we have to allow HTTPS.

Step 5: Enabling HTTPS

To encrypt the HTTP site visitors, we are able to allow HTTPS by putting in a free TLS certificates issued from Let’s Encrypt. Run the next command to put in Let’s Encrypt consumer (certbot) on Ubuntu 20.04 server.

sudo apt set up certbot

If you happen to use Apache, you additionally want to put in the Certbot Apache plugin.

sudo apt set up python3-certbot-apache

And run this command to acquire and set up TLS certificates.

sudo certbot –apache –agree-tos –redirect –hsts –staple-ocsp –email [email protected] -d tube.yourdomain.com

If you happen to use Nginx, set up the Certbot Nginx plugin.

sudo apt set up python3-certbot-nginx

Subsequent, run the next command to acquire and set up TLS certificates.

sudo certbot –nginx –agree-tos –redirect –hsts –staple-ocsp –email [email protected] -d tube.yourdomain.com

The place

  • –nginx: Use the nginx plugin.
  • –apache: Use the Apache plugin.
  • –agree-tos: Comply with phrases of service.
  • –redirect: Drive HTTPS by 301 redirect.
  • –hsts: Add the Strict-Transport-Safety header to each HTTP response. Forcing browser to at all times use TLS for the area. Defends in opposition to SSL/TLS Stripping.
  • –staple-ocsp: Permits OCSP Stapling. A legitimate OCSP response is stapled to the certificates that the server provides throughout TLS.

The certificates ought to now be obtained and robotically put in.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Step 6: End Set up with the Setup Wizard

Now go to tube.yourdomain.com and the setup wizard will seem. On the left aspect, you’ll be able to see in case your server meet the necessities.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

If you happen to use Nginx, you’ll be able to ignore the next message.

Your server is nginx/1.14.2, you will need to set up Apache.

As you’ll be able to see, the PHP post_max_size ought to be not less than 100M and upload_max_filesize ought to be not less than 100M. We have to edit the php.ini file to vary the 2 values. If you happen to use Apache internet server, then

sudo nano /and many others/php/7.4/apache2/php.ini

If you happen to use Nginx with PHP-FPM, then that you must edit the FPM model of php.ini file.

sudo nano /and many others/php/7.4/fpm/php.ini

Discover the next two strains.

post_max_size = 8M
upload_max_filesize = 2M

Change the values in keeping with the video file dimension you’re going to add. For instance, if you happen to enable importing 1G video file, then

post_max_size = 1024M
upload_max_filesize = 1024M

Save and shut the file. Restart Apache for the modifications to take impact.

sudo systemctl restart apache2

If you happen to use Nginx with PHP-FPM, then restart PHP-FPM.

sudo systemctl restart php7.4-fpm

Now refresh the AVideo set up wizard web page. Your server ought to go all necessities. Now on the fitting aspect, you’ll be able to enter a title your video website, and set a system admin password. Enter the AVideo database identify, consumer and password your created earlier. (Notice: You need to use the primary database, not the encoder database. Additionally pay attention to case-sensitive.)

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Click on the Set up now button and AVideo ought to be put in efficiently.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Now we have to take away the /var/www/AVideo/set up/ listing.

sudo rm /var/www/AVideo/set up/ -r

Click on the Go to the primary web page button and you will note the AVideo most important web page.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

You possibly can click on the drop-down menu on the left and login because the admin consumer and with the password you set only a few moments in the past.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Step 7: Set Up the Encoder

Go to https://tube.yourdomain.com/add/. You can be redirected to the Encoder setup wizard. If you’re not robotically redirected, then you’ll be able to manually enter the setup wizard URL.

https://tube.yourdomain.com/add/set up/index.php/

The left hand aspect will present you in case your server meet the necessities of AVideo Encoder.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

If you happen to use Nginx, you’ll be able to ignore the next message.

Your server is nginx/1.14.2, you will need to set up Apache.

As you’ll be able to see the PHP max_execution_time ought to be not less than 7200 and PHP memory_limit ought to be not less than 512M. We have to edit the php.ini file to vary the 2 values. If you happen to use Apache internet server, then

sudo nano /and many others/php/7.4/apache2/php.ini

If you happen to use Nginx with PHP-FPM, then that you must edit the FPM model of php.ini file.

sudo nano /and many others/php/7.4/fpm/php.ini

Discover the next two strains.

max_execution_time = 30
memory_limit = 128M

Change the values.

max_execution_time = 7200
memory_limit = 512M

Notice that if later video encoding stops half method by way of, that you must improve the max_execution_time, or improve your CPU.

Save and shut the file. Restart Apache for the modifications to take impact.

sudo systemctl restart apache2

If you happen to use Nginx with PHP-FPM, then restart PHP-FPM.

sudo systemctl restart php7.4-fpm

Now refresh the AVideo Encoder set up wizard web page. Your server ought to go all necessities. Now on the fitting aspect, that you must enter the AVideoEncoder database identify, consumer and password your created earlier. Pay attention to case-sensitive and enter the streamer website’s admin password.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Click on the Set up Now button and AVideo Encoder might be put in.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Take away the set up listing.

sudo rm /var/www/AVideo/add/set up/ -r

And go to the primary web page.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Step 8 : Change the Encoder URL

By default, AVideo makes use of the general public encoder for importing movies. To make use of your individual encoder, register as admin in AVideo (not AVideo Encoder) and go to the admin panel from the left sidebar.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Go to settings -> website settings -> superior configuration. Change the Encoder URL to https://tube.yourdomain.com/add/. Save the settings, clear the cache listing and generate a brand new sitemap.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Now log off and log again in. If you happen to click on the encode video and audio button on the upper-right nook, you may be taken to your individual encoder to add movies. It ought to be famous that the encoding velocity depends upon your server’s CPU energy. It doesn’t require a lot RAM as a result of the encoder will copy the video to a short lived file within the add listing (/var/www/AVideo/add/movies).

Step 9: Configure SMTP

To ship out emails (corresponding to account registration, password reset, and many others), that you must configure an SMTP server. If you want to make use of your individual mail server to ship emails to shoppers, please take a look at the next article to arrange your individual mail server.

If you want to make use of an SMTP relay service, I like to recommend Mailjet. You possibly can comply with the tutorial under to arrange SMTP relay in your AVideo server.

You possibly can take a look at electronic mail sending by going to the admin panel -> Setttings -> Website Settings -> Superior Configuration, you could find SMTP configuration. Use the next settings.

  • Allow SMTP.
  • Allow SMTP Auth.
  • Use tls in SMTP Safe.
  • Use 587 because the SMTP port.
  • Enter your mail server’s hostname.
  • Enter an SMTP username and password.

Click on the Save button to avoid wasting the settings, then click on Check E-mail to see if it’s working.

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

Allow TCP BBR

For a video streaming server, it’s really helpful to allow the TCP BBR congestion management algorithm within the Linux kernel by following the directions within the article under.

Cellular Apps

You possibly can obtain the free android app or iOS app by doing a seek for AVideo on Google Play Retailer or YPT Cellular in Apple Retailer. White-label cell app require a paid license.

Troubleshooting

In case your AVideo most important web page didn’t load some CSS and JavaScript assets,

How to Install Ubuntu 20.04 Server AVideo / YouPHPTube

It’s doubtless that you’ve got added additional ahead slash within the Apache or Nginx digital host file for the online root listing. As a substitute of utilizing

DocumentRoot /var/www/AVideo/

You need to use

DocumentRoot /var/www/AVideo

If the primary web site isn’t working correctly, you’ll be able to verify the log file at /var/www/AVideo/movies/youphptube.log. In case your encoder isn’t working correctly, you’ll be able to verify the log file at /var/www/AVideo/add/movies/youphptube.log.

Different Tidbits

When encoding movies, you’ll be able to select resolutions (low, SD, HD). If you happen to use AVideo as a private video streaming website, I like to recommend selecting HD decision solely to scale back encoding time and save disk house. When you have already encoded movies to all Three resolutions, you’ll be able to go to the AVideo video listing (/var/www/AVideo/movies) and delete low decision and SD decision movies.

cd /var/www/AVideo/movies/
sudo rm *Low.mp4
sudo rm *SD.mp4

How To Obtain All Movies From Your Video Website

You should use the youtube-dl command line utility to obtain all movies. First, that you must go to AVideo dashboard, then go to the video record web page and scroll right down to the underside, click on the obtain your movies record (permalink .txt file) button. You will notice a listing of URL for all of the movies.

Subsequent, open up a terminal and create a txt file with a textual content editor, copy the URLs from the online web page and paste them into the file. Then you’ll be able to run the next command to obtain the movies. Exchange video-list.txt with the your individual file identify.

youtube-dl -a video-list.txt

Wrapping Up

I hope this tutorial helped you put in AVideo on Ubuntu 20.04 server. As at all times, if you happen to discovered this publish helpful, then subscribe to our free e-newsletter to get extra suggestions and methods. Take care 🙂

Fee this tutorial

[Total: 0 Average: 0]

youphptube contact,video platform github,youtube clone php github,cumulusclips,how to install youphptube on ubuntu,how to install lamp server in ubuntu,how to install apache on ubuntu 18.04 desktop,youphptube github,youphptube tutorial,ubuntu 18.04 desktop web server,how to install youphptube on windows,install php 7.2 ubuntu 18.04 digitalocean