Posts Tagged ‘ Howtos

How to do a port forward with IPTables on Linux

Hi there!

Long time no post so I am posting this simple howto to show you how to forward a port with IPTables on Linux. This come up because I installed Zenoss on a server and the default port is 8080 and I don’t want to use it so I forwarded the port 80 to the port 8080 on the same machine.

The command to do this is:

iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT \
--to-ports 8080

Cheers!

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!