Cara Install Phpmotion
Cara Install Phpmotion
Halaman 2 dari 10 Langkah instalasi Dengan tanpa banyak basa basi marilah kita segera melakukan instalasinya, agar lebih semangat mungkin bisa sambil mendengarkan lagu mp3. Berikut adalah langkahlangkah untuk melakukan instalasi phpmotion pada ubuntu server
1. Langkah persiapan
Anda harus terlebih dahulu menginstall ubuntu linux pada komputer atau server anda dan harus terhubung ke internet dan memiliki IP Addres publik sendiri bila ingin bisa diakses dari luar (untuk pointing domain ataupun lewat NAT dan dinamic DNS). Atau bila anda menggunakan servis webhosting anda harus memilih paket privat webhosting dedicated atau VPS atau servis colocation (silahkan hubungi penulis utk hal ini) dengan servis ssh dan console sehingga kita bisa menginstall apapun di server tersebut dan melakukan pointing domain ke server kita. Tetapi untuk bahan eksperiment kita bisa menggunakan komputer lokal yang diakses secara LAN dan bahkan melalui virtual machine pun bisa. (Penulis sendiri menginstall php motion pada Ubuntu Linux 8.04 yang berjalan diatas VMWare 5 pada OS windows XP yang kemudian nantinya OS Image nya dapat didevelop dan dicopy ke mesin sebenarnya dengan mudah)
2. Download phpmotion
download pada website http://www.phpmotion.com http://www.phpmotion.com (anda harus register dulu pada forum agar bisa melakukan download) , pilih yang versi untuk php5, kemudian download an taruh file di folder misalnya: /home/imam/PHPMOTION_PHP5.zip
update dulu apt-sourcenya untuk mendapatkan data software terbaru, pada console XTERM
Halaman 3 dari 10
open_basedir = (kosongkan) upload_max_filesize = 100M post_max_size = 100M max_execution_time = 1500 session.gc_maxlifetime = 14000 safe_mode = off enable_dl = On short_open_tag = on extension_dir = ./ # Start apache dan mysql server /etc/init.d/apache2 start /etc/init.d/mysql start #test koneksi ke mysql dan lihat database yang sudah ada mysql -u root -e show databases seharusnya ada output nama database seperti mysql dan test #test php dan apache cd /var/www/ echo "<?php phpinfo();?>" > info.php ; chmod 755 info.php #test dan browsing ke localhost dengan lynk atau browser , apakah apache dan php sudah jalan. lynx http://localhost/info.php atau browse : http://l192.168.116.3/info.php seharusnya sudah ada output dari browser lynx yang menerangkan tentang php dan modul yang terinstall, periksa hasilnya
Halaman 4 dari 10 http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2 http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpegphp-0.5.0.tbz2 wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2 wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2 wget http://downloads.xiph.org/releases/theora/libtheora-1.0beta3.tar.gz
wget wget wget wget #extract source tool tersebut tar zxvf lame-3.97.tar.gz tar zxvf libogg-1.1.3.tar.gz tar zxvf libvorbis-1.2.0.tar.gz tar zxvf flvtool2-1.0.6.tgz tar jxvf essential-20071007.tar.bz2 tar jxvf ffmpeg-php-0.5.0.tbz2 bzip2 -cd amrnb-7.0.0.2.tar.bz2 | tar xvf bzip2 -cd amrwb-7.0.0.3.tar.bz2 | tar xvf tar zxvf libtheora-1.0beta3.tar.gz
#buat folder untuk instalasi codec mkdir /usr/local/lib/codecs/ #install subversion client apt-get install subversion ruby libcurses-ruby #download ffmpeg dan mplayer tool source svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer cd /usr/local/src/mplayer svn update #pindahkan codec yang sudah di download ke folder code mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/ #chmod agar codec bisa di jalankan chmod -R 755 /usr/local/lib/codecs/ #buat folder temp untuk codec mkdir /usr/local/src/tmp chmod 777 /usr/local/src/tmp
Halaman 5 dari 10
export TMPDIR=/usr/local/src/tmp
Install lame
#installasi lame tool untuk konversi suara mp3 dan bitrate cd /usr/local/src/lame-3.97 ./configure make && make install
Install libogg
cd /usr/local/src/libogg-1.1.3 ./configure && make && make install
Install libvorbis
cd /usr/local/src/libvorbis-1.2.0 ./configure && make && make install
Install flvtool2
cd /usr/local/src/flvtool2-1.0.6/ ruby setup.rb config ruby setup.rb setup ruby setup.rb install
Halaman 6 dari 10
Install ffmpeg
./configure --enable-libmp3lame --enable-libvorbis \ --disable-mmx --enable-shared --enable-libamr-nb \ --enable-libtheora enable-nonfree make make install ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52 ln -s /usr/local/lib/libavformat.so.52 /usr/lib/libavformat.so.52 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/libamrnb.so.2 /usr/lib/libamrnb.so.2
6. Instalasi PHPMOTION
Instalasi berikut adalah bila phpmotion akan diinstall pada subfolder (contohnya http://www.yourdomain.com/motion/ )
#unzip phpmotion cd /var/www mkdir motion ; cd motion unzip /home/imam/PHPMOTION_PHP5.zip rm -rf PHPMOTION_PHP5 mv PHPMOTION_PHP5/PHPMOTION/ . rm -rf mv PHPMOTION_PHP5 chmod -R 777 setup pictures classes temp logs addons uploads chmod -R 755 cgi-bin File berikut harus diedit: pico /var/www/motion/cgi-bin/uu_default_config.pm Pada Bagian :
config_file_name temp_dir upload_dir redirect_url path_to_upload => 'uu_default_config', => $ENV{'DOCUMENT_ROOT'} . '/temp/', => $ENV{'DOCUMENT_ROOT'} . '/uploads/avi/', => '/uploader_finished.php', => '/uploads/avi/',
Ubah menjadi :
config_file_name temp_dir => 'uu_default_config', => $ENV{'DOCUMENT_ROOT'} . '/motion/temp/',
Halaman 7 dari 10
upload_dir redirect_url path_to_upload => $ENV{'DOCUMENT_ROOT'} . '/motion/uploads/avi/', => '/motion/uploader_finished.php', => '/motion/uploads/avi/',
pico /var/www/motion/uploader_conlib.php
Pada bagian:
$path_to_upload_script = '/cgi-bin/uu_upload.pl'; $path_to_ini_status_script = '/cgi-bin/uu_ini_status.pl';
Ubah menjadi:
$path_to_upload_script = '/motion/cgi-bin/uu_upload.pl'; $path_to_ini_status_script = '/motion/cgi-bin/uu_ini_status.pl';
#setup database untuk phpmotion pada console xterm ketikkan mysql -u root -prahasia -e "create database motion;grant all privileges on motion.* to motionuser@localhost identified by 'motionpass' " buka browser anda dan browsing ke alamat local atau komputer anda: misal: http://127.0.0.1/motion/setup/ atau: http://192.168.116.3/motion/setup/
Click tombol next >> 2 kali sampai muncul input konfigurasi database Mysql Host = localhost Database Name = motion Database Username = motionuser Database Password = rahasia
Halaman 8 dari 10 Click next >> lagi , kemudian pada server setting, isikan (misalnya) sebagai berikut
Site name = Imam Video Tutorial Site base url = http://192.168.116.3/motion Date format = d-m-y Path to ffmpeg = /usr/local/bin/ffmpeg Path to flvtool2 = /usr/bin/flvtool2 Path to mencoder = /usr/local/bin/mencoder System email address = iferianto@yahoo.com from system name = Imam Video Tutorial Teams
( sampai step ini, Jangan tekan tombol update dulu ! ) Untuk lebih menyakinkan dan mengetahui path ffmpeg flvtool dan lainnnya ketik pada Xterm ketikan: which ffmpeg ; which flvtool2 ; which mencoder kemudian paste path yang benar dari tool2 tersebut di text box isian setting server diatas >> click tombol [update information], setelah muncul username : admin , password = admin >> kemudian click tombol [Finish Admin login] pada step ini proses instalasi selesai anda bisa login sebagai user= admin dan password admin untuk melakukan manajemen situs. Untuk mengupload video anda harus melakukan registrasi sebagai user dan login dengan user tersebut. Kemudian pada bagian admin tinggal melakukan aproove atas video content yang diupload oleh user tersebut.
Halaman 9 dari 10
Proses selanjutnya untuk mengamankan site, maka anda hapus folder setup pada Xterm rm -rf /var/www/motion/setup >> ahirnya proses instalasi selesai [ Selamat anda sekarang sudah mempunyai situs Youtube Clone milik anda sendiri ! ] Untuk lebih jauh script ini dapat dikembangkan dan ditambahkan fitur2 lain dengan mudah bagi yang sudah mempelajari PHP. Semoga tutorial ini berguna dan bermanfaat bagi anda dan juga rekan developer yang lain. Kurang lebihnya mohon maaf bila ada sedikit kesalahan atau kekurangan instruksi atau kurang jelas. Wassalamualaikum wrbb. Bila ada pertanyaan dan bantuan support silahkan menghubungi: Imam Ferianto YM/Email : iferianto@yahoo.com Blogs : http://iferianto.blogdetik.com , http://iferianto.multiply.com , Contact: http://www.bernas.co.id/redaksi.php Referensi: 1. Install ffmpeg-php pada ubuntu, http://linux.justinhartman.com/FFmpeg,_FFmpegPHP,_Lame,_Libogg,_Libvorbis,_FLVtool2,_Mplayer,_Mencoder,_AMR_Installation 2. Install ffmpeg from source, http://www.ubuntudog.com/?article=18 3. Howto install phpmotion, http://wiki.phpmotion.com/doku.php? id=installation_instructions
Tambahan Tips & Triks : # Bila Saat registrasi user image verification tidak muncul maka anda harus mengedit file
Halaman 10 dari 10 /var/www/motion/image.php , ubah baris 75, ganti : imagettftext($source, $fontsize, 0, 0, 18, $forecolors, "Alpha Romanie G98.ttf", substr($_SESSION['teassocaptcha'], $i, 1)); menjadi : imagettftext($source, $fontsize, 0, 0, 18, $forecolors, "/var/www/motion/Alpha Romanie G98.ttf", substr($_SESSION['teassocaptcha'], $i, 1)); Bila ada error imagerotate() not exists!, maka berarti ada bug pada php5 ubuntu dan perlu dicompile ulang. Langkah compile PHP5 adalah: # Install build tools, debian helpers and fakeroot apt-get install build-essential debhelper fakeroot # source code should reside in /usr/src cd /usr/src # Download PHP source apt-get source php5 # Install all packages required to build PHP5 sudo apt-get build-dep php5 cd php5-5.2.3 # periksa file debian/rules pico debian/rules ubah: --with-gd=shared,/usr --enable-gd-native-ttf jadi : --with-gd=shared --enable-gd-native-ttf # build the php5-* packages dpkg-buildpackage -rfakeroot cd .. # Install the new php5-gd package ls *.deb dpkg -i php5-gd_5.2.3-1ubuntu6.3_i386.deb
Halaman 11 dari 10
Writer Profile
Imam Ferianto are Freelance Programmer, Lecturer, Sysadmin and database admininstrator with background more than 7 year profesional on field. Strong Programming skill from self learning by doing. Imam was born on 21 April 1980 on Purwokerto. Hire by several companies for help and developing their system. Now work as partime staff on Jenderal Sudirman University Purwokerto.