Clip Bucket 2.8 on Ubuntu 14.04 with NGINX & PHP5-FPM on DigitalOcean VPS

Learn | Teach Open Source Technologies

Clip Bucket 2.8 on Ubuntu 14.04 with NGINX & PHP5-FPM on DigitalOcean VPS

Setup your own Video sharing website like, Youtube.com , Vimeo.com or dailymotion.com using Clip Bucket video hosting / sharing code in 30 minutes.

First of all we need to update our Ubuntu 14.04 with latest updates

apt-get update
apt-get upgrade

To Upgrade NGINX version to 1.8 add latest NGINX packages repository

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
apt-get upgrade nginx
root@www:~# nginx -v
nginx version: nginx/1.8.0
root@www:~# service nginx restart
nginx stop/waiting
nginx start/running, process 2619

The NGINX default file will look like this

root@www:~# vi /etc/nginx/sites-enabled/default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /usr/share/nginx/html;
# Add index.php to the list if you are using PHP
index index.php index.htm index.nginx-debian.html;
server_name ITCBTs.com;
location / {
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
##Add below line to fix the blank screen error
include fastcgi.conf;
}
}
root@www:~#

Now we need to configure MySQL server

To check existing mysql password on digital ocean we need to run below command

cat /etc/motd.tail

Your MySQL root user’s password is xxxxxxxxxxxxx

root@www:~# mysql_secure_installation
Enter current password for root (enter for none):
Change the root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

Now Create Database in MySQL server

root@www:~# mysql -u root -p
Enter password:
mysql> create database clipbucket;
Query OK, 1 row affected (0.00 sec)
mysql> quit;
Bye

Now download latest package of Clip bucket from http://clip-bucket.com/latest.php

root@www:~# cd /opt/
root@www:/opt# mkdir cb
root@www:/opt# cd cb/
root@www:/opt/cb# wget https://sourceforge.net/projects/clipbucket/files/ClipBucket%20v2/clipbucket-2.8.v3354-stable.zip
root@www:/opt/cb# apt-get install zip unzip
root@www:/opt/cb# unzip clipbucket-2.8.v3354-stable.zip
root@www:/opt/cb# cd clipbucket-2.8.v3354-stable/
root@www:/opt/cb/clipbucket-2.8.v3354-stable#

root@www:/opt/cb/clipbucket-2.8.v3354-stable# ls
CHANGELOG do_not_upload LICENSE upload VERSION
root@www:/opt/cb/clipbucket-2.8.v3354-stable# cd upload/
root@www:/opt/cb/clipbucket-2.8.v3354-stable/upload#

 

Now copy Upload folder on /usr/share/nginx/html folder or /var/www/html/ (which ever is your www root folder)

root@www:/opt/cb/clipbucket-2.8.v3354-stable/upload# cp -avr * /usr/share/nginx/html/
root@www:/opt/cb/clipbucket-2.8.v3354-stable/upload# cd /usr/share/nginx/html/
root@www:/usr/share/nginx/html#
root@www:/usr/share/nginx/html# ll
total 352
drwxr-xr-x 14 root root 4096 Nov 21 03:56 ./
drwxr-xr-x 3 root root 4096 Nov 12 14:20 ../
-rw------- 1 root root 757 Feb 27 2015 403.php
-rw------- 1 root root 751 Feb 27 2015 404.php
drwx------ 2 root root 4096 Oct 21 16:21 actions/
-rw------- 1 root root 1015 Oct 7 2013 activation.php
-rw------- 1 root root 1926 Oct 7 2013 add_group_videos.php
drwx------ 5 root root 4096 Oct 22 14:45 admin_area/
-rw------- 1 root root 40843 Oct 21 11:33 ajax.php
drwx------ 2 root root 4096 Oct 21 16:21 api/
drwx------ 4 root root 4096 Oct 21 16:21 cache/
-rw------- 1 root root 279 Oct 7 2013 captcha.php
drwx------ 6 root root 4096 Oct 21 16:21 cb_install/
-rw------- 1 root root 2277 Feb 25 2014 channel.css
-rw------- 1 root root 1977 Mar 27 2014 channels.php
-rw------- 1 root root 1852 Oct 7 2013 collections.php
-rw------- 1 root root 1692 Oct 7 2013 contact.php
-rw------- 1 root root 690 Oct 7 2013 create_group.php
-rw------- 1 root root 602 Oct 7 2013 download_photo.php
-rw------- 1 root root 967 Oct 7 2013 download.php
-rw------- 1 root root 3429 Aug 10 12:14 edit_account.php
-rw------- 1 root root 1326 Sep 25 2014 edit_group.php
-rw------- 1 root root 1084 Oct 7 2013 edit_photo.php
-rw------- 1 root root 1279 Sep 12 2014 edit_video.php
-rw------- 1 root root 3262 Oct 7 2013 favicon.ico
drwx------ 10 root root 4096 Oct 21 16:21 files/
-rw------- 1 root root 1205 Oct 7 2013 forgot.php
-rw------- 1 root root 1588 Sep 23 2014 groups.php
drwx------ 9 root root 4096 Oct 21 16:21 images/
drwx------ 9 root root 4096 Oct 21 16:21 includes/
-rw-r--r-- 1 root root 867 Apr 28 2015 index.html
-rw------- 1 root root 580 Sep 22 2014 index.php
-rw-r--r-- 1 root root 20 Nov 12 14:20 info.php
-rw------- 1 root root 1001 Oct 7 2013 invite_group.php
drwx------ 8 root root 4096 Oct 21 16:21 js/
-rw------- 1 root root 2588 Oct 7 2013 LICENSE
-rw------- 1 root root 143 Oct 7 2013 logout.php
-rw------- 1 root root 5698 May 27 12:37 manage_collections.php
-rw------- 1 root root 1177 Oct 7 2013 manage_contacts.php
-rw------- 1 root root 5762 Jun 2 18:16 manage_groups.php
-rw------- 1 root root 5195 Sep 23 2014 manage_photos.php
-rw------- 1 root root 3613 Dec 10 2014 manage_playlists.php
-rw------- 1 root root 3409 Oct 7 2013 manage_videos.php
-rw------- 1 root root 585 Oct 7 2013 module.php
-rw------- 1 root root 5623 Apr 17 2015 myaccount.php
-rw------- 1 root root 922 Oct 7 2013 opensearch.php
-rw------- 1 root root 1920 Jun 3 17:57 photos.php
-rw------- 1 root root 1354 Oct 7 2013 photo_upload.php
drwx------ 6 root root 4096 Oct 21 16:21 player/
drwx------ 16 root root 4096 Oct 21 16:21 plugins/
-rw------- 1 root root 599 Oct 7 2013 privacy.php
-rw------- 1 root root 3629 Feb 26 2015 private_message.php
-rw------- 1 root root 21 Oct 7 2013 readme
-rw------- 1 root root 3889 Oct 7 2013 rss.php
-rw------- 1 root root 2510 Oct 21 10:52 search_result.php
-rw------- 1 root root 1911 Jun 22 10:34 signup.php
-rw------- 1 root root 2275 Oct 7 2013 sitemap.php
drwx------ 4 root root 4096 Oct 21 16:20 styles/
-rw------- 1 root root 2833 Oct 7 15:12 upload.php
-rw------- 1 root root 2154 Oct 7 2013 user_collections.php
-rw------- 1 root root 1866 Oct 7 2013 user_contacts.php
-rw------- 1 root root 2049 Oct 7 2013 user_photos.php
-rw------- 1 root root 2897 Dec 12 2014 user_videos.php
-rw------- 1 root root 2743 Sep 23 2014 videos.php
-rw------- 1 root root 5887 Jun 3 19:27 view_channel.php
-rw------- 1 root root 2339 Apr 18 2014 view_collection.php
-rw------- 1 root root 828 Oct 7 2013 view_group_members.php
-rw------- 1 root root 2901 Apr 2 2014 view_group.php
-rw------- 1 root root 1106 Oct 7 2013 view_group_videos.php
-rw------- 1 root root 4000 Feb 25 2015 view_item.php
-rw------- 1 root root 753 Oct 7 2013 view_page.php
-rw------- 1 root root 1027 Nov 19 2013 view_playlist.php
-rw------- 1 root root 1352 Jun 2 17:30 view_topic.php
-rw------- 1 root root 2812 Jun 15 18:15 watch_video.php
root@www:/usr/share/nginx/html#

Now change the ownership to user www-data:www-data and permissions to 700

root@www:/usr/share/nginx/html# chown www-data:www-data * -R
root@www:/usr/share/nginx/html# chmod 700 * -R
root@www:/usr/share/nginx/html#

Check your IP & check NGINX service is running

root@www:/usr/share/nginx/html# ifconfig
root@www:~# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 939/sshd 
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1031/mysqld 
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1434/nginx -g daemo
tcp 0 0 107.170.122.147:22 119.160.65.75:28646 ESTABLISHED 1213/0 
tcp6 0 0 :::22 :::* LISTEN 939/sshd 
tcp6 0 0 :::80 :::* LISTEN 1434/nginx -g daemo
root@www:~#

Now open the browser and access your system using it’s IP to install Clip Bucket

cb-5

cb-2

According to above image now we need to Install below packages one by one to complete the installation of Clip Bucket on Ubuntu 14.04

How to install FFmpeg on Ubuntu

Configure repository mc3man on Ubuntu 14.04

root@www:~# sudo add-apt-repository ppa:mc3man/trusty-media
root@www:~# sudo apt-get update
root@www:~# sudo apt-get install ffmpeg gstreamer0.10-ffmpeg
root@www:~# which ffmpeg
/usr/bin/ffmpeg
root@www:~#

Now we will install flvtool2

root@www:~# sudo nano /etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu precise main universe ## add this line at the end
save & exit
root@www:~# apt-get update
root@www:~# sudo apt-get install flvtool2 ruby1.8
root@www:~# which flvtool2 
/usr/bin/flvtool2
root@www:~#

Now will install MP4Box for HD movies

root@www:~# sudo apt-get install gpac
root@www:~# which MP4Box
/usr/bin/MP4Box
root@www:~#

Now we need to install php5-imagick

root@www:~# apt-get install php5-imagick

How to install PHPShield

root@www:~# sudo mkdir /usr/local/sourceguardian
root@www:~# cd /usr/local/sourceguardian/
root@www:/usr/local/sourceguardian# 
root@www:/usr/local/sourceguardian# sudo wget http://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz
root@www:/usr/local/sourceguardian# sudo cp ixed.5.5.lin /etc/php5/mods-available/
root@www:/etc/php5/mods-available# ls
curl.ini gd.ini imagick.ini ixed.5.5.lin json.ini mcrypt.ini mysqli.ini mysql.ini opcache.ini pdo.ini pdo_mysql.ini sourceguardian.ini

root@www:/etc/php5/mods-available# vi sourceguardian.ini
[sourceguardian]
zend_extension=/usr/lib/php5/20090626/ixed.5.5.lin
wq!
root@www:/etc/php5/mods-available# php5enmod sourceguardian
root@www:/etc/php5/mods-available#

Now we need to install mplayer and mediainfo

root@www:/etc/php5/mods-available# apt-get install mplayer
root@www:/etc/php5/mods-available# which mplayer 
/usr/bin/mplayer
root@www:/etc/php5/mods-available#
root@www:/etc/php5/mods-available# apt-get install mediainfo
root@www:/etc/php5/mods-available# which mediainfo 
/usr/bin/mediainfo
root@www:/etc/php5/mods-available#

Now we need to check php5-cli is working

root@www:/etc/php5/mods-available# which php5
root@www:/etc/php5/mods-available# apt-get install php5-cli
root@www:/etc/php5/mods-available# which php5
/usr/bin/php5
root@www:/etc/php5/mods-available#

Now we need to install imagemagick

root@www:/etc/php5/mods-available# apt-get install imagemagick
root@www:/etc/php5/mods-available# which convert
/usr/bin/convert
root@www:/etc/php5/mods-available#

Now we need to check ffprobe is installed

root@www:/etc/php5/mods-available# Which ffprobe
/usr/bin/ffprobe

cb-3
cb-4

cb-8

Now remove cb_install directory from document root

root@www:/etc/php5/mods-available# cd /usr/share/nginx/html/ root@www:/usr/share/nginx/html# rm -rf cb_install/ root@www:/usr/share/nginx/html#

cb-10

 

 

CB-admin

cd-admin

 

Comments are closed.