$proxysettings{'PROXY_PORT'} = '800';
$proxysettings{'VISIBLE_HOSTNAME'} = '';
$proxysettings{'ADMIN_MAIL_ADDRESS'} = '';
+$proxysettings{'ADMIN_PASSWORD'} = '';
$proxysettings{'ERR_LANGUAGE'} = 'German';
$proxysettings{'ERR_DESIGN'} = 'ipfire';
$proxysettings{'SUPPRESS_VERSION'} = 'off';
$proxysettings{'UPSTREAM_USER'} = '';
$proxysettings{'UPSTREAM_PASSWORD'} = '';
$proxysettings{'LOGGING'} = 'off';
+$proxysettings{'CACHEMGR'} = 'off';
$proxysettings{'LOGQUERY'} = 'off';
$proxysettings{'LOGUSERAGENT'} = 'off';
+$proxysettings{'FILEDESCRIPTORS'} = '4096';
$proxysettings{'CACHE_MEM'} = '2';
$proxysettings{'CACHE_SIZE'} = '50';
$proxysettings{'MAX_SIZE'} = '4096';
$proxysettings{'NCSA_PASS_CONFIRM'} = $proxysettings{'NCSA_PASS'};
}
-if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'} eq $Lang::tr{'advproxy save and restart'}))
+if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'} eq $Lang::tr{'advproxy save and restart'}) || ($proxysettings{'ACTION'} eq $Lang::tr{'proxy reconfigure'}))
{
if ($proxysettings{'ENABLE'} !~ /^(on|off)$/ ||
$proxysettings{'TRANSPARENT'} !~ /^(on|off)$/ ||
goto ERROR;
}
}
+ if (!($proxysettings{'FILEDESCRIPTORS'} =~ /^\d+/) ||
+ ($proxysettings{'FILEDESCRIPTORS'} < 1) || ($proxysettings{'FILEDESCRIPTORS'} > 16384))
+ {
+ $errormessage = $Lang::tr{'proxy errmsg filedescriptors'};
+ goto ERROR;
+ }
if (!($proxysettings{'CACHE_MEM'} =~ /^\d+/) ||
($proxysettings{'CACHE_MEM'} < 1))
{
&writeconfig;
&writepacfile;
+ if ($proxysettings{'CACHEMGR'} eq 'on'){&writecachemgr;}
+
system ('/usr/local/bin/squidctrl', 'disable');
unlink "${General::swroot}/proxy/enable";
unlink "${General::swroot}/proxy/transparent";
system ('/usr/bin/touch', "${General::swroot}/proxy/transparent_blue"); }
if ($proxysettings{'ACTION'} eq $Lang::tr{'advproxy save and restart'}) { system('/usr/local/bin/squidctrl restart >/dev/null 2>&1'); }
- }
+ if ($proxysettings{'ACTION'} eq $Lang::tr{'proxy reconfigure'}) { system('/usr/local/bin/squidctrl reconfigure >/dev/null 2>&1'); }
+ }
}
if ($proxysettings{'ACTION'} eq $Lang::tr{'advproxy clear cache'})
$checked{'LOGGING'}{'off'} = '';
$checked{'LOGGING'}{'on'} = '';
$checked{'LOGGING'}{$proxysettings{'LOGGING'}} = "checked='checked'";
+$checked{'CACHEMGR'}{'off'} = '';
+$checked{'CACHEMGR'}{'on'} = '';
+$checked{'CACHEMGR'}{$proxysettings{'CACHEMGR'}} = "checked='checked'";
$checked{'LOGQUERY'}{'off'} = '';
$checked{'LOGQUERY'}{'on'} = '';
$checked{'LOGQUERY'}{$proxysettings{'LOGQUERY'}} = "checked='checked'";
print "<td colspan='2'> </td>";
}
print <<END
- <td class='base'>$Lang::tr{'advproxy admin mail'}: <img src='/blob.gif' alt='*' /></td>
- <td><input type='text' name='ADMIN_MAIL_ADDRESS' value='$proxysettings{'ADMIN_MAIL_ADDRESS'}' /></td>
+ <td colspan='2'> </td>
</tr>
<tr>
END
<tr>
<td colspan='4'><b>$Lang::tr{'advproxy cache management'}</b></td>
</tr>
+<tr>
+ <td class='base'>$Lang::tr{'proxy cachemgr'}:</td>
+ <td><input type='checkbox' name='CACHEMGR' $checked{'CACHEMGR'}{'on'} /></td>
+ <td class='base'>$Lang::tr{'advproxy admin mail'}: <img src='/blob.gif' alt='*' /></td>
+ <td><input type='text' name='ADMIN_MAIL_ADDRESS' value='$proxysettings{'ADMIN_MAIL_ADDRESS'}' /></td>
+</tr>
+<tr>
+ <td class='base'>$Lang::tr{'proxy filedescriptors'}:</td>
+ <td><input type='text' name='FILEDESCRIPTORS' value='$proxysettings{'FILEDESCRIPTORS'}' size='5' /></td>
+ <td class='base'>$Lang::tr{'proxy admin password'}: <img src='/blob.gif' alt='*' /></td>
+ <td><input type='text' name='ADMIN_PASSWORD' value='$proxysettings{'ADMIN_PASSWORD'}' /></td>
+</tr>
<tr>
<td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
</tr>
<tr>
<td> </td>
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
+ <td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'proxy reconfigure'}' /></td>
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'advproxy save and restart'}' /></td>
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'advproxy clear cache'}' /></td>
<td> </td>
print FILE " $proxysettings{'VISIBLE_HOSTNAME'}\n\n";
}
- if (!($proxysettings{'ADMIN_MAIL_ADDRESS'} eq '')) { print FILE "cache_mgr $proxysettings{'ADMIN_MAIL_ADDRESS'}\n\n"; }
+ if (!($proxysettings{'ADMIN_MAIL_ADDRESS'} eq '')) { print FILE "cache_mgr $proxysettings{'ADMIN_MAIL_ADDRESS'}\n"; }
+ if (!($proxysettings{'ADMIN_PASSWORD'} eq '')) { print FILE "cachemgr_passwd $proxysettings{'ADMIN_PASSWORD'} all\n"; }
+ print FILE "\n";
+
+ print FILE "max_filedescriptors $proxysettings{'FILEDESCRIPTORS'}\n\n";
# Write the parent proxy info, if needed.
if ($remotehost ne '')
}
# -------------------------------------------------------------------
+
+sub writecachemgr
+{
+ open(FILE, ">${General::swroot}/proxy/cachemgr.conf");
+ flock(FILE, 2);
+ print FILE "$netsettings{'GREEN_ADDRESS'}:$proxysettings{'PROXY_PORT'}\n";
+ print FILE "localhost";
+ return;
+}
+
+# -------------------------------------------------------------------
\ No newline at end of file
--enable-ntlm-auth-helpers="SMB" \
--enable-useragent-log \
--enable-referer-log \
- --enable-snmp \
- --with-pthreads --with-dl
+ --enable-snmp \
+ --with-pthreads --with-dl \
+ --with-maxfd="16384"
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
rm -f /etc/squid/squid.conf
ln -sf /var/ipfire/proxy/squid.conf /etc/squid/squid.conf
+ rm -f /etc/squid/cachemgr.conf
+ ln -sf /var/ipfire/proxy/cachemgr.conf /etc/squid/cachemgr.conf
rm -f /etc/squid/errors
ln -sf /usr/lib/squid/errors/English /etc/squid/errors
touch /var/log/squid/access.log
chown -R squid:squid /var/log/squid /var/log/cache /var/log/updatexlrator
+ cp /usr/lib/squid/cachemgr.cgi /srv/web/ipfire/cgi-bin/cachemgr.cgi
+ chown nobody.nobody /srv/web/ipfire/cgi-bin/cachemgr.cgi
+
cp -f $(DIR_SRC)/config/updxlrator/updxlrator /usr/sbin/updxlrator
cp -f $(DIR_SRC)/config/updxlrator/checkup /var/ipfire/updatexlrator/bin/checkup
cp -f $(DIR_SRC)/config/updxlrator/download /var/ipfire/updatexlrator/bin/download
exit(1);
if (argc < 2) {
- fprintf(stderr, "\nNo argument given.\n\nsquidctrl (start|stop|restart|flush)\n\n");
+ fprintf(stderr, "\nNo argument given.\n\nsquidctrl (start|stop|restart|flush|reconfigure)\n\n");
exit(1);
}
safe_system("/etc/rc.d/init.d/squid stop");
} else if (strcmp(argv[1], "restart") == 0) {
safe_system("/etc/rc.d/init.d/squid restart");
+ } else if (strcmp(argv[1], "reconfigure") == 0) {
+ safe_system("/etc/rc.d/init.d/squid reconfigure");
} else if (strcmp(argv[1], "flush") == 0) {
safe_system("/etc/rc.d/init.d/squid flush");
} else if (strcmp(argv[1], "enable") == 0) {
} else if (strcmp(argv[1], "disable") == 0) {
safe_system("rm -f /etc/rc.d/rc*.d/*squid >/dev/null 2>&1");
} else {
- fprintf(stderr, "\nBad argument given.\n\nsquidctrl (start|stop|restart|flush)\n\n");
+ fprintf(stderr, "\nBad argument given.\n\nsquidctrl (start|stop|restart|flush|reconfigure)\n\n");
exit(1);
}