Author Topic: [SOLVED] Add Privoxy with HTTP Proxy component ?  (Read 3304 times)

M@XflY

  • Zen Apprentice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
[SOLVED] Add Privoxy with HTTP Proxy component ?
« on: January 02, 2011, 01:12:59 am »
How can you install Privoxy on a server with squid Zentyal ?

I want use Privoxy on my Zentyal server with HTTP Proxy component, I also add on /etc/squid/squid.conf this two line to squid communicates with Privoxy :

Code: [Select]
cache_peer 127.0.0.1 parent 8118 7 no-query
never_direct allow all

But when I start HTTP Proxy module, I have these line :
Code: [Select]
zentyal@server:$ sudo /etc/init.d/ebox squid start
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
 * Restarting Zentyal module: squid                                      [ OK ]

And If I check /etc/squid/squid.conf my two line add missing !!

So Squid can't communicate with Privoxy. I think a bash check squid.conf and erase these add line.

Can I avoid this?

My server : Zentyal Core 2.0.13 and HTTP Proxy (Cache and Content Filter) 2.0.2 with http_port transparent
« Last Edit: January 03, 2011, 11:17:10 pm by M@XflY »

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: Add Privoxy with HTTP Proxy component ?
« Reply #1 on: January 02, 2011, 10:59:30 am »
Hi there,

You must use Zentyal hooks interface to do that. Edit a file called /etc/ebox/hooks/squid.postconf and set the two lines you want likewise the example in the same directory does.

Afterwards, restart the squid module and your changes will be applied.

Best regards and happy new year!
My secret is my silence...

M@XflY

  • Zen Apprentice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Add Privoxy with HTTP Proxy component ?
« Reply #2 on: January 02, 2011, 11:45:21 pm »
OK, thank you I'm going to try that.

I shall say to you if it's ok

Thank you and happy New Year
« Last Edit: January 02, 2011, 11:46:59 pm by M@XflY »

M@XflY

  • Zen Apprentice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Add Privoxy with HTTP Proxy component ?
« Reply #3 on: January 03, 2011, 12:39:54 am »
I have no file: /etc/ebox/hooks/squid.postconf but I have /etc/ebox/80squid.conf
In /etc/ebox/hooks I just have: :
Code: [Select]
firewall.postservice  template.postservice  template.postsetconf  template.preservice  template.presetconf
I have to stop the squid module may add my two lines /etc/ebox/80squid.conf.
and I relaunched the squid module, I thus had that:
Code: [Select]
zentyal@server:~$ sudo /etc/init.d/ebox squid start
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/HTML/Mason/Component/Subcomponent.pm line 34.
 * Restarting Zentyal module: squid                                      [ OK ]


On the other hand in /etc/squid/squid.conf I don't have my two new lines to add!!
I don't thus know if it worked !!

How then I to verify it ?

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: Add Privoxy with HTTP Proxy component ?
« Reply #4 on: January 03, 2011, 09:45:45 am »
Hi there,

I have no file: /etc/ebox/hooks/squid.postconf but I have /etc/ebox/80squid.conf
In /etc/ebox/hooks I just have: :
Code: [Select]
firewall.postservice  template.postservice  template.postsetconf  template.preservice  template.presetconf

Sorry for not being so explicit last time. You must create a file called /etc/ebox/hooks/squid.postsetconf which is a bash script intended to set your custom file lines. Take a look on /etc/ebox/hooks/firewall.postservice script.

It should something similar to:

Code: [Select]
echo "line" >> /etc/squid/squid.conf

Best regards,
My secret is my silence...

M@XflY

  • Zen Apprentice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Add Privoxy with HTTP Proxy component ?
« Reply #5 on: January 03, 2011, 11:11:22 pm »
It's good that works, I followed your advice :

I have to create a bash script /etc/ebox/hooks/squid.postsetconf as this:

Code: [Select]
!/bin/sh
echo "cache_peer 127.0.0.1 parent 8118 7 no-query" >> /etc/squid/squid.conf
echo "never_direct allow all" >> /etc/squid/squid.conf
exit 0

Two new lines indeed are to add to the end of the file /etc/squid/squid.conf.
On the other hand in the file /etc/privoxy/config chapter 4. ACCESS CONTROL AND SECURITY section 4.1. listen-address I replaced this line :
Code: [Select]
listen-address  localhost:8118by
Code: [Select]
listen-address  127.0.0.1:8118
Curiously without this change that doesn't work.

A restart of HTTP PROXY SQUID and Privoxy. All works correctly, Squid and Privoxy indeed communicates between them :)

Thank you very much, thanks to you I'm finally going to be able to an internet navigation which protects the private life

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: [SOLVED] Add Privoxy with HTTP Proxy component ?
« Reply #6 on: January 04, 2011, 04:44:52 pm »
Thanks to you by using Zentyal to do so ;).
My secret is my silence...