Ability to change filedescriptors up to 16000
Ability to use cachemanager website to monitor squid
Ability to reconfigure squid wihtout restart
etc/sysctl.conf
etc/squid/errors
usr/bin/squidclient
etc/sysctl.conf
etc/squid/errors
usr/bin/squidclient
usr/lib/squid/smb_auth.sh
usr/lib/squid/squid_ldap_auth
usr/lib/squid/unlinkd
usr/lib/squid/smb_auth.sh
usr/lib/squid/squid_ldap_auth
usr/lib/squid/unlinkd
usr/sbin/squid
var/ipfire/updatexlrator/bin/checkdeaddl
var/ipfire/updatexlrator/bin/checkup
usr/sbin/squid
var/ipfire/updatexlrator/bin/checkdeaddl
var/ipfire/updatexlrator/bin/checkup
var/ipfire/updatexlrator/bin/lscache
var/ipfire/updatexlrator/updxlrator-lib.pl
srv/web/ipfire/cgi-bin/proxy.cgi
var/ipfire/updatexlrator/bin/lscache
var/ipfire/updatexlrator/updxlrator-lib.pl
srv/web/ipfire/cgi-bin/proxy.cgi
+srv/web/ipfire/cgi-bin/cachemgr.cgi
srv/web/ipfire/cgi-bin/updatexlrator.cgi
var/ipfire/langs
lib/modules/2.6.25.19-ipfire/kernel/drivers/net/imq.ko
srv/web/ipfire/cgi-bin/updatexlrator.cgi
var/ipfire/langs
lib/modules/2.6.25.19-ipfire/kernel/drivers/net/imq.ko
#!/bin/bash
. /opt/pakfire/lib/functions.sh
/usr/local/bin/backupctrl exclude >/dev/null 2>&1
#!/bin/bash
. /opt/pakfire/lib/functions.sh
/usr/local/bin/backupctrl exclude >/dev/null 2>&1
extract_files
[ -e /var/ipfire/qos/enable ] && qosctrl stop
qosctrl generate
[ -e /var/ipfire/qos/enable ] && qosctrl start
perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
sysctl -p
extract_files
[ -e /var/ipfire/qos/enable ] && qosctrl stop
qosctrl generate
[ -e /var/ipfire/qos/enable ] && qosctrl start
perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
sysctl -p
-/etc/init.d/squid restart
+mv /etc/squid/cachemgr.conf /var/ipfire/proxy/cachemgr.conf
+ln -sf /var/ipfire/proxy/cachemgr.conf /etc/squid/cachemgr.conf
+chown nobody.nobody /var/ipfire/proxy/cachemgr.conf
+/etc/init.d/squid start
\ No newline at end of file
$proxysettings{'PROXY_PORT'} = '800';
$proxysettings{'VISIBLE_HOSTNAME'} = '';
$proxysettings{'ADMIN_MAIL_ADDRESS'} = '';
$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{'ERR_LANGUAGE'} = 'German';
$proxysettings{'ERR_DESIGN'} = 'ipfire';
$proxysettings{'SUPPRESS_VERSION'} = 'off';
$proxysettings{'UPSTREAM_USER'} = '';
$proxysettings{'UPSTREAM_PASSWORD'} = '';
$proxysettings{'LOGGING'} = 'off';
$proxysettings{'UPSTREAM_USER'} = '';
$proxysettings{'UPSTREAM_PASSWORD'} = '';
$proxysettings{'LOGGING'} = 'off';
+$proxysettings{'CACHEMGR'} = 'off';
$proxysettings{'LOGQUERY'} = 'off';
$proxysettings{'LOGUSERAGENT'} = 'off';
$proxysettings{'LOGQUERY'} = 'off';
$proxysettings{'LOGUSERAGENT'} = 'off';
+$proxysettings{'FILEDESCRIPTORS'} = '4096';
$proxysettings{'CACHE_MEM'} = '2';
$proxysettings{'CACHE_SIZE'} = '50';
$proxysettings{'MAX_SIZE'} = '4096';
$proxysettings{'CACHE_MEM'} = '2';
$proxysettings{'CACHE_SIZE'} = '50';
$proxysettings{'MAX_SIZE'} = '4096';
$proxysettings{'NCSA_PASS_CONFIRM'} = $proxysettings{'NCSA_PASS'};
}
$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)$/ ||
{
if ($proxysettings{'ENABLE'} !~ /^(on|off)$/ ||
$proxysettings{'TRANSPARENT'} !~ /^(on|off)$/ ||
+ 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))
{
if (!($proxysettings{'CACHE_MEM'} =~ /^\d+/) ||
($proxysettings{'CACHE_MEM'} < 1))
{
&writeconfig;
&writepacfile;
&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/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'); }
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'})
}
if ($proxysettings{'ACTION'} eq $Lang::tr{'advproxy clear cache'})
$checked{'LOGGING'}{'off'} = '';
$checked{'LOGGING'}{'on'} = '';
$checked{'LOGGING'}{$proxysettings{'LOGGING'}} = "checked='checked'";
$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'";
$checked{'LOGQUERY'}{'off'} = '';
$checked{'LOGQUERY'}{'on'} = '';
$checked{'LOGQUERY'}{$proxysettings{'LOGQUERY'}} = "checked='checked'";
print "<td colspan='2'> </td>";
}
print <<END
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>
<td colspan='4'><b>$Lang::tr{'advproxy cache management'}</b></td>
</tr>
<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 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>
<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>
<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";
}
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 '')
# 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
'you can only define one roadwarrior connection when using pre-shared key authentication' => 'Sie können nur eine Roadwarrior Verbindung definieren, wenn die Pre-shared Schlüsselauthentifizierung verwendet wird.<br/>Entweder haben Sie bereits eine Roadwarrior Verbindung mit Pre-shared Schlüsselauthentifizierung, oder Sie versuchen gerade eine hinzuzufügen.',
'your department' => 'Ihre Abteilung',
'your e-mail' => 'Ihre E-mail Adresse',
'you can only define one roadwarrior connection when using pre-shared key authentication' => 'Sie können nur eine Roadwarrior Verbindung definieren, wenn die Pre-shared Schlüsselauthentifizierung verwendet wird.<br/>Entweder haben Sie bereits eine Roadwarrior Verbindung mit Pre-shared Schlüsselauthentifizierung, oder Sie versuchen gerade eine hinzuzufügen.',
'your department' => 'Ihre Abteilung',
'your e-mail' => 'Ihre E-mail Adresse',
+'proxy errmsg filedescriptors' => 'Ungültiger Anzahl Filedescriptoren',
+'proxy filedescriptors' => 'Anzahl Fildescriptoren',
+'proxy admin password' => 'Cache Administrator Passwort',
+'proxy cachemgr' => 'Cachemanager aktivieren',
+'proxy reconfigure' => 'Speichern und Laden',
'you can only define one roadwarrior connection when using pre-shared key authentication' => 'You can only define one Roadwarrior connection when using pre-shared key authentication.<br />Either you already have a Roadwarrior connection with pre-shared key authentication, or you\'re trying to add one now.',
'your department' => 'Your Department',
'your e-mail' => 'Your E-mail Address',
'you can only define one roadwarrior connection when using pre-shared key authentication' => 'You can only define one Roadwarrior connection when using pre-shared key authentication.<br />Either you already have a Roadwarrior connection with pre-shared key authentication, or you\'re trying to add one now.',
'your department' => 'Your Department',
'your e-mail' => 'Your E-mail Address',
+'proxy errmsg filedescriptors' => 'Wrong amount of filedescriptors',
+'proxy filedescriptors' => 'Amount of fildescriptors',
+'proxy admin password' => 'Cache administrator password',
+'proxy cachemgr' => 'Activate cachemanager',
+'proxy reconfigure' => 'Save and Reload',
--enable-ntlm-auth-helpers="SMB" \
--enable-useragent-log \
--enable-referer-log \
--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
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
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
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
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
+ reconfigure)
+ /usr/sbin/squid -k reconfigure
+ ;;
+
status)
statusproc /usr/sbin/squid
statusproc /usr/lib/squid/unlinkd
status)
statusproc /usr/sbin/squid
statusproc /usr/lib/squid/unlinkd
- 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");
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");
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], "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 {
} 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");