How to install YouPHPTube Encoder on Ubuntu Server 16.04 LTS

Post Reply
User avatar
LHammonds
Site Admin
Site Admin
Posts: 679
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

How to install YouPHPTube Encoder on Ubuntu Server 16.04 LTS

Post: # 599Post LHammonds
Wed Apr 04, 2018 12:09 pm

** PROJECT ABANDONED **

I never could get this component working on a separate server or same server as the streamer.


Cannot upload audio - Extension not allowed - Reported Issue #565

Greetings and salutations,

I hope this thread will be helpful to those who follow in my foot steps as well as getting any advice based on what I have done / documented.

To discuss this thread, please participate here: >> CREATE FORUM LINK <<

High-level overview

This thread will cover installation of an Apache web service and YouPHPTube Encoder service on a dedicated Ubuntu server and will utilize a separate dedicated database server. The server will be installed inside a virtual machine vSphere running on ESXi servers. Although there are some VMware-specific steps, they are very few and the majority of this documentation will work for other VMs such as VirtualBox or even directly installed onto a physical machine. Please excuse any ignorance on my part and if you have any advice on doing things better, please let me know. I love feedback and learning better ways of doing things!

After Ubuntu is installed and configured, Apache web server will be installed and configured. Next will be the installation and configuration of YouPHPTube Encoder which will utilize an existing remote database server (MariaDB/MySQL).

Image

Tools utilized in this process
Helpful links

The list below are sources of information that helped me configure this system as well as some places that might be helpful to me later on as this process continues.
Assumptions

This documentation will need to make use of some very-specific information that will most-likely be different for each person / location. And as such, I will note some of these in this section. They will be highlighted in red throughout the document as a reminder that you should plug-in your own value rather than actually using my "place-holder" value.

Under no circumstance should you use the actual values I list below. They are place-holders for the real thing. This is just a checklist template you need to have answered before you start the install process.

Wherever you see RED in this document, you need to substitute it for what your company uses. Use the list below as a template you need to have answered before you continue.
  • Ubuntu Server name: srv-encoder
  • Internet domain: youphptube.mydomain.com and encoder.mydomain.com
  • Ubuntu Server IP address: 192.168.107.66
  • Ubuntu Admin ID: administrator
  • Ubuntu Admin Password: myadminpass
  • Email Server (remote): 192.168.107.25
  • MySQL Server (remote): 192.168.107.20
  • MySQL root Password: mysqlrootpass
  • MySQL YouPHPTube Encoder user: youphptubeencoderuser
  • MySQL YouPHPTube Encoder Password: youphptubeencoderuserpass
I also assume the reader knows how to use the VI editor. If not, you will need to beef up your skill set or use a different editor in place of it.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 679
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Server OS Installation

Post: # 600Post LHammonds
Wed Apr 04, 2018 1:38 pm

Installation of Database Server

This documentation will assume you have installed a separate and dedicated database server according to this article: How To Install MariaDB

Installation of Ubuntu Server

This documentation will assume you have installed Ubuntu Server according to this article: How to install and configure Ubuntu Server

It is assumed that the server was configured according to that article with the exceptions that the assumptions in red (variables above) are used instead of the assumptions in that document since we are building a web server.

Be sure to add a host entry that points to your database server in /etc/hosts. Example:

Code: Select all

192.168.107.20	srv-database

User avatar
LHammonds
Site Admin
Site Admin
Posts: 679
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Configure Database

Post: # 601Post LHammonds
Wed Apr 04, 2018 1:48 pm

Configure MariaDB / MySQL

In this scenario, a dedicated and general-purpose database server already exists and it will be used to hold the application's database.
  1. Connect to the MariaDB/MySQL server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass) and then temporarily grant yourself super user privileges by typing sudo su
  3. Type the following commands:
    mysql -u root -p Enter password: rootpass
    CREATE DATABASE youphptubeencoder CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'youphptubeencoderuser'@'%' IDENTIFIED BY 'youphptubeencoderuserpass'; GRANT ALL ON youphptubeencoder.* TO 'youphptubeencoderuser'@'%'; FLUSH PRIVILEGES; exit
    The above commands will allow the database account to connect from any machine from anywhere in the world. This might be OK if your database is not accessible outside your local network or if your machine name changes or you have multiple servers that connect to the same database that use the same ID. You can make this more secure by specifying your application server when granting access. Make sure the database server will recognize the server name (via hosts file or DNS) or just use the IP address:
    CREATE USER 'youphptubeencoderuser'@'srv-encoder' IDENTIFIED BY 'youphptubeencoderuserpass'; GRANT ALL ON youphptubeencoder.* TO 'youphptubeencoderuser'@'srv-encoder';
    or
    CREATE USER 'youphptubeencoderuser'@'192.168.107.66' IDENTIFIED BY 'youphptubeencoderuserpass'; GRANT ALL ON youphptubeencoder.* TO 'youphptubeencoderuser'@'192.168.107.66';
    This will prevent anyone knowing the credentials from logging into the database from any other remote machine not specified in the grant command.

    If your application is running on the database server (typical on a developer machine / non-production scenario), create the user like this:
    CREATE USER 'youphptubeencoderuser'@'localhost' IDENTIFIED BY 'youphptubeencoderuserpass'; GRANT ALL ON youphptubeencoder.* TO 'youphptubencodereuser'@'localhost';
    This will prevent anyone knowing the credentials from logging into the database from any other remote machine.

    If you mess anything up, you can remove the database and user by issuing these commands:
    DROP USER youphptubeencoderuser; FLUSH PRIVILEGES; DROP DATABASE youphptubeencoder;

User avatar
LHammonds
Site Admin
Site Admin
Posts: 679
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Install Web Server

Post: # 602Post LHammonds
Wed Apr 04, 2018 2:31 pm

Install Apache Web Server
  1. Connect to the SRV-Encoder server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass) and then temporarily grant yourself super user privileges by typing sudo su
  3. Type the following commands:

    Code: Select all

    apt -y install apache2 php7.0 libapache2-mod-php7.0 php7.0-curl php7.0-gd php7.0-intl php7.0-mysql
  4. Once that is done, open a web browser and go to http://192.168.107.66 and you should see a web page that says "It works!"
Install Required Libraries

Code: Select all

apt-get install ffmpeg git libimage-exiftool-perl
Configure PHP Settings

Edit the PHP configuration and modify the following variables:

Code: Select all

vi /etc/php/7.0/apache2/php.ini
Change:

Code: Select all

max_execution_time = 30
To:

Code: Select all

max_execution_time = 7200
Change:

Code: Select all

post_max_size = 8M
To:

Code: Select all

post_max_size = 2048M
Change:

Code: Select all

upload_max_filesize = 2M
To:

Code: Select all

upload_max_filesize = 2048M
Change:

Code: Select all

memory_limit = 128M
To:

Code: Select all

memory_limit = 512M
Restart web service for changes to take effect:

Code: Select all

service apache2 restart
Download YouPHPTube Encoder

Code: Select all

cd /var/www
git clone https://github.com/DanielnetoDotCom/YouPHPTube-Encoder.git
chown -R www-data:www-data /var/www/YouPHPTube-Encoder
Create Apache Config for the web site

Your PC needs to be able to resolve the FQDN (Fully-Qualified Domain Name) to the server's IP address from this point forward.

If you are setting up this site before DNS (Domain Naming Service) can resolve the FQDN to the server's IP address, you can temporarily get around this by adding your domain to your local host on Windows or Linux. This will allow just your PC to match the FQDN to the server's IP address. Once DNS is managing this relationship, the local host entry is no longer needed.

Windows Example: C:\Windows\system32\drivers\etc\hosts
192.168.107.66 encoder.mydomain.com
Linux Example: /etc/hosts
192.168.107.66 encoder.mydomain.com

Code: Select all

touch /etc/apache2/sites-available/encoder.conf
chown root:root /etc/apache2/sites-available/encoder.conf
chmod 0644 /etc/apache2/sites-available/encoder.conf
vi /etc/apache2/sites-available/encoder.conf
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName encoder.mydomain.com DocumentRoot /var/www/YouPHPTube-Encoder <Directory /var/www/YouPHPTube-Encoder/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/encoder-error.log CustomLog ${APACHE_LOG_DIR}/encoder-access.log combined </VirtualHost>
Enable the site configuration:

Code: Select all

a2ensite encoder
If you need to disable the site in the future:

Code: Select all

a2dissite encoder
Reload the Apache config so it is aware of the modified virtual host

Code: Select all

service apache2 reload
Enable Mod_ReWrite

Code: Select all

a2enmod rewrite
service apache2 restart

User avatar
LHammonds
Site Admin
Site Admin
Posts: 679
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Configure YouPHPTube Encoder

Post: # 603Post LHammonds
Wed Apr 04, 2018 2:54 pm

Configure YouPHPTube Encoder

At this point, you should wait until you have installed the YouPHPTube Streamer service on your dedicated web server. Once online, come back to this point and finish this section.
  1. Access the site via a web browser. Example: http://192.168.107.66 or http://encoder.mydomain.com
  2. Fill out the following settings and click Submit:
    Your Site URL: http://192.168.107.66/
    System Path to Application: /var/www/YouPHPTube-Encoder/
    Database Host: srv-database (or 192.168.107.20)
    Database User: youphptubeencoderuser
    Database Password: youphptubeencoderuserpass
    Database Name: youphptubeencoder
    Allowed YouPHPTube Streamer Sites:
    youphptube.mydomain.com
    192.168.107.23
    Default Priority: 1
    Do you want to create database and tables? Create only tables (Do not create database)
    YouPHPTube Streamer Site URL: http://youphptube.mydomain.com (or http://192.168.107.23)
    YouPHPTube Streamer Site Admin User: admin
    YouPHPTube Streamer Site admin Password: YouPHPTubeAdminPass

User avatar
LHammonds
Site Admin
Site Admin
Posts: 679
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Upgrading YouPHPTube Encoder

Post: # 606Post LHammonds
Thu Apr 05, 2018 3:41 pm

How to Upgrade YouPHPTube Encoder

>> NOT STARTED <<

User avatar
LHammonds
Site Admin
Site Admin
Posts: 679
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Backup and Restore

Post: # 607Post LHammonds
Thu Apr 05, 2018 3:55 pm

How to Backup and Restore

>> NOT STARTED <<

Post Reply