How to install CumulusClips on Ubuntu Server 18.04 LTS

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

How to install CumulusClips on Ubuntu Server 18.04 LTS

Post: # 653Post LHammonds
Wed May 09, 2018 10:49 am

PROJECT ON HOLD

WORK-IN-PROGRESS ------------------- WORK-IN-PROGRESS


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: >> INSERT THREAD <<

High-level overview

This thread will cover installation of a dedicated Ubuntu web server. CumulusClips is a video sharing script that allows you to start your own YouTube-like video website where users can upload, rate and comment on videos. The server will be installed inside a virtual machine in vSphere running on ESXi servers. Notes will also be supplied for doing the same thing for VirtualBox on a Windows 10 PC. Although there are some VMware-specific and VirtualBox-specific steps, they are very few and the majority of this documentation will work for other Virtual Machines or even directly installed onto a physical machine (e.g. bare-metal install). If you have any advice on doing things better, please let me know by replying on the Ubuntu forums link above.

Tools utilized in this process
Helpful links

The list below are sources of information that was helpful in the creation of this document.
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, this information will be noted 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 these "place-holder" values.

Under no circumstance should you use the actual values listed 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 you will use in your environment.
  • Ubuntu Server name: srv-video
  • Internet domain: 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
  • Database root Password: mydbrootpass
  • Database user: cumulususer
  • Database user password: cumulususerpass
It is also assumed 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: 685
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Server OS Installation

Post: # 654Post LHammonds
Wed May 09, 2018 11:17 am

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: 685
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Configure Database

Post: # 655Post LHammonds
Wed May 09, 2018 11:23 am

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. Type the following commands:
    mysql -u root -p Enter password: rootpass
    CREATE DATABASE cumulusclips CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'cumulususer'@'%' IDENTIFIED BY 'cumulususerpass'; GRANT ALL ON cumulusclips.* TO 'cumulususer'@'%'; 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 outsite 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 'cumulususer'@'srv-video' IDENTIFIED BY 'cumulususerpass'; GRANT ALL ON cumulusclips.* TO 'cumulususer'@'srv-video';
    or
    CREATE USER 'cumulususer'@'192.168.107.66' IDENTIFIED BY 'cumulususerpass'; GRANT ALL ON cumulusclips.* TO 'cumulususer'@'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 'cumulususer'@'localhost' IDENTIFIED BY 'cumulususerpass'; GRANT ALL ON cumulusclips.* TO 'cumulususer'@'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 cumulususer; FLUSH PRIVILEGES; DROP DATABASE cumulusclips;

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

Requirements and Domain Resolution

Post: # 656Post LHammonds
Wed May 09, 2018 12:46 pm

CumulusClips Requirements

Source: http://cumulusclips.org/docs/requirements/
  • 1 GB RAM
  • Linux (Kernel 2.6.32+)
  • PHP 5.3+
  • MySQL 5.0+
  • Apache web server 2.x (with mod_rewrite enabled)
  • PHP Modules: POSIX, GD, curl, simplexml, zip, PHP-MySQL and PDO MySQL
  • PHP Settings: short_open_tag = On, upload_max_filesize = 110M, post_max_size = 110M, max_execution_time = 1500, safe_mode = Off, register_globals = Off
Domain Name Resolution

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 video.mydomain.com
Linux Example: /etc/hosts
192.168.107.66 video.mydomain.com

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

Install Web Server

Post: # 657Post LHammonds
Wed May 09, 2018 4:10 pm

Install Apache Web Server
  1. Connect to the SRV-Video 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.2 libapache2-mod-php7.2
  4. Open port 80 in the firewall. Edit /var/scripts/prod/en-firewall.sh and uncomment the necessary web server rules and run the script to update the firewall.
  5. 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!"
Create CumulusClips root folder

Code: Select all

mkdir -p /var/www/cumulusclips
chown www-data:root /var/www/cumulusclips
Create Apache Config for CumulusClips

Code: Select all

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

Code: Select all

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

Code: Select all

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

Code: Select all

systemctl reload apache2

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

CumulusClips Prerequisites

Post: # 658Post LHammonds
Wed May 09, 2018 4:30 pm

Install CumulusClips Prerequisites
  1. At the server console, type the following to install the additional modules and restart the web service:

    Code: Select all

    apt -y install php7.2-curl php7.2-xml php7.2-gd php7.2-mysql php7.2-zip php7.2-intl
    systemctl reload apache2
  2. To make sure the modules are loaded, we will create a phpinfo file:

    Code: Select all

    touch /var/www/cumulusclips/phpinfo.php
    chown www-data:www-data /var/www/cumulusclips/phpinfo.php
    chmod 0644 /var/www/cumulusclips/phpinfo.php
    printf "<?php\n" >> /var/www/cumulusclips/phpinfo.php
    printf "phpinfo();\n" >> /var/www/cumulusclips/phpinfo.php
    printf "?>\n" >> /var/www/cumulusclips/phpinfo.php
  3. Now open a web browser and go to http://video.mydomain.com/phpinfo.php and verify that all the CumulusClips required modules are present.
  4. When satisfied everything is good, delete the test file:

    Code: Select all

    rm /var/www/cumulusclips/phpinfo.php
Configure Apache to meet requirements

Enable Mod_ReWrite

Code: Select all

a2enmod rewrite
systemctl restart apache2
Configure PHP to meet requirements

Edit the PHP configuration and modify the following variables:

Code: Select all

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

Code: Select all

short_open_tag = Off
To:

Code: Select all

short_open_tag = On
Change:

Code: Select all

upload_max_filesize = 2M
To:

Code: Select all

upload_max_filesize = 2048M
Change:

Code: Select all

post_max_size = 8M
To:

Code: Select all

post_max_size = 2054M
Change:

Code: Select all

max_execution_time = 30
To:

Code: Select all

max_execution_time = 3000
Add:

Code: Select all

safe_mode = Off
register_globals = Off
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

systemctl restart apache2

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

Install CumulusClips

Post: # 659Post LHammonds
Wed May 09, 2018 4:51 pm

Install CumulusClips
  1. Download CumulusClips, extract the archive and set permissions:

    Code: Select all

    cd /tmp
    wget http://cumulusclips.org/cumulusclips.tar.gz
    tar -xzvf /tmp/cumulusclips.tar.gz
    chown www-data:root --recursive /tmp/cumulusclips
    find /tmp/cumulusclips/. -type d -exec chmod 755 '{}' \+
    find /tmp/cumulusclips/. -type f -exec chmod 644 '{}' \+
    rm /tmp/cumulusclips.tar.gz
    mv /tmp/cumulusclips/* /var/www/cumulusclips/.
    
  2. Access the installation wizard via a web browser. http://video.mydomain.com/cc-install/
  3. Follow the prompts to install it.
  4. Welcome - Click the "Continue" button
  5. Database Setup - Set the following and "Submit Database Login" button:
    • Database host: srv-database
    • Database port: 3306
    • Database name: cumulusclips
    • Database user: cumulususer
    • Database password: cumulususerpass
    • Table prefix:
  6. Site Details - Set the following and "Submit Site Details" button:
  7. All done. Click "View My Site" button.

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

Customize

Post: # 660Post LHammonds
Thu May 10, 2018 8:14 am

Logo Locations

CumulusClips cloud-like logo displayed on main screen. (264x107)

Code: Select all

/var/www/cumulusclips/cc-content/themes/default/images/logo.png
Small greyscale version of the main screen logo. (144x58)

Code: Select all

/var/www/cumulusclips/cc-content/themes/default/images/logo_footer.png
"CumulusClips Admin Panel" text on top of admin panel page. (374x27)

Code: Select all

/var/www/cumulusclips/cc-admin/images/admin-logo.png
Small greyscale version of the main screen logo. (79x32)

Code: Select all

/var/www/cumulusclips/cc-admin/images/footer-logo.png
"CumulusClips Mobile" text for mobile theme. (198x19)

Code: Select all

/var/www/cumulusclips/cc-content/themes/mobile-default/images/logo.png
Main screen slide show removal

In version 2.5.3, there is an example slideshow on the main page that you cannot remove via settings. This has to be done by modifying the code.

Code: Select all

vi /var/www/cumulusclips/cc-content/themes/default/index.phtml
Find and remove the following on lines 13 thru 78:

Code: Select all

<!-- BEGIN SLIDESHOW -->
<div id="slideshow">

    <!--
    Slides 1-3 are for demonstration purposes only. They are merely for
    displaying your ability to add custom slides. You may remove them as you
    wish.
    -->

    <!-- BEGIN SLIDE 1 -->
    <div>
        <img width="600" height="287" src="<?=$this->options->themeUrl?>/images/slide1.jpg" />
        <div class="slide-text">
            <div>
                <p>CumulusClips - Free Video CMS. Start your own video sharing website with CumulusClips video sharing script. You can build a YouTube clone where users can upload videos, rate videos, comment on videos, and much more.</p>
                <a class="button" href="http://cumulusclips.org/">Learn More</a>
            </div>
        </div>
    </div>
    <!-- END SLIDE 1 -->

    <!-- BEGIN SLIDE 2 -->
    <div>
        <img width="600" height="287" src="<?=$this->options->themeUrl?>/images/slide2.jpg" />
        <div class="slide-text">
            <div>
                <p>CumulusClips Documentation - Guides on managing, modifying, and general information regarding the CumulusClips Video CMS.</p>
                <a class="button" href="http://cumulusclips.org/docs/">Documentation</a>
            </div>
        </div>
    </div>
    <!-- END SLIDE 2 -->
    <!-- BEGIN SLIDE 3 -->
    <div>
        <img width="600" height="287" src="<?=$this->options->themeUrl?>/images/slide3.jpg" />
        <div class="slide-text">
            <div>
                <p>CumulusClips Support Forums - Ask questions, share ideas and solutions, and get connected with the CumulusClips community.</p>
                <a class="button" href="http://cumulusclips.org/forums/">Visit Forums</a>
            </div>
        </div>
    </div>
    <!-- END SLIDE 3 -->
    <!-- BEGIN FEATURED VIDEO SLIDES -->
    <?php foreach ($featured_videos as $featuredVideo): ?>
        <div>
            <img width="600" height="287" src="<?=$config->thumbUrl?>/<?=$featuredVideo->filename?>.jpg" />
            <div class="slide-text">
                <div>
                    <p class="large"><u><?=Language::getText('featured')?>:</u> <?=$featuredVideo->title?></p>
                    <p><?=Functions::cutOff($featuredVideo->description, 80)?></p>
                    <a class="button" href="<?=$this->getService('Video')->getUrl($featuredVideo)?>/">Watch Now</a>

                </div>
            </div>
        </div>
    <?php endforeach; ?>
    <!-- END FEATURED VIDEO SLIDES -->
</div>
<!-- END SLIDESHOW -->

<!-- SLIDESHOW SLIDE LINKS -->
<div id="slideshow_nav"></div>
Custom Title / Description

Code: Select all

vi cc-content/languages/en_US.xml

Code: Select all

<meta.index.title>TEXT HERE</meta.index.title>
<meta.index.keywords>TEXT HERE</meta.index.keywords>
<meta.index.description>TEXT HERE</meta.index.description>
Custom Footer

Code: Select all

vi cc-content/themes/THEME-NAME/blocks/footer.phtml
Custom Welcome Page

Code: Select all

vi cc-content/themes/THEME-NAME/index.phtml
Install More Themes
  1. Download and extract the Theme Add-ons and set correct permissions:

    Code: Select all

    cd /var/www/cumulusclips/cc-content/themes
    wget http://cumulusclips.org/resources/slate.zip
    wget http://cumulusclips.org/resources/newsroom.zip
    wget http://cumulusclips.org/resources/corporate.zip
    wget http://cumulusclips.org/resources/barren.zip
    unzip slate.zip
    unzip newsroom.zip
    unzip corporate.zip
    unzip barren.zip
    rm *.zip
    chown --recursive www-data:www-data /var/www/cumulusclips/cc-content/themes
    
  2. Login to the site, go into Admin Panel, Appearance, Themes. Click the "Activate" link on the desired theme.

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

Email Support Using Mail Relay Server

Post: # 661Post LHammonds
Thu May 10, 2018 12:03 pm

Email Overview

CumulusClips utilizes PHP's built-in "mail" function which means we need to configure php.ini to use a mail client that will send email.

It seems like an industry standard to use "sendmail" based on all the tutorials out there but sendmail is a mail server itself which can receive mail which is overkill for our purposes. We only want to send outbound to an actual mail server...not turn this web server into a mail server.

For this reason, we will install a lightweight mail client called ssmtp that will allow sending outbound-only mail messages.

We will then modify PHP to utilize this mail client and then finally modify CumulusClips (or any other web app from this point forward) to send mail.

Mail Server Information
There are many scenarios surrounding how one might have a mail service.

For this tutorial, let's assume you have a mail server that you configured to act as a relay server for this specific server...which means you can send email to that server to be delivered locally or routed to another mail server if the destination is not local. Let's assume this relay server will not require login credentials but does require the FROM address to be specific. Let's also assume it does not require encryption.

Here is this examples relay server information:

Mail Relay Server Address: 192.168.107.25
Mail Relay Server Port: 25
Use TLS? No
Required From Address: webmaster@mydomain.com

Install and Configure SSMTP

Install the mail client:

Code: Select all

apt -y install ssmtp
Backup the original configuration files:

Code: Select all

cp /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.bak
cp /etc/ssmtp/revaliases /etc/ssmtp/revaliases.bak
Edit the main configuration file:

Code: Select all

vi /etc/ssmtp/ssmtp.conf
Set the following:
root= mailhub=192.168.107.25:25 hostname=localhost
Edit the reverse alias file:

Code: Select all

vi /etc/ssmtp/revaliases
Add the alias for "root" to be that of your desired "FROM" address.
root:webmaster@mydomain.com
Modify PHP.ini for Apache

Edit the Apache PHP.ini

Code: Select all

vi /etc/php/7.2/apache2/php.ini
Set the sendmail_path variable to point to the default sendmail path (which is a link to ssmtp)

Code: Select all

sendmail_path = /usr/sbin/sendmail -t
Or set the sendmail_path variable to point to ssmtp directly:

Code: Select all

sendmail_path = /usr/sbin/ssmtp -t
Modify PHP.ini for Command-Line

While we are making the mail command work for PHP inside Apache, we might as well do the same for the command-line interface.

Make the same changes above to this file as well.

Code: Select all

vi /etc/php/7.2/cli/php.ini
CumulusClips Email Settings

If you go into the Admin Panel -> Settings -> Email, you will see options for specifying the FROM address and SMTP authentication.

Add the webmaster@mydomain.com and leave the SMTP authentication disabled. Save the settings and the next time you create a member, it will email them a message that looks like this:

Code: Select all

From: Webmaster
Sent: Thursday, May 10, 2018 12:44 PM
To: LHammonds
Subject: New Member Registered
 
A new member has registered.

=======================================================
Username: LHammonds
Profile URL: http://video.mydomain.com/members/LHammonds/
=======================================================
Send Test Email

Create a temporary PHP page to send an email message.

Code: Select all

touch /var/www/cumulusclips/mail.php
chown www-data:root /var/www/cumulusclips/mail.php
chmod 644 /var/www/cumulusclips/mail.php
vi /var/www/cumulusclips/mail.php

Code: Select all

<?php
$to = "lhammonds@mydomain.com";
$subject = "My Test Subject";
$body = "Testing 1-2-3";
mail($to,$subject,$body);
?>
Test from the command-line:

Code: Select all

php /var/www/cumulusclips/mail.php
Now test from a browser:

Code: Select all

http://video.mydomain.com/mail.php
If you have any issues, check /var/log/syslog for messages related to sSMTP

Remove the temporary PHP page:

Code: Select all

rm /var/www/cumulusclips/mail.php

Post Reply