Beranda > Browser, Internet, Komputer, Koneksi Jaringan, OS Linux, Proxy, Sharing Internet, Squid, Teknologi, Ubuntu > Cara installasi videocache di Ubuntu 11.10

Cara installasi videocache di Ubuntu 11.10

Pertama install Python

sudo apt-get update

sudo apt-get install python-iniparse

apt-get install python-urlgrabber

cd /usr/src

wget http://www.razametal.org/conf/videocache/videocache-1.9.2.tar.gz

tar zxvf videocache-1.9.2.tar.gz

cd videocache-1.9.2

sudo nano setup.py

ubah beberapa file berikut sesuai user yang menjalankan squid dan webserver yang terinstall

squid_user = ‘proxy’
squid_group = ‘proxy’
apache_conf_dir = ‘/etc/apache2/conf.d/’

python setup.py install

sudo nano /etc/videocache.conf

Edit beberapa bagian berikut ini :

cache_host = 127.0.0.1 < ganti dengan ip squid
proxy = http://127.0.0.1:3128/ < ganti dengan ip squid dan port squid
base_dir = /var/www/videocache/

sisipkan code tambahkan di bagian paling bawah dari file konfigurasi squid.conf

# –START videocache config for squid
url_rewrite_program /usr/bin/python /usr/share/videocache/videocache.py
url_rewrite_children 5
acl videocache_allow_url url_regex -i \.youtube\.com\/get_video\?
acl videocache_allow_url url_regex -i \.googlevideo\.com\/videoplayback \.googlevideo\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.com\/videoplayback \.google\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.[a-z][a-z]\/videoplayback \.google\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i proxy[a-z0-9\-][a-z0-9][a-z0-9][a-z0-9]?\.dailymotion\.com\/
acl videocache_allow_url url_regex -i vid\.akm\.dailymotion\.com\/
#acl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv
acl videocache_allow_url url_regex -i bitcast\.vimeo\.com\/vimeo\/videos\/
acl videocache_allow_url url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]?
#acl videocache_allow_url url_regex -i \.files\.youporn\.com\/(.*)\/flv\/
acl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv
#acl videocache_allow_url url_regex -i media[a-z0-9]?[a-z0-9]?[a-z0-9]?\.tube8\.com\/
acl videocache_allow_url url_regex -i \.mais\.uol\.com\.br\/(.*)\.flv
acl videocache_allow_url url_regex -i \.video[a-z0-9]?[a-z0-9]?\.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram)
acl videocache_allow_url url_regex -i video\.break\.com\/(.*)\.(flv|mp4)
acl videocache_allow_dom dstdomain v.mccont.com dl.redtube.com .cdn.dailymotion.com
acl videocache_deny_url url_regex -i http:\/\/[a-z][a-z]\.youtube\.com http:\/\/www\.youtube\.com
url_rewrite_access deny videocache_deny_url
url_rewrite_access allow videocache_allow_url
url_rewrite_access allow videocache_allow_dom
redirector_bypass on
# –END– videocache config for squid

*Ada yang dikasih tanda ‘#’ karna proxy ane gak mau nyimpen situs tsb ^_^, maklum kode diatas hasil copas gan… hehee

Simpan dan restart squid dan apache2

Sudo /etc/squid/squid restart

Sudo /etc/squid/apache2 restart

Restart proxy ubuntu

Sudo reboot –h now

kemudian salin lokasi cache video ke web server;

#cp -r /var/spool/squid/ /var/www/

pastikan anda dapat mengakses direktori ini melalui http://localhost/videocache jika tidak maka file video tidak akan tersimpan.

Pindahkan videocache.log

Rm /var/log/videocache/videocache.log /var/log/squid/videocache.log

Untuk melihat proses caching video streaming, ketik perintah berikut;

#tail -f /var/log/squid/videocache.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.

  1. edi
    Mei 4, 2012 pukul 8:12 am

    videocache.log , ini file nya di mana yah, aku instal ko ga ada , ty

  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: