['installedpackages']['squid']['config']
pkg_edit.php?xml=squid.xml&id=0&savemsg=Settings%20saved.
squid
hostname
visable_hostname
note: if left empty your default hostname will be used.
input
http_port
http_port
note: default proxy port is 3128.
input
httpd_accel_with_proxy
httpd_accel_with_proxy
enabled by default
select
cache size [MB]
cache_mem
hint: fill 1/3 of the cache memory size you want squid to use.
input
admin email
cache_mgr
input
blocked words
rowhelper
badURL
url that contain any of the words will be blocked.
input
function sync_package() {
system("/bin/mkdir /usr/local/etc/squid 2>/dev/null");
$lancfg = $config['interfaces']['lan'];
$lanif = $lancfg['if'];
$lanip = $lancfg['ipaddr'];
$lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
$lansn = $lancfg['subnet'];
$netmask = "";
$fout = fopen("/usr/local/etc/squid/squid.conf","w");
fwrite($fout, "# cat squid.conf\n");
fwrite($fout, "visable_hostname " . $_POST['hostname'] . "\n");
fwrite($fout, "http_port " . $_POST['http_port'] . "\n");
fwrite($fout, "httpd_accel_with_proxy " . $_POST['httpd_accel_with_proxy'] . "\n");
fwrite($fout, "cache_mem " . $_POST['cache_mem'] . "\n");
fwrite($fout, "cache_mgr " . $_POST['cache_mgr'] . "\n");
fwrite($fout, "http_port 3128\n");
fwrite($fout, "icp_port 0\n");
fwrite($fout, "acl localnet src " . $lansa . "/" . $lansn . "\n");
fwrite($fout, "acl all src " . $lansa . "/" . $lansn . "\n");
fwrite($fout, "acl localhost src 127.0.0.1/255.255.255.255\n");
fwrite($fout, "acl Safe_ports port 80 443 210 119 70 21 1025-65535\n");
fwrite($fout, "acl CONNECT method CONNECT\n");
fwrite($fout, "http_access allow localnet\n");
fwrite($fout, "http_access allow localhost\n");
fwrite($fout, "http_access deny !Safe_ports\n");
fwrite($fout, "http_access deny CONNECT\n");
fwrite($fout, "http_access deny all\n");
fwrite($fout, "httpd_accel_host virtual\n");
fwrite($fout, "httpd_accel_port 80\n");
fwrite($fout, "httpd_accel_with_proxy on\n");
fwrite($fout, "httpd_accel_uses_host_header on\n");
/* fwrite($fout, "badURL " . $_POST['badURL'] . "\n"); */
fclose($fout);
$fout = fopen("/usr/local/etc/rc.d/squid.sh","w");
fwrite($fout, "#!/bin/sh\n");
fwrite($fout, "/usr/local/sbin/squid\n\n");
fclose($fout);
system("chmod a+x /usr/local/etc/rc.d/squid.sh");
system("/usr/local/sbin/squid -z");
system("/usr/local/sbin/squid");
filter_configure();
}
sync_package();
sync_package();
/usr/local/sbin/squid
exec("mv /var/db/pkg/squid* /tmp/ 2>/dev/null");
filter_configure();
squid