Posts Tagged ‘ cPanel

How to install ClipBucket requirements on RedHat Enterprise 5 Server with cPanel

Hey folks!

Since I have received tons of messages about what hosting provider I recommend to run ClipBucket with FFMPEG I have decided to share with you this great company where I moved all my websites to, they are Linode. They offer GREAT SERVICE & SUPPORT (They answered my ticket to add an additional IP to my VPS in less than 5 minutes!) and also they have pretty cheap rates starting at $19.95 for a 512Mb Linux VPS with 16Gb of RAM. For more info click the image below:

Linode VPS for FFMPEG and ClipBucket (YouTube clone script)


Last update: 06/08/2010

Due to the high amount of messages and questions on this post, we at AM Technology & Systems thought that will be great to offer this installation or troubleshoot FFMPEG issues as one of our services, so…

Get this software installed by Experts! Check AM Technology & Systems


The other day I had to install some software for a customer to run the Clip Bucket (http://www.clip-bucket.com) script on their server. It was a lot of steps so I documented it and now I am sharing with you so you don’t have to research like I did to met all the requirements for Clip Bucket because in their website they don’t have a guide showing how to install it. Let’s get our hands dirty!

Install Development Tools:

yum groupinstall ‘Development Tools’

Install RPMForge Repository:

For 32 Bits installations: rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm

For 64 Bits installations: rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm

Install yasm package:

yum install yasm

Install SVN (subversion) package:

yum install subversion

Install OpenCore-AMR:

cd /usr/src
wget http://sourceforge.net/projects/opencore-amr/files/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz/download
tar -zxvf opencore-amr-0.1.2.tar.gz
cd opencore-amr-0.1.2
./configure
make
make install

Install Lame (libmp3lame):

Note that the command has –with (It is double -)

cd /usr/src
wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz/download
tar -zxvf lame-3.98.4.tar.gz
cd lame-3.98.4
./configure –with-vorbis
make
make install

Install Ogg codec:

cd /usr/src
wget http://svn.xiph.org/releases/ogg/libogg-1.2.0.tar.gz
tar -zxvf libogg-1.2.0.tar.gz
cd libogg-1.2.0
./configure
make
make install

Refresh Libraries installed in the system:

ldconfig -v

Install Vorbis:

cd /usr/src
svn checkout -r 17000 http://svn.xiph.org/trunk/vorbis/ vorbis
cd vorbis
./autogen.sh
make
make install

Install XVid codec:

cd /usr/src
wget http://downloads.xvid.org/downloads/xvidcore-1.2.2.tar.gz
tar -zxvf xvidcore-1.2.2.tar.gz
cd xvidcore
cd build/generic
./configure
make
make install

Install x264 codec:

Note that the command has –enable-shared (It is double -)

cd /usr/src
wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20101101-2245.tar.bz2
tar -xvjf x264-snapshot-20101101-2245.tar.bz2
cd x264-snapshot-20101101-2245
./configure –enable-shared
make
make install

Install FAAD2:

cd /usr/src
wget http://sourceforge.net/projects/faac/files/faad2-src/faad2-2.7/faad2-2.7.tar.gz/download
tar -zxvf faad2-2.7.tar.gz
cd faad2-2.7
./configure
make
make install

Install FAAC:

cd /usr/src
wget http://sourceforge.net/projects/faac/files/faac-src/faac-1.28/faac-1.28.tar.bz2/download
tar -xvjf faac-1.28.tar.bz2
cd faac-1.28
./configure
make
make install

Install FFMPEG:

Note that the command has –enable…. (It is double -)

cd /usr/src
svn checkout -r 25620 svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg

./configure –prefix=/usr/local –enable-pthreads –enable-pic –enable-gpl –enable-version3 –enable-libmp3lame –enable-nonfree –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libvorbis –disable-mmx –enable-shared –enable-libxvid –enable-libx264 –enable-libfaac

make
make install

Note: If you get an error like this when running the ./configure command:

Unable to create and execute files in /tmp.  Set the TMPDIR environment
variable to another directory and make sure that it is not mounted noexec.
Sanity test failed.

Then you will have to create a directory for example /usr/src/tmp and set the TMPDIR environment variable doing export TMPDIR=/usr/src/tmp and try again.

Configure LD to add the path where FFMPEG is installed:

echo “/usr/local/lib” > /etc/ld.so.conf.d/ffmpeg.conf

Refresh the LD cache: ldconfig -v

Install MP4Box (gpac):

cd /usr/src
wget http://sourceforge.net/projects/gpac/files/GPAC%20extra%20libs/GPAC%20extra%20libs%200.4.5/gpac_extra_libs-0.4.5.tar.gz/download
tar -zxvf gpac_extra_libs-0.4.5.tar.gz
wget http://sourceforge.net/projects/gpac/files/GPAC/GPAC%200.4.5/gpac-0.4.5.tar.gz/download
tar -zxvf gpac-0.4.5.tar.gz
cd gpac_extra_libs
cp -R * ../gpac/extra_lib
cd ../gpac
chmod +x configure
./configure –use-js=no
make lib
make apps
make install-lib
make install
cp bin/gcc/libgpac.so /usr/lib

Configure LD to add the path where gpac is installed:

echo “/usr/lib” > /etc/ld.so.conf.d/gpac.conf

Refresh the LD cache: ldconfig -v

Install Ruby (Needed for FLVTool2):

cd /usr/src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p376.tar.gz
tar -zxvf ruby-1.9.1-p376.tar.gz
cd ruby-1.9.1-p376
ls
./configure
make
make  install

Install FLVTool2:

cd /usr/src
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
tar -zxvf flvtool2-1.0.6.tgz
cd flvtool2-1.0.6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

And that should be all! After you install the above software remember to change the paths for all in the Website Configuration settings in your ClipBucket website.

If you followed all the guide the correct paths of the software should be like the ones in the images which are:

FFMPEG: /usr/local/bin/ffmpeg

PHP: /usr/bin/php

FLVTool2: /usr/local/bin/flvtool2

MP4BOX: /usr/local/bin/MP4Box

Here is a screenshot with all the required software up & running on the server:


Prior Updates:

Last update: 02/08/2010

I have made some corrections and adds to the howto, for example running ldconfig -v in some places to refresh libraries in the system, upgrading FFMPEG version to 22733 because as Arandas said the old version break swscale lib. I have found some issues with the ClipBucket not detecting libfaac or libtheora with the version 22733 but it is enabled and working in FFMPEG, so have that in mind when you do the module check.


Last update: 23/07/2010

I have fixed a typo in the FAAC download link, thanks to Arandas comment


Last update: 17/06/2010

I have changed the version of FFMPEG (r22608) after some issues with last FFMPEG trunk versions with MP4Box(gpac). Also I have changed some links to make them easier to copy and paste.

Globally Enable SpamAssassin and SpamBox in cPanel

Hi folks,

In this quick post I want to share with you a great script to easily enable SpamAssassin and SpamBox for all the accounts in your cPanel server. I was surprised that this option is not available at cPanel so I started to Google around and found this handy script:

#!/bin/bash
cd /home
for user in `ls /var/cpanel/users`
do
test ! -d $user && continue
touch  $user/.spamassassinenable $user/.spamassassinboxenable
chown $user:$user  $user/.spamassassinenable $user/.spamassassinboxenable
echo $user complete
done

All credits goes to brianoz user of cPanel forums. (I just changed the chown line to include the : instead of the .)

If you want to check the thread in that forum you can check this link: http://forums.cpanel.net/f5/spamassassin-global-enable-anyone-57111.html#post284327

I hope it helps you like it did it for me.

Take care!

Installing suPHP on Mediatemple Dedicated-Virtual (dv) server with Plesk 8.6.0 and Virtuozzo

UPDATE: I have included a script to change permissions for all the websites hosted in Plesk in order to make the installation easier

Today I had to install suPHP on a MediaTemple Dedicated-Virtual (dv) server with Plesk.  The main reason why I had to do this was because we were migrating a site from Bluehost hosting services to GoDaddy (And they FAIL, like always). We configured our customer new VPS (Which GoDaddy provisioned in two or three  days, which is VERY SLOW for any VPS hosting company – this normally takes from 5 minutes to 2 hours MAX), but that isn’t the worst point. After we configured the server that came with cPanel (We used cPanel’s EasyApache script) to update PHP + Apache + Installing suPHP + other tweaks, we migrated the website from Bluehost to this GoDaddy server but we were getting a warning on the cPanel install that it was a Trial Version (Our customer bought a license) so our customer contacted GoDaddy Support and they said that we have to re-provision the server since the cPanel license wasn’t applied :/

So we had to move the site over to our server which was running cPanel too (This is really easy using Transfer feature in cPanel) and then re-provisioned the customer server, but since this will take another 48-72 hours our customer decided to rent a VPS in MediaTemple (Which offered Plesk instead of cPanel, I personally prefer cPanel because it allows you to tweak the software running on your server like installing Suhosin, suPHP, upgrading PHP/Apache, etc) so we had to migrate the site AGAIN from our server to MediaTemple Dedicated-Virtual (dv) server.

Finally the site was running in MediaTemple server, the site uses WordPress Bloggin software and since Plesk doesn’t come with suPHP a lot of issues popped up, some of them were:

- Problems with image uploads in the Admin backend
- Problems removing plugins
- Problems when editing customized theme
- Etc

So we needed to install suPHP to mitigate all of this issues without chmodding *.* to 777 WHICH IS A VERY BAD THING (Consider yourself warned!).

But since Plesk doesn’t come with suPHP by default we had to install it from source, so here is the process:

Prerequisites:

- SSH Root Access to your MediaTemple server
- Install Development Tools

In your MediaTemple WebControl you have to click on:

MediaTemple-WebControl

Root Access & Developer Tools
Enable root access and install development tools.

Then after you installed your Development Tools (Will take 5 to 10 minutes) I recommend you to install the Yum Package Manger since MediaTemple Dedicated-Virtual (dv) server doesn’t come with it:

rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm

rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm

Now download the last version of suPHP (Which in this moment is 0.71):

wget http://www.suphp.org/download/suphp-0.7.1.tar.gz

tar -zxvf suphp-0.7.1.tar.gz

cd suphp-0.7.1

./configure --with-apxs=/usr/sbin/apxs --with-php=/usr/bin/php-cgi --with-logfile=/var/log/suphp.log --with-min-uid=30 --with-min-gid=30 --with-apache-user=apache --with-apr=/usr/bin/apr-1-config --with-setid-mode=owner --prefix=/usr --sysconfdir=/etc

make

make install

cd /etc/httpd/conf.d/

Create a new file called suphp.conf with this content:

LoadModule suphp_module modules/mod_suphp.so

<Directory /var/www/vhosts>
php_admin_value engine off
suPHP_Engine On
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php
</Directory>

Now we have to create the configuration file for suPHP located at  /etc/suphp.conf with the following content:

[global]
;Path to logfile
logfile=/var/log/suphp.log

;Loglevel
loglevel=none

;User Apache is running as
webserver_user=apache

;Path all scripts have to be in
docroot=/var/www/vhosts

; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false

;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false

;Send minor error messages to browser
errors_to_browser=false

;PATH environment variable
env_path=/bin:/usr/bin

;Umask to set, specify in octal notation
umask=0022

; Minimum UID
min_uid=30

; Minimum GID
min_gid=30

[handlers]
;Handler for php-scripts
x-httpd-php="php:/usr/bin/php-cgi"
;Handler for CGI-scripts
x-suphp-cgi="execute:!self"

Now we backup the actual Apache configuration:

cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bkp

And now we have to comment the following lines in the file /etc/httpd/conf/httpd.conf (In my file are the last lines):

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Now you have to change the file permissions to 0644 for files and 755 for directories. Let’s go to the website directory:

cd /var/www/vhosts/<DOMAIN>/httpdocs/

Note: <DOMAIN> is the website you want to change permissions to

And now we will execute the following command to change the file and directories permissions, change file ownership and restart the Apache service:

find . -type f -exec chmod 644 {} \;; find . -type d -exec chmod 755 {} \;; find . -exec chown <USER>:psacln {} \;; service httpd restart

Note: <USER> is the system user for the domain

UPDATE:

If you want to do this automatically for all users hosting their website in your server you can run the following script instead of the above long command:

#!/bin/bash

while IFS=':' read -r login pass uid gid uname homedir comment; do

if [[ "$homedir" = **/var/www/vhosts/** ]]; then

if [ -d "$homedir/httpdocs" ]; then

find $homedir/httpdocs -type f -exec chmod 644 {} \;;

find $homedir/httpdocs -type d -exec chmod 755 {} \;;

find $homedir/httpdocs -exec chown $login:psacln {} \;

fi

fi

done < /etc/passwd

service httpd restart

You should check if in your httpdocs directory exists a php.ini file since this will be loaded as your default PHP configuration file so check that this file is correct.

I hope that this guide helps you to run your websites securely in your Plesk server.

Thank you for reading!