How To Install YouPHPTube on Ubuntu Server: A YouTube Clone Script

YouTube is the most popular and giant online video streaming platform. The Youtube is owned by the Google but you can make your own personal YouTube by installing an open source video streaming solution called YouPHPTube. It is just like YouTube and you can say it is a perfect PHP based YouTube clone script. This PHP based video script allows creating a features rich video sharing site platform. You can start your own  Live Video Streaming Business using this streaming platform. It uses NGINX to convert Live Stream into HLS format, making it HTML5/mobile compatible. Using it you can also download and encode videos from other sites like Youtube, Vimeo, etc. and share directly on your website. It provides user based login system and people can use Facebook or Google login to register the YouPHPTube. As it is open source and if you are a developer then you are free to customize it.

The YouPHPTube is not limited to video streaming it also supports Google AdSense which means you can start making money with your own video sharing site.

youtube clone github

Key Features of Open source YouPHPTube: 

  • Live Video Streaming
  • Integrated with functionality that allows you to sync your videos with YouTube and also Upload & Download.
  • Encode multiple formats multimedia files to MP4, WebM and MP3 files.
  • Separate installation of Encoder server is possible
  • Like YouTube User Subscription feature.
  • Videos Statistics option to monitor your videos performance.
  • Allows Google Ads Sense to display advertisements on the videos.
  • Segregate the video on the category basis and organize them.
  • Built-in videos Ads system that allows playing the ads before playing any videos just like Adsense ads on YouTube.
  • Facebook and Google Login.
  • Plugins support to enhance the functionality.
  • Language Translations.
  • User Playlist to organize the videos into groups.
  • Multiple theme options available.
  • Download videos from sites like YouTube.com and a few more sites.

Prerequisite for Installing YouPHPTube

  • Linux based server for setting up Encoder and Live Streamer server
  • PHP 5.3+
  • MySQL 5.0+
  • Apache web server 2.x (with mod_rewrite enabled)

For YouPHPTube Demo: https://demo.youphptube.com/ and  Website Link

ALSO SEE:

Best Opensource video sharing CMS

 

Install and Setup YouPHPTube Open source Video Sharing Platform

Step 1:  Press the Ctril+Alt+T which will run the Terminal on the Ubuntu server. Run the command SU  and enter the root password. For more info see: how to access or set up the root user on Ubuntu.  Once you successfully got the root access in the Ubuntu move to the next step.

how to access the root on ubuntu to install the media server software

Step 2:  If you want to install both encoder and streamer server on the same server machine then run the given command. What will it do? The given below singe command will Install LAMP server, Git, youtube-dl, python, Encoder server, and Streaming Server plus download and save this PHP project from the Github and save it under Var/www/html directory.

sudo apt-get install apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql 
php7.0-curl php7.0-gd php7.0-intl mysql-server mysql-client ffmpeg git 
libimage-exiftool-perl && cd /var/www/html && sudo git clone 
https://github.com/DanielnetoDotCom/YouPHPTube.git && cd /var/www/html && 
sudo git clone https://github.com/DanielnetoDotCom/YouPHPTube-Encoder.git 
&& sudo apt-get install python && sudo curl -L 
https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl 
&& sudo chmod a+rx /usr/local/bin/youtube-dl

Note: Use the above command if you are planning to install the Encoder and Streamer on the same server. However, if you want to install the Encoder and streamer separately follow the below-given step by step guide.

Installing Encoder and Streamer on different servers

#1.  Steamer Installation

Step 1: First of all, we install the LAMP server and Git by using the following command.

sudo apt-get install apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql 
php7.0-curl php7.0-gd php7.0-intl mysql-server mysql-client git

The LAMP is the Linux Apache MySql PHP server and these are the base requirements to install the YouPHPTube. Whereas the Git is the version control system that keeps track of changes in computer files and coordinating work on those files among multiple people.

 

Step 2: Now download the YouPHPTube Streamer to the server by using the following command.

cd /var/www/html && sudo git clone https://github.com/DanielnetoDotCom/YouPHPTube.git

This command will download the YouPHPTube project from the Github and save it in the var/www/html folder.

#2. Encoder installation

Step 1: Like the Streamer, we also need to install the LAMP server and Git to up and run the Encoder server.

sudo apt-get install apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql 
php7.0-curl php7.0-gd php7.0-intl mysql-server mysql-client git

Step 2:  Install the FFmpeg. The FFmpeg is the free software used to handle multimedia data. It includes libavcodec, an audio/video codec library, libavformat (Lavf), an audio/video container mux and demux library, and the ffmpeg command line program for transcoding multimedia files.

sudo apt-get install ffmpeg git libimage-exiftool-perl

Step 3:  After above setup, its time to download the YouPHPTube encoder files from Github using the command:

cd /var/www/html && sudo git clone https://github.com/DanielnetoDotCom/YouPHPTube-Encoder.git

 

Everything is now ready, you can connect the encoder to the streamer server by the option given in the YouPHPTube dashboard. Right now you can just upload and play the of YouPHPTube but if you want to add one additional feature that allows downloading videos from YouTube, Vimeo and couple of other websites directly to your YouPHPTube website, you need to install the youtube-dl.

Step 4: As the youtube-dl depends on the Python, first we install it.

sudo apt-get install python

Step 5:  In this step, we will download the youtube-dl file and transfer it to the bin folder using the curl command, if you don’t have the curl you can use the weget.

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o 
/usr/local/bin/youtube-dl && sudo chmod a+rx /usr/local/bin/youtube-dl

or

sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O 
/usr/local/bin/youtube-dl && sudo chmod a+rx /usr/local/bin/youtube-dl

Configure the YouPHPTube

After installing the YouPHPTube by using one of the above-given methods. It’s time to access and configure the Youtube alternative opensource video streaming platform called YouPHPTube.

Step 1: To use the YouPHPTube, enter your domain URL  following the folder name YouPHPTube. If you are using it locally then type: http://127.0.0.1/YouPHPTube/

Once you open the URL you will get an error message: “Error. Oops, you’ve have encountered an error“.

Also, the solution of this error is given on the screen, we will let you go through them.

YouPHPTube encountered an error

 

The error you are getting at this stage is that the Apache doesn’t have the access to read the directory YouPHPTube reside inside the /var/www/html.

To give the access run the command:

 sudo nano/etc/apache2/apache.conf

After running the above command to edit the Apache config file you will see the follwoing code

<Directory /var/www/>
          Options Indexes FollowSymLinks
          AllowOverride None
         Require all granted
</Directory>

Now change the AllowOverride None to AllowOverride All.

video sharing script php free download

After changing, editing and saving the above file, run the following commands:

sudo a2enmod rewrite
service apache2 restart

 

Step 2:  When you successfully rectify the above problem then refresh the browser, this time you will see that the YouPHPTube is asking for a couple of permissions.

To give permission just click on the details link under each required permission and it shows the commands you need to follow. For example, the first permission it asking us is to give the writable permission to videos directory. When we clicked on the details link it provides the following commands:

sudo mkdir /var/www/html/YouPHPTube/videos
sudo chmod -R 777 /var/www/html/YouPHPTube/videos

The first command is used to create videos directory under the YouPHPTUbe and the second one is for giving the R/W permission

 

Step 3:  Once you have set all the permissions, refresh the browser and assign the email ID, database password (given at the time of LAMP installation) and admin password.

Step 4: Click on Submit and log in using Username: admin and the password you have given in the above step.

Step 5: Finally you have installed the YouPHPTube successfully. Now upload your videos for sharing. 

 

 

 

If you have any questions or stuck somewhere just comment and we will reply as soon as possible.

Leave a Reply