{"id":10701,"date":"2024-03-14T14:50:51","date_gmt":"2024-03-14T05:20:51","guid":{"rendered":"https:\/\/agix.com.au\/?p=10701"},"modified":"2024-03-15T13:41:29","modified_gmt":"2024-03-15T04:11:29","slug":"building-a-minimal-web-proxy-wpad","status":"publish","type":"post","link":"https:\/\/agix.com.au\/building-a-minimal-web-proxy-wpad\/","title":{"rendered":"Building a Minimal Web Proxy & WPAD"},"content":{"rendered":"

This article demonstrates how to install and configure a Squid proxy along with a WPAD to assist with client configuration. Paths to configuration files may vary between system types. Both http and https will work through this proxy. We’re going to install the Squid proxy and Apache web server on the same system.<\/p>\n

Install Squid and Apache:<\/p>\n

(redhat\/centos)# yum install squid httpd\r\n(ubuntu)# apt install squid apache2<\/pre>\n

Edit the “\/etc\/squid\/squid\/squid.conf” file:<\/p>\n

logformat agix %>a %>A %ul %ru %>Hs\r\naccess_log \/var\/log\/squid\/access.log.simple agix\r\n\r\n# Decide what to allow (the clients)\r\nacl mylan src 172.0.0.0\/255.0.0.0\r\n\r\nhttp_access allow mylan\r\nhttp_access deny all\r\n\r\n# Enable the following to disable caching\r\n#cache deny all\r\n#cache_dir null \/tmp\r\n\r\nhttp_port 3128\r\n\r\ncoredump_dir \/var\/spool\/squid<\/pre>\n

Restart squid:<\/p>\n

systemctl restart squid\r\nsystemctl enable squid<\/pre>\n

Create the “\/var\/www\/html\/wpad.dat” file with the following contents:<\/p>\n

function FindProxyForURL(url, host) {\r\nif (host == \"127.0.0.1\" || isPlainHostName(host) || shExpMatch (host, \"(proxy.example.com)\")) {\r\nreturn \"DIRECT\";\r\n}\r\n\r\nreturn \"PROXY proxy.example.com:3128\";\r\n}<\/pre>\n

Replace “proxy.example.com” with the IP\/name of the proxy server.<\/p>\n

Restart Apache:<\/p>\n

(redhat\/centos)# systemctl restart httpd\r\n(redhat\/centos)# systemctl enable httpd\r\n(ubuntu)# systemctl restart apache2\r\n(ubuntu)# systemctl enable apache2<\/pre>\n

Make sure the firewall allows access on TCP port 3128 and 80 to the proxy\/web server.<\/p>\n

Configure your web browsers to auto configure using the URL “http:\/\/proxy.example.com\/wpad.dat” and monitor the “\/var\/log\/squid\/access.log.simple” log file to see if traffic is passing through the proxy.<\/p>\n","protected":false},"excerpt":{"rendered":"

This article demonstrates how to install and configure a Squid proxy along with a WPAD to assist with client configuration. Paths to configuration files may vary between system types. Both http and https will work through this proxy. We’re going to install the Squid proxy and Apache web server on<\/p>\n","protected":false},"author":1,"featured_media":10703,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,115,114,113,116],"tags":[],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/10701"}],"collection":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/comments?post=10701"}],"version-history":[{"count":3,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/10701\/revisions"}],"predecessor-version":[{"id":10711,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/10701\/revisions\/10711"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/media\/10703"}],"wp:attachment":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/media?parent=10701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/categories?post=10701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/tags?post=10701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}