You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by a...@test123.ru on 2010/11/10 14:59:13 UTC

Basic proxy

Hi!

I am installing traffic server as proxy for small network. Both transparent and explicit proxy. Replacement for squid which still officially supports only HTTP/1.0. Compilation under Ubuntu 10.04 is OK, traffic server starts (locally). I cannot figure out how to connect to the explicit proxy. When I set up locahost:8080 as proxy address, I always see the page saying site is unreachable. In traffic server log there is also error message about that.

Is there some tutorial/example of basic proxy configuration? (I read docs and wiki.)

Thanx!


Re: Basic proxy

Posted by Leif Hedstrom <zw...@apache.org>.
On 11/10/2010 09:09 AM, a@test123.ru wrote:
> Thank you very much! CONFIG proxy.config.url_remap.remap_required INT 1 is what the doctor ordered. Trafficserver runs and works. But I cannot see log. I added<LogObject>  into log_xml.config with FileName="full/path/to/log.file". It did not create the file and no errors in traffic.out log. How to turn on logging?

Default out of the box, the squid binary log should be available, 
/usr/local/var/log/trafficserver/squid.blog. This is a 'binary' format, 
so you would need to use "traffic_logcat" to view it, e.g. 
"traffic_logcat -f /usr/local/var/log/trafficserver/squid.blog".

The XML formats you are fiddling with are for making custom log formats. 
It's incredibly flexible, but in most cases, I think one of the 
pre-defined log formats (enabled and disabled in records.config, look 
for "log2" configs) is sufficient.

In all cases, binary logs are faster then text logs. Also, all logs are 
buffered, so there might be a delay until you see something in the logs.

Assuming none of the above works, we'll have to try to debug this. For 
me, squid.blog always works with the default settings.

-- Leif


Re: Basic proxy

Posted by a...@test123.ru.
Thank you very much! CONFIG proxy.config.url_remap.remap_required INT 1 is what the doctor ordered. Trafficserver runs and works. But I cannot see log. I added <LogObject> into log_xml.config with FileName="full/path/to/log.file". It did not create the file and no errors in traffic.out log. How to turn on logging?

On Wed, 10 Nov 2010 10:15:51 -0500, Mark Harrison <ma...@omniti.com> wrote:
> Did you set proxy.config.url_remap.remap_required to 0?
> 
> If not, then trafficserver is in reverse proxy only mode. It is that
> way by default so you don't accidentally end up running an open proxy.
> 
> In records.config, find the following line and change the 1 to a 0:
> 
> CONFIG proxy.config.url_remap.remap_required INT 1
> 
> I found that I needed to set proxy.config.reverse_proxy.enabled to 0
> also in order for transparent proxying to work.
> 
> On Wed, Nov 10, 2010 at 8:59 AM,  <a...@test123.ru> wrote:
>> Hi!
>>
>> I am installing traffic server as proxy for small network. Both transparent and explicit proxy.
>> Replacement for squid which still officially supports only HTTP/1.0. Compilation under Ubuntu
>> 10.04 is OK, traffic server starts (locally). I cannot figure out how to connect to the explicit
>> proxy. When I set up locahost:8080 as proxy address, I always see the page saying site is
>> unreachable. In traffic server log there is also error message about that.
>>
>> Is there some tutorial/example of basic proxy configuration? (I read docs and wiki.)
>>
>> Thanx!
>>
>>


Re: Basic proxy

Posted by a...@test123.ru.
Thanks! Log is here! Explicit proxy works. But transparent not :(
I set
CONFIG proxy.config.http.server_port_attr STRING =
(also tried < and >)

then same redirector as for squid:
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 80 -j REDIRECT --to-ports 8080

I always see "Your browser did not send a hostname as part of the requested url".

If set
CONFIG proxy.config.reverse_proxy.enabled INT 1
The error is "Your requested URL was not found."

It looks like squid style of iptable redirection does not work with ATS. I read examples "Transparent bridging" and "Inline router" but my configuration is not so advanced. I have a gateway with eth0 (internal) and eth1 (external) and ATS running on it. I want transparent caching proxy for outbound HTTP traffic. How should I redirect the port?

On Wed, 10 Nov 2010 12:09:57 -0500, Mark Harrison <ma...@omniti.com> wrote:
> An update on my previous response: for transparent proxying, you don't
> have to disable reverse_proxy, but you do have to enable transparent
> proxying by setting proxy.config.http.server_port_attr. See
> http://people.apache.org/~amc/tiphares/home.html for more information.
> 
> On Wed, Nov 10, 2010 at 10:15 AM, Mark Harrison <ma...@omniti.com> wrote:
>> Did you set proxy.config.url_remap.remap_required to 0?
>>
>> If not, then trafficserver is in reverse proxy only mode. It is that
>> way by default so you don't accidentally end up running an open proxy.
>>
>> In records.config, find the following line and change the 1 to a 0:
>>
>> CONFIG proxy.config.url_remap.remap_required INT 1
>>
>> I found that I needed to set proxy.config.reverse_proxy.enabled to 0
>> also in order for transparent proxying to work.
>>
>> On Wed, Nov 10, 2010 at 8:59 AM,  <a...@test123.ru> wrote:
>>> Hi!
>>>
>>> I am installing traffic server as proxy for small network. Both transparent and explicit proxy.
>>> Replacement for squid which still officially supports only HTTP/1.0. Compilation under Ubuntu
>>> 10.04 is OK, traffic server starts (locally). I cannot figure out how to connect to the explicit
>>> proxy. When I set up locahost:8080 as proxy address, I always see the page saying site is
>>> unreachable. In traffic server log there is also error message about that.
>>>
>>> Is there some tutorial/example of basic proxy configuration? (I read docs and wiki.)
>>>
>>> Thanx!
>>>
>>>
>>


Re: Basic proxy

Posted by Mark Harrison <ma...@omniti.com>.
An update on my previous response: for transparent proxying, you don't
have to disable reverse_proxy, but you do have to enable transparent
proxying by setting proxy.config.http.server_port_attr. See
http://people.apache.org/~amc/tiphares/home.html for more information.

On Wed, Nov 10, 2010 at 10:15 AM, Mark Harrison <ma...@omniti.com> wrote:
> Did you set proxy.config.url_remap.remap_required to 0?
>
> If not, then trafficserver is in reverse proxy only mode. It is that
> way by default so you don't accidentally end up running an open proxy.
>
> In records.config, find the following line and change the 1 to a 0:
>
> CONFIG proxy.config.url_remap.remap_required INT 1
>
> I found that I needed to set proxy.config.reverse_proxy.enabled to 0
> also in order for transparent proxying to work.
>
> On Wed, Nov 10, 2010 at 8:59 AM,  <a...@test123.ru> wrote:
>> Hi!
>>
>> I am installing traffic server as proxy for small network. Both transparent and explicit proxy. Replacement for squid which still officially supports only HTTP/1.0. Compilation under Ubuntu 10.04 is OK, traffic server starts (locally). I cannot figure out how to connect to the explicit proxy. When I set up locahost:8080 as proxy address, I always see the page saying site is unreachable. In traffic server log there is also error message about that.
>>
>> Is there some tutorial/example of basic proxy configuration? (I read docs and wiki.)
>>
>> Thanx!
>>
>>
>

Re: Basic proxy

Posted by Mark Harrison <ma...@omniti.com>.
Did you set proxy.config.url_remap.remap_required to 0?

If not, then trafficserver is in reverse proxy only mode. It is that
way by default so you don't accidentally end up running an open proxy.

In records.config, find the following line and change the 1 to a 0:

CONFIG proxy.config.url_remap.remap_required INT 1

I found that I needed to set proxy.config.reverse_proxy.enabled to 0
also in order for transparent proxying to work.

On Wed, Nov 10, 2010 at 8:59 AM,  <a...@test123.ru> wrote:
> Hi!
>
> I am installing traffic server as proxy for small network. Both transparent and explicit proxy. Replacement for squid which still officially supports only HTTP/1.0. Compilation under Ubuntu 10.04 is OK, traffic server starts (locally). I cannot figure out how to connect to the explicit proxy. When I set up locahost:8080 as proxy address, I always see the page saying site is unreachable. In traffic server log there is also error message about that.
>
> Is there some tutorial/example of basic proxy configuration? (I read docs and wiki.)
>
> Thanx!
>
>