FBB Step by step setup video cache di ubuntu

Sebelumnya di Ubuntu server kita harus sudah terinstall LAMP Server dan Proxy Server. Kemudian kita download source code dari Youtube Cache di http://cachevideos.com/download
wget http://cachevideos.com/sites/default/files/pub/youtube_cache/youtube_cac…
Jangan lupa mengecek dependensi atau ketergantungan dari software yang antara lain;
1. Squid >= versi 2.6 keatas
2. Python >= versi 2.4 keatas
3. Python-urlgrabber (modul urlgrabber untuk python)
4. Python-iniparse (modul iniparse untuk python, bisa didownload di http://code.google.com/p/iniparse/)
5. Web Server (Apache2 atau Lighttpd)
Sebelum menginstall Youtube Cache kita harus mengeset python-iniparse dahulu, setelah kita download dan ekstrak, kemudian ketikkan;
# python setup.py install
dan setelah instalasi python-iniparse selesai, barulah kita mengekstrak Youtube-Cache. Setelah diekstrak, masuklah ke direktori hasil ekstraksi dan buka file setup.py dengan teks editor seperti vi atau nano;
#nano /home/dendy/youtube_cache-1.2/setup.py
kemudian cari baris dibawah dan edit sedemikian rupa;
squid_user = ‘proxy’
squid_group = ‘proxy’
buat folder dummy untuk apache ;
apache_conf_dir = ‘/etc/apache2/conf.d/’
simpan dan tutup, kemudian ketikkan perintah instalasi:
#python setup.py install
Setelah selesai, editlah file konfigurasi Squid
#nano /etc/squid/squid.conf
Salin baris dibawah berikut ini, dan tambahkan di bagian paling bawah dari file konfigurasi squid anda;
url_rewrite_program /usr/bin/python /etc/squid/youtube_cache/youtube_cache.py
url_rewrite_children 10
acl youtube_query url_regex -i \.youtube\.com\/get_video
acl youtube_query url_regex -i \.cache[a-z0-9]?[a-z0-9]?[a-z0-9]?\.googlevideo\.com\/videoplayback
acl youtube_query url_regex -i \.cache[a-z0-9]?[a-z0-9]?[a-z0-9]?\.googlevideo\.com\/get_video
acl youtube_deny url_regex -i http:\/\/[a-z][a-z]\.youtube\.com
#acl metacafe_query dstdomain v.mccont.com
#acl dailymotion_query url_regex -i proxy\-[0-9][0-9]\.dailymotion\.com\/
acl google_query dstdomain vp.video.google.com
#acl redtube_query dstdomain dl.redtube.com
#acl xtube_query url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv
#acl vimeo_query url_regex -i bitcast\.vimeo\.com\/vimeo\/videos\/
#acl wrzuta_query url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]?
url_rewrite_access deny youtube_deny
url_rewrite_access allow youtube_query
#url_rewrite_access allow metacafe_query
#url_rewrite_access allow dailymotion_query
url_rewrite_access allow google_query
#url_rewrite_access allow redtube_query
#url_rewrite_access allow xtube_query
#url_rewrite_access allow vimeo_query
#url_rewrite_access allow wrzuta_query
redirector_bypass on
(untuk beberapa situs seperti redtube saya kasih tanda”#” karena saya gak ingin nyimpen bokep)
kemudian edit file konfigurasi youtube-cache
#nano /etc/youtube_cache.conf
Ganti base_dir ke /var/www/video_cache
PENTING: rubahlah cache_host = IPADDRESS dari PROXY anda
contoh; cache_host = 192.168.3.2
kemudian salin lokasi cache video ke web server;
#cp -r /var/spool/squid/video_cache /var/www/
pastikan anda dapat mengakses direktori ini melalui http://localhost/video_cache jika tidak maka file video tidak akan tersimpan.
restart squid dan apache
#/etc/init.d/squid restart
#/etc/init.d/apache2 restart
Jika anda menggunakan proxy manual, arahkan browser client ke IP Address server, jika menggunakan transparent proxy maka anda dapat langsung menggunakannya tanpa harus mengeset browser.
Untuk melihat proses caching video streaming, ketik perintah berikut;
#tail -f /var/log/squid/youtube_cache.log
Jika berhasil, maka setelah video di”caching” maka yang tertulis adalah sebagi berikut;
DOWNLOAD YOUTUBE 10167389 Video was downloaded and cached.
CACHE_SERVE YOUTUBE Video was served from cache.
sumber :http://mattnuxlog.wordpress.com/2010/10/20/step-by-step-setup-video-cache-di-ubuntu/

Tidak ada komentar:

Posting Komentar