How To Install Videocache on Pfsense

Biblioteca enigma, sección de libros de consulta general en diferentes formatos
Avatar de Usuario
Enigma
Administrador del Sitio
Administrador del Sitio
Mensajes: 1268
Registrado: 20 Oct 2013, 16:26
Genero: Mujer
Profesion: Webmaster CEO SEO
Ubicacion: Matrix
Navegador: Chrome
Contactar:

How To Install Videocache on Pfsense

Mensaje sin leer por Enigma » 10 Oct 2014, 16:46

How To Install Videocache on Pfsense

This howto covers the videocache installation process on PFsense. We'll proceed assuming that you have squid already installed on PFsense.

Install Python

Use PFsense console or ssh to PFsense and use the following command

Código: Seleccionar todo

# pkg_add -r python
Install the additional needed libraries.

Código: Seleccionar todo

# pkg_add -r py25-bsddb
# pkg_add -r py25-gdbm
# pkg_add -r py25-sqlite3
# pkg_add -r py25-tkinter
Install URLGrabber

Download the latest version of urlgrabber from URLGrabber Download Archive.

Código: Seleccionar todo

# fetch http:/linux.duke.edu/projects/urlgrabber/download/urlgrabber-x.x.x.tar.gz
# tar -xzf urlgrabber-x.x.x.tar.gz
# cd urlgrabber-x.x.x
# python setup.py bdist_rpm
# python setup.py install
Install Iniparse

Download the latest version of python-iniparse from Iniparse Project Website.

Código: Seleccionar todo

# fetch http:/iniparse.googlecode.com/files/iniparse-x.x.x.tar.gz
# tar -xzf iniparse-x.x.x.tar.gz
# cd iniparse-x.x.x
# python setup.py bdist_rpm
# python setup.py install
Install VideoCache

Código: Seleccionar todo

# fetch http:/cachevideos.com/sites/default/files/pub/videocache/videocache-x.x.tar.gz
# tar -xvzf videocache-x.x.tar.gz
# python setup.py install
Configure VideoCache

Using VI edit the /etc/videocache.conf file and edit the following options in the file

proxy
Set the IP address and port on which squid is listening on PFsense.
cache_host
The IP address of PFsense.
Configure Squid

Now add the following lines to /usr/local/pkg/squid.inc . Add the lines after acls.

Código: Seleccionar todo

# --BEGIN-- videocache config for squid
url_rewrite_program /usr/bin/python /usr/share/videocache/videocache.py
url_rewrite_children 10
acl videocache_allow_url url_regex -i \.youtube\.com\/get_video
acl videocache_allow_url url_regex -i \.cache[a-z0-9]?[a-z0-9]?[a-z0-9]?\.googlevideo\.com\/videoplayback
acl videocache_allow_url url_regex -i \.cache[a-z0-9]?[a-z0-9]?[a-z0-9]?\.googlevideo\.com\/get_video
acl videocache_allow_url url_regex -i proxy\-[0-9][0-9]\.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_dom dstdomain v.mccont.com vp.video.google.com dl.redtube.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
Save and restart squid service and you have videocache running on your PFsense. Enjoy caching :)

Note : In PFsense you need disable the https option in the General Setup Settings.

Good Luck.



Volver a “Area Telecomunicaciones - Servidores Windows y Lunux - Redes”