Tag Archives: cpanel

Ffmpeg on Centos 7 and Centos 6

Login to server via SSH

Below steps are for Centos 7

yum -y install epel-release

rpm –import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

rpm -Uvh  http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release0-5.el7.nux.noarch.rpm

yum -y install ffmpeg ffmpeg-devel

 

Below steps are for Centos 6

yum -y install epel-release

rpm –import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

wget https://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-1.el6.nux.noarch.rpm

rpm ivh  nux-dextop-release-0-1.el6.nux.noarch.rpm

yum -y install ffmpeg ffmpeg-devel

 

now we need to install ffmpeg-php to get it working using PHP

yum -y install git
git clone https://github.com/tony2001/ffmpeg-php.git

cd ffmpeg-php
/usr/local/cpanel/3rdparty/php/56/bin/phpize
/opt/cpanel/ea-php56/root/usr/bin/phpize
./configure –with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config

If you want to install on PHP 7 use

/opt/cpanel/ea-php7/root/usr/bin/phpize

 

[Usually before easyapache 4 only phpize would work] now as there are multiple version of PHP there is need to  phpize from above path.

The path would changes based on php version

if you are using PHP 7 path will be /opt/cpanel/ea-php70/root/usr/bin/phpize and

/opt/cpanel/ea-php70/root/usr/bin/php-config

You can find path using find command

[root@server ffmpeg-php]# find / -iname phpize
/opt/cpanel/ea-php55/root/usr/bin/phpize

/opt/cpanel/ea-php56/root/usr/bin/phpize

/opt/cpanel/ea-php70/root/usr/bin/phpize

 

Do not use path ./usr/local/cpanel/3rdparty/bin/phpize

 

Before compiling ffmpegphp

need to make sure all need files are in   /usr/include

When you install ffmpeg and ffmpeg-devel files get stored in  /usr/include/ffmpeg however ffmpeg while compiling looks for files in /usr/include/ so need to copy files to /usr/include using below command

scp -r /usr/include/ffmpeg/* /usr/include/

Now you can go ahead and compile

./configure –with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config

Note [Path /opt/cpanel/ea-php56/root/usr/bin/php-config will changed on which version you are installing ffmpeg]

[root@server ffmpeg-php]# find / -iname php-config

/opt/cpanel/ea-php55/root/usr/bin/php-config
/opt/cpanel/ea-php56/root/usr/bin/php-config
/opt/cpanel/ea-php70/root/usr/bin/php-config

 

now before making make and make install few things need to be modified.

mv /usr/include/libavutil/time.h /usr/include/libavutil/time.h_

now go ahead with make and make install

now   again need to rename the above file

mv  /usr/include/libavutil/time.h_    /usr/include/libavutil/time.h

 

 

ffmpeg modules will be installed in below path

root@server ffmpeg-php]# ls -al /opt/cpanel/ea-php56/root/usr/lib64/php/modules/
total 2712
drwxr-xr-x 2 root root 4096 Dec 7 07:07 .
drwxr-xr-x 4 root root 4096 Feb 22 2017 ..
-rwxr-xr-x 1 root root 32608 Feb 22 2017 bcmath.so
-rwxr-xr-x 1 root root 33792 Feb 22 2017 calendar.so
-rwxr-xr-x 1 root root 15584 Feb 22 2017 ctype.so
-rwxr-xr-x 1 root root 86928 Feb 22 2017 curl.so
-rwxr-xr-x 1 root root 180728 Feb 22 2017 dom.so
-rwxr-xr-x 1 root root 281640 Dec 7 07:07 ffmpeg.so
-rwxr-xr-x 1 root root 57792 Feb 22 2017 ftp.so

 

Now go ahead and add extension=ffmpeg.so to php.ini for the PHP version you need and restart apache

 

 

softacalous Blank Screen cPanel/WHM

While trying to access softacalous from WHM > Plugins >

I was just getting White Screen

The tried disabling and enabling ioncube loader from WHM > Tweak Settings,

However the issue persisted

So I went ahead and reinstalled using below steps

the Softaculous folder here:

 

root@server1 [/usr/local/cpanel]# rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/softaculous

root@server1 [/usr/local/cpanel]# wget -N http://files.softaculous.com/install.sh
–2017-07-25 12:03:36– http://files.softaculous.com/install.sh
Resolving files.softaculous.com… 192.198.80.3
Connecting to files.softaculous.com|192.198.80.3|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 4920 (4.8K) [application/x-sh]
Saving to: `install.sh’

100%[==================================================================================================================================================================>] 4,920 –.-K/s in 0s

2017-07-25 12:03:36 (279 MB/s) – `install.sh’ saved [4920/4920]

root@server1 [/usr/local/cpanel]# chmod 755 install.sh

 

———————————————-
Welcome to Softaculous Apps Installer
———————————————–

ln: creating symbolic link `/usr/local/cpanel/base/frontend/paper_lantern/softaculous/enduser’: File exists
ln: creating symbolic link `/usr/local/cpanel/base/frontend/x3/softaculous/enduser’: File exists
///////////////////////////////
// INSTALLING SOFTACULOUS :
// 1) CONFIGURING universal.php
// 2) FETCHED A LICENSE
// 3) UPDATING Categories
// 4) UPDATING Scripts List
// 5) UPDATING Installed Scripts List
// 6) SETTING A CRON JOB
// 7) DOWNLOADING SCRIPTS
///////////////////////////////

Syntax OK

Now softaculous is working fine

 

Cloudflare with Engintron

We had a issue where domain which is using cloudflare and server had engintron those domains were not working correctly

Engintron does support Cloudflare . There are few custom rules which needs to be setup from

WHM > Plugin > Emgintron  > Edit your custom_rules for Nginx

For domains which have dedicated IP below is the rule which needs to be added

if ($host ~ “oxyxxxxx.com”) {
set $PROXY_DOMAIN_OR_IP “173.1xx.xx5.xxx”;

}

Where you need to set right domain name and  right IP associated with domain

 

If using a shared IP address below is the rule that needs to be added in

Edit yourcustom_rules for Nginx and add below statement

set $PROXY_DOMAIN_OR_IP “XXX.XXX.XXX.XXX”;

Where you need to set shared IP in above example