I need to locate a Squid instance as a forward proxy behind Apache 2.4.6. I don't have enough credits to add inline images. But here it is
As Squid3.3 listens on localhost:3128 and works OK with default config, I have this configuration vhost config for Apache:
<VirtualHost example.com:443> SSLEngine on [cert file config] ServerName example.com DocumentRoot /var/www ProxyRequests Off ProxyVia Off ProxyRemote * http://127.0.0.1:3128 LogLevel debug ErrorLog /var/log/apache2/tunnel_error.log CustomLog /var/log/apache2/tunnel_access.log combined </VirtualHost>
However my proxy requests are not processed through Squid 3.3 anyhow.
I have ran into a lot of articles around the web explaining caching in front of Apache, however, (maybe I missed) I need Apache to be welcoming CONNECT requests and passing to Squid.
Do you have any idea how to do the configuration?
Trying with proxypass
ProxyRequests Off ProxyVia Off ProxyPass http://127.0.0.1:3128/ ProxyPassReverse http://127.0.0.1:3128/
Apache seems to redirect my request to Squid semi-well. Because Squid this time warns me with:
ERROR The requested URL could not be retrieved The following error was encountered while trying to retrieve the URL: / "Invalid URL" Some aspect of the requested URL is incorrect. Some possible problems are: * Missing or incorrect access protocol (should be http:// or similar) * Missing hostname * Illegal double-escape in the URL-Path * Illegal character in hostname; underscores are not allowed. Your cache administrator is webmaster.
Because it seems like Squid thinks I would like to get http://icanhazip.com as a page from my own server. (Or am I mistaken?)
==> apache access log <== 126.96.36.199.myip - - [03/Apr/2014:23:33:26 +0300] "GET http://icanhazip.com/ HTTP/1.1" 400 2006 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36" ==> squid3 access.log <== 1396557520.935 0 127.0.0.1 NONE/400 2006 GET / - HIER_NONE/- text/html
Edit 2 - The Diagram
Disred solution would be like:
1) Since I couldnot still find a way out. I would like to improve the question as suggested with a diagram.
2) I have noticed while examining the headers that
GET / Host: yahoo com
which is passed from Apache to Squid should be
for instance to be able to work this out.
Diagram URL is at top.