Chinaunix首页 | 论坛 | 博客
  • 博客访问: 500062
  • 博文数量: 110
  • 博客积分: 3971
  • 博客等级: 中校
  • 技术积分: 1175
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-20 23:27
文章分类

全部博文(110)

文章存档

2015年(2)

2014年(1)

2013年(1)

2011年(9)

2010年(28)

2009年(12)

2008年(13)

2007年(23)

2006年(21)

我的朋友

分类: WINDOWS

2010-03-18 14:12:54

1. Linux Debian
2. Squid >= 2.6
3. Python >= 2.4
4. Python-urlgrabber
5. Python-iniparse
6. Apache
7. Videocache
 

1. Install python dan python-urlgrabber
#apt-get install python python-urlgrabber
2. Install Python-iniparse
sebelumnya download terlebih dahulu di
#wget
#tar zxvf iniparse-0.2.4.tar.gz
#cd iniparse-0.2.4
#python setup.py install
3. Install videocache
sebelumnya download terlebih dahulu di
#tar zxvf videocache-1.8.tar.gz
#cd videocache-1.8
#nano setup.py
squid_user = ‘proxy’ —–>> sesuaikan dengan user squid anda
squid_group = ‘proxy’ —–>> sesuaikan dengan user squid anda
apache_conf_dir = ‘/etc/apache2/conf.d/’
save dan exit
#python setup.py install
#vim /etc/videocache.conf
cache_host = 10.10.4.1 < ganti dengan ip squid
proxy =/ <<< ganti dengan ip squid dan port squid anda
base_dir = /home/videocache
save dan exit

#nano /etc/squid/squid.conf

#———————–videocahce helper———————————-
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

save dan exit

4. Buat direktori untuk cache video berdasarkan nama website
#mkdir videocache/tmp videocache/youtube videocache/metacafe videocache/dailymotion videocache/google videocache/redtube videocache/xtube videocache/vimeo videocache/wrzuta videocache/youporn videocache/soapbox videocache/tube8 videocache/tvuol videocache/bliptv videocache/break
#chown -R squid:squid videocache
restart semua service yang terkait apache2 dan squid
#/etc/init.d/squid restart
#/etc/ini.d/apache2 restart

 

 

阅读(1086) | 评论(0) | 转发(0) |
0

上一篇:squid-2.6

下一篇:pac

给主人留下些什么吧!~~