Posts tagged server
Install Red5 on Debian
0At least Debian 5 (Lenny) required.
Checkout release:
cat /proc/version
uname -a
cat /etc/issue
cat /etc/debian_version
If system is not in English, enable that:
dpkg-reconfigure locales
export LANG=en_US.UTF-8
Update /etc/enviroment
You may need to reboot.
Update:
apt-get update
Install Subversion:
apt-get -y install subversion
Install tools to build your own Debian packages:
apt-get -y install dpkg-dev debhelper dh-make devscripts fakeroot
Install Java (accept sun license if applies):
apt-get -y install java-package
apt-get -y install sun-java6-jre
apt-get -y install sun-java6-jdk
java -version
Install Apache Ant:
wget http://www.apache.org/dist/ant/binaries/apache-ant-1.8.2-bin.tar.gz
tar zxvf apache-ant-1.8.2-bin.tar.gz
mv apache-ant-1.8.2 /usr/local/ant
export ANT_HOME=/usr/local/ant
/usr/local/ant/bin/ant -version
Download the latest development version of Red5:
svn co http://red5.googlecode.com/svn/java/server/trunk red5-trunk
Run ant to build red5:
cd red5-trunk
/usr/local/ant/bin/ant
Deploy red5:
mkdir /usr/local/red5
cp -R dist/* /usr/local/red5/
cd /usr/local/red5
chmod 755 red5.sh
Deploy your custom apps in/usr/local/red5/webapps .
In example VideoWhisper Red5 RTMP application needed to run VideoWhisper solutions.
Start Red5 in background:
cd /usr/local/red5
./red5.sh >> red5.log &
Verify the correct ports are being bound to:
netstat -ant
You need to restart red5 each time you add webapps to /usr/local/red5/webapps or change configuration.
Close Red5:
cd /usr/local/red5
./red5-shutdown.sh
Or kill Red5 processes:
ps aux | grep red5
kill $process_id
Then start it again:
cd /usr/local/red5
./red5.sh >> red5.log &
Related Posts:
Security Scans for Server and VPS
Here is how to install 2 popular tools for scanning your servers for rootkits, trojans:
RKHunter
http://rkhunter.sourceforge.net/
Install
wget http://downloads.sourceforge.net/project/rkhunter/rkhunter/1.3.8/rkhunter-1.3.8.tar.gz
tar -xvzf rkhunter-1.3.8.tar.gz
cd rkhunter-1.3.8
./installer.sh –install
rkhunter –propupd
Scan
rkhunter –check
Also check resulting log in /var/log/rkhunter.log .
ChkRootkit
http://www.chkrootkit.org/
Install
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
tar xvzf chkrootkit.tar.gz
cd chkrootkit*
make sense
Scan
./chkrootkit
Related Posts:
Benchmark your VPS or Dedicated Server
Have multiple servers or VPS and want to compare performance by running a benchmark as root?
This takes some time.
wget http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
gunzip -dvc UnixBench5.1.3.tgz | tar xvf -
cd UnixBench
make
./Run
Also found an older version on Web Hosting Talk:
wget http://members.dslextreme.com/users/andylee/unixbench-4.1.0-wht.tar.gz
gunzip -dvc unixbench-4.1.0-wht.tar.gz | tar xvf -
cd unixbench-4.1.0-wht-2
make
./Run
Related Posts:
Install Red5 on SUSE Linux
First know your system to know what to install.
Use uname -a to see if you need to download 32 or 64 bits versions.
Get SUSE release: cat /etc/SuSE-release
INSTALL JDK
Install latest JDK from http://java.sun.com/javase/downloads/index.jsp .
Use chmod a+x to make downloaded file executable and execute it.
Make sure latest version is used:
ln -s /usr/java/latest /usr/local/jdk
ln -s /usr/java/latest/jre /usr/local/jre
rm /usr/bin/java
ln -s /usr/java/latest/bin/java /usr/bin/java
export JAVA_HOME=/usr/java/latest/
INSTALL SVN
Get SVN from: http://software.opensuse.org/search?baseproject=ALL&p=1&q=subversion
Install RPMs with: rpm -iv package.rpm
Install any dependencies as required. Search from http://software.opensuse.org/search .
INSTALL ANT
wget http://www.apache.org/dist/ant/binaries/apache-ant-1.8.0-bin.tar.gz
tar zxvf apache-ant-1.8.0-bin.tar.gz
mv apache-ant-1.8.0 /usr/local/ant
Configure
export ANT_HOME=/usr/local/ant
ln -s /usr/local/ant/bin/ant /usr/local/bin/ant
Replace old ant
rm /usr/bin/ant
ln -s /usr/local/ant/bin/ant /usr/bin/ant
Check ant version:
ant –version
INSTALL Red5
Get latest Red5 :
svn co http://red5.googlecode.com/svn/java/server/trunk red5
Build Red5 :
cd red5
ant prepare
ant dist
Move Red5:
cd ..
mv red5 /opt/red5
OPERATE RED5
Start Red5 (when need or on server reboot):
cd /opt/red5/dist
./red5.sh > start.log &
Install/update applications in the /opt/red5/dist/webapps folder . For changes to take effect, Red5 must be restarted:
1. Check if red5 is running:
ps aux | grep red5
2. Go to its folder and shut red5 down:
cd /opt/red5/dist
./red5-shutdown.sh
3. See if it’s still running or not:
ps aux | grep red5
4. Restart it, and also make it output the logs into a file of your choice:
./red5.sh > start.log &
5. Make sure it’s back online:
ps aux | grep red5
Related Posts:
Red5 Linux Server Optimizations and Tools
Some java optimizations to add in red5.sh :
export JAVA_OPTS=”-Xrs -Xms128M -Xmx256M -Dsun.rmi.dgc.client.gcInterval=300000 -Dsun.rmi.dgc.server.gcInterval=360000 -Djava.net.preferIPv4Stack=true -XX:+ExplicitGCInvokesConcurrent -XX:+UseConcMarkSweepGC -Xverify:none”
Assuming red5 was installed in /opt/red5/dist admin will often need to restart it or check if it’s running.
Make sure Red5 restarts: restart.sh
#!/bin/bash
#Restart the process
#First see if running
PID=`ps -eo ‘tty pid args’ | grep ‘red5′ | grep -v grep | grep -v restart | tr -s ‘ ‘ | cut -f2 -d ‘ ‘`
cd /opt/red5/dist
if [ -z "$PID" ]
then
#not running
echo “Red5 was not running at `date`” >> /opt/red5/dist/run-restart.log
else
echo “Red5: $PID”
#shutdown
/opt/red5/dist/red5-shutdown.sh
sleep 6
#make sure
kill $PID >> null
sleep 2
fi
#start
/opt/red5/dist/red5.sh >> /opt/red5/dist/red5.log &
echo “On request restarted Red5 at `date`” >> /opt/red5/dist/run-restart.log
Mare sure Red5 process is running, if not start it: running.sh
#!/bin/bash
#set environment
PID=`ps -eo ‘tty pid args’ | grep ‘red5′ | grep -v grep | grep -v running | tr -s ‘ ‘ | cut -f2 -d ‘ ‘`
if [ -z "$PID" ]
then
#Restart the process
cd /opt/red5/dist
/opt/red5/dist/red5.sh >> /opt/red5/dist/red5.log &
echo “Restarted Red5 at `date`” >> /opt/red5/dist/run-restart.log
else
#do nothing
echo “Red5 is already running with PID=$PID at `date`” >> /opt/red5/dist/run-checked.log
fi
Red5 Services
Red5 Hosting
Red5 installation on VPS & Dedicated Servers (Linux / Windows)
Related Posts:
Install GeoIP PHP Extension
Install GeoIP C API
Change 1.4.6 to downloaded version.
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
tar zxvf GeoIP.tar.gz
cd GeoIP-1.4.6
./configure
make
make check
make install
Install PHP PECL extension
wget http://pecl.php.net/get/geoip
tar zxvf geoip
cd geoip-1.0.7
phpize
./configure
make
make check
make install
Find php.ini
php -i | grep php.ini
Enable extension to load in php.ini:
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
extension=geoip.so
You may need to restart HTTP server (apache) to apply changes.
Download Geo Lite City database
wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
mv GeoLiteCity.dat /usr/local/share/GeoIP/GeoIPCity.dat
For more accurate detection and production projects, buy the full GeoCity database from MaxMind.
Related Posts:
Run Red5 & Wowza Flash Media Servers on Same Linux Server
This post shows how to install Wowza on a server where there is another RTMP server, already installed, i.e. Red5. Run 2 rtmp servers at same time and allow applications to connect on both simultaneously.
Related Posts:
Install ffmpeg mplayer flvtool2 yamdi x264 theora mp3lame vorbis ogg faac
This is a tutorial to enable video sharing support on Centos servers.
This should install ffmpeg, mplayer, mencoder, flvtool2, yamdi, x264, theora, mp3lame, vorbis, ogg, faac, faad2, xvid, mediainfo, mp4box, neroaacenc . These tools will enable on your server:
- video and audio conversion
- thumbnail generation
- FLV meta injection (flvtool2, yamdi)
- extra codecs (x264, theora, mp3lame, vorbis, ogg, faac, faad2, xvid)
This is functional and we update it each time we configure a new server.
Installation is done using the “root” account.
Attention: If you copy and paste commands below, make sure “-” are not converted to “.”. If these get converted, edit “.” back to “-”. Some options use 2 * “-”.
Some prerequisites:
yum install gcc gcc-c++ automake autoconf libtool yasm git subversion
yum install zlib-devel libmad-devel libvorbis-devel libtheora-devel lame-devel faac-devel a52dec-devel xvidcore-devel freetype-devel
yuminstalllibogg zlib-devel libtoolrpm -ivh http://rpm.livna.org/livna-release.rpm
yuminstallyasm
yuminstalllibogg libogg-devel libvorbis libvorbis-devel
The quick way to setup ffmpeg, mplayer, mencoder:
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
or if you have 64bit server
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
yum -y install ffmpeg ffmpeg-devel mplayer mencoder
ffmpeg-libpostproc
Edit the /etc/ld.so.conf file and add the following lines:
/usr/local/lib
/usr/lib
GIT
(required to get X264)
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
cd /usr/local/srcwget http://www.kernel.org/pub/software/scm/git/git-1.6.0.4.tar.gztar -zxvf git-1.6.0.4.tar.gzcd git-1.6.0.4make prefix=/usr/local allmake prefix=/usr/local/ installgit –version
cd /usr/local/src
wget http://www.kernel.org/pub/software/scm/git/git-manpages-1.6.0.4.tar.gz
cd /usr/local/share/man
tar -zxvf /usr/local/src/git-manpages-1.6.0.4.tar.gz
YASM
YASM is a modular assembler, it is required by the x264 package.
cd /usr/local/src/
wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz
tar zfvx yasm-0.7.0.tar.gz
cd yasm-0.7.0
./configure
make && make install
cd ..
cd /usr/local/src/git clone git://git.videolan.org/x264.git
cd /usr/local/src/x264
./configure –enable-shared –prefix=/usr
make && make install
ls -s /usr/local/lib/libx264.so /usr/lib/libx264.so
cd /usr/local/src/wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2tarxjvf essential-20071007.tar.bz2mkdir/usr/local/lib/codecs/mvessential-20071007/ /usr/local/lib/codecs/chmod-R 755 /usr/local/lib/codecs/
Or all codecs:
cd /usr/local/src/wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20100303.tar.bz2
tar xjvf all-20100303.tar.bz2mkdir/usr/local/lib/codecs/mv all-20100303
/usr/local/lib/codecs/
LAME
cd /usr/local/src/
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flame%2Ffiles%2F&ts=1285175656&use_mirror=switch
tar zxvf lame-3.98.4.tar.gz
cd /usr/local/src/lame-3.98.4
./configure
make && make install
OGG
cd /usr/local/src/
wget downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar zxvf libogg-1.1.3.tar.gz
cd /usr/local/src/libogg-1.1.3
./configure –enable-shared && make && make install
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
VORBIS
cd /usr/local/src/
wget downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz
cd /usr/local/src/libvorbis-1.1.2
./configure && make && make install
cd /usr/local/src/wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2tar jxvf libtheora-1.1.1.tar.bz2cd /usr/local/src/libtheora-1.1.1./configure –prefix=/usr--enable-sharedmake && make installls -s /usr/local/lib/libtheora.so /usr/lib/libtheora.so
cd /usr/local/src/wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gztar zxvf faac-1.28.tar.gz
cd /usr/local/src/faac-1.28./configure –prefix=/usr
make && make install
FAAD2
cd /usr/local/src/
wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz
tar zxf faad2-2.6.1.tar.gz
cd faad2
autoreconf -vif
./configure –disable-drm –disable-mpeg4ip
make && make install
cd /usr/local/src/
wget http://openjpeg.googlecode.com/files/openjpeg_v1_3.tar.gz
tarzxvf openjpeg_v1_3.tar.gz
cdOpenJPEG_v1_3make &&makeinstallldconfig
cd /usr/local/src/
wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
tar zxfv xvidcore-1.2.1.tar.gz
cd /usr/local/src/xvidcore/build/generic
./configure--enable-shared
make && make installls -s /usr/local/lib/libxvidcore.so.4.2 /usr/lib/libxvidcore.so.4.2
Before installing ffmpeg, setup some linking for scripts that look in certain locations for codecs:
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52ln -s /usr/lib/libtheora.so.0.3.10 /usr/local/lib/libtheora.so.0.3.10
ln -s /usr/lib/libx264.so.80 /usr/local/lib/libx264.so.80
ln -s /usr/lib/libtheora.so.0.3.10 /usr/local/lib/libtheora.so
ln -s /usr/lib/libx264.so.80 /usr/local/lib/libx264.so
FFMPEG (download latest from SVN)
export TMPDIR=$HOME/tmp
export LD_LIBRARY_PATH=/usr/local/lib/cd /usr/local/src/
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd /usr/local/src/ffmpeg/
./configure --enable-libfaac--enable-shared --enable-memalign-hack --enable-gpl --enable-libtheora --enable-libmp3lame --enable-libopenjpeg --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-avfilter--enable-swscale
make && make installln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg
FFMPEG configure options use 2 x “-”.
MPLAYER
cd /usr/local/src/
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update
cd /usr/local/src/mplayer
./configure && make && make installln -s /usr/local/bin/mencoder /usr/bin/mencoder
ln -s /usr/local/bin/mplayer /usr/bin/mplayer
FLVTOOL2
First install Ruby from WHM.
cd /usr/local/src/
wget rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
tar zxvf flvtool2_1.0.5_rc6.tgz
cd /usr/local/src/flvtool2_1.0.5_rc6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
YAMDI
cd /usr/local/src/
wget http://downloads.sourceforge.net/project/yamdi/yamdi/1.4/yamdi-1.4.tar.gz?use_mirror=ufpr
tar zxf yamdi-1.4.tar.gz
cd yamdi-1.4
gcc yamdi.c -o yamdi -O2 -Wall
mv yamdi /usr/bin/
yamdi -h
INSTALLATION RESULTS
mencoder: /usr/local/bin/mencoder
mplayer: /usr/local/bin/mplayer
yamdi: /usr/bin/yamdi
Add these shortcuts to /usr/bin if you need these there by default:
mencoder to /usr/local/bin/mencoder
mplayer to /usr/local/bin/mplayer
SuPHP fix
With suphp “env -i” is required when executing php scripts.
exec(“env -i /usr/bin/php ” . $cmd. ‘>/dev/null &’);
MediaInfo
http://mediainfo.sourceforge.net/en/Download/CentOS
wget http://downloads.sourceforge.net/zenlib/libzen0-0.4.14-1.i386.CentOS_5.rpm
wget http://downloads.sourceforge.net/zenlib/libzen0-devel-0.4.14-1.i386.CentOS_5.rpm
wget http://downloads.sourceforge.net/mediainfo/libmediainfo0-0.7.32-1.i386.CentOS_5.rpm
wget http://downloads.sourceforge.net/mediainfo/libmediainfo0-devel-0.7.32-1.i386.CentOS_5.rpm
wget http://downloads.sourceforge.net/mediainfo/mediainfo-0.7.32-1.i386.CentOS_5.rpm
rpm -vi libzen0-0.4.14-1.i386.CentOS_5.rpm
rpm -vi libzen0-devel-0.4.14-1.i386.CentOS_5.rpm
rpm -vi libmediainfo0-0.7.32-1.i386.CentOS_5.rpm
rpm -vi libmediainfo0-devel-0.7.32-1.i386.CentOS_5.rpm
rpm -vi mediainfo-0.7.32-1.i386.CentOS_5.rpmln -s /usr/bin/mediainfo /usr/local/bin/mediainfo
MP4Box
yum -y install freetype-devel SDL-devel freeglut-devel
wget -c http://mirror.ffmpeginstaller.com/source/gpac/gpac-full-0.4.5.tar.gz
tar -xzf gpac-full-0.4.5.tar.gz
cd gpac./configure –prefix=/usr/local/cpffmpeg/ –extra-cflags=-I/usr/local/cpffmpeg/include/ –extra-ldflags=-L/usr/local/cpffmpeg/lib –disable-wx –strip
make && make lib && make apps && make install lib && make install
cp bin/gcc/libgpac.so /usr/lib
ln -s /usr/local/cpffmpeg/bin/MP4Box /usr/local/bin/MP4Box
ln -s /usr/local/cpffmpeg/bin/MP4Box /usr/bin/MP4Boxinstall -m644 bin/gcc/libgpac.so /usr/local/lib/libgpac.so
chmod +x /usr/local/lib/libgpac.so
ldconfig
neroAacEnc
wget ftp://ftp6.nero.com/tools/NeroDigitalAudio.zip
unzip NeroDigitalAudio.zip -d nero
cd nero/linux
sudo install -D -m755 neroAacEnc /usr/local/binln -s /usr/local/bin/neroAacEnc /usr/bin/neroAacEnc
uploadprogress
cd /usr/local/src
wget http://pecl.php.net/get/uploadprogress-1.0.0.tgz
tar -zxvf uploadprogress-1.0.0.tgz
cd uploadprogress-1.0.0
phpize
./configure && make && make install
Edit /usr/lib/php.ini and add:
extension = “uploadprogress.so”
ASM is a modular assembler, it is required by the x264 package.
codec:$ wget \ http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz codec:$ tar zfvx yasm-0.7.0.tar.gz codec:$ cd yasm-0.7.0 codec:$ ./configure codec:$ make && make install codec:$ cd ..
Related Posts:
VideoWhisper Video Recorder
The video recorder allows site users to record webcam videos easily from website pages. This can be use on various sites to implement online features like:
+ video sharing, on demand video content
+ video messaging, video email
+ video content on member profiles, video teasers, video questionnaires
+ video comments for online posts and items, video discussions, video forums
Videos are recorded as flv files on the rtmp server and can be played trough the rtmp protocol or by http players as on youtube (if published to a web accessible location).
For more details check the home page of VideoWhisper web based Video Recorder.
Related Posts:
Install latest Red5 on Linux Ubuntu
This post shows how to install latest Red5 from svn trunk on Linux Ubuntu.
For other linux flavors (i.e. Centos) see this comprehensive tutorial Install Red5 and JDK on Centos.

Video Broadcast
Enter Presentation
Enter Conference