From aa5668199f1cc75ce8a7b97ce2613eaf0d63d02a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 22 Jan 2005 22:25:32 +0000 Subject: Update packages with minor bug fixes. --- packages/carp.xml | 9 +++++---- packages/squid.xml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 packages/squid.xml diff --git a/packages/carp.xml b/packages/carp.xml index 308ce2b9..9eb588db 100644 --- a/packages/carp.xml +++ b/packages/carp.xml @@ -3,7 +3,7 @@ carp - CARP Settings + CARP (failover) CARP is a tool to help achieve system redundancy, by having multiple computers creating a single, virtual network interface between them, so that if any machine fails, another can respond instead, and/or allowing a degree of load sharing between systems. CARP is an improvement over the Virtual Router Redundancy Protocol (VRRP) standard. It was developed after VRRP was deemed to be not free enough because of a possibly-overlapping Cisco patent.
Services
carp.xml @@ -50,7 +50,7 @@ input - Password + Virtual IP Password password Enter the VHID group password. password @@ -219,12 +219,13 @@ /* * create the carp interface */ - system("/sbin/ifconfig carp" . $carp_instances_counter . " create"); + fwrite($fout, "/sbin/ifconfig carp" . $carp_instances_counter . " create\n"); $broadcast_address = gen_subnet_max($carp['ipaddress'], $carp['netmask']); if($carp['password'] != "") { $password = " pass " . $carp['password']; } - $carp_command = "/sbin/ifconfig carp" . $carp_instances_counter . " " . $carp['ipaddress'] . " " . $carp['netmask'] . " broadcast " . $broadcast_address . " vhid " . $carp['vhid'] . $carp['advskew '] . $password; + $carp_command = "/sbin/ifconfig carp" . $carp_instances_counter . " " . $carp['ipaddress'] . "/" . $carp['netmask']; + $carp_command .= " broadcast " . $broadcast_address . " vhid " . $carp['vhid'] . $carp['advskew '] . $password; if($carp['balancing'] == "true") $using_arp_balance = 1; if($carp['preempt'] == "true") $using_preempt = 1; fwrite($fout, $carp_command . "\n"); diff --git a/packages/squid.xml b/packages/squid.xml new file mode 100644 index 00000000..6a5bebda --- /dev/null +++ b/packages/squid.xml @@ -0,0 +1,33 @@ + + + squid + + + ['installedpackages']['squid']['config'] + + + echo "<pre>"; + system("/bin/mkdir /usr/local/etc/squid"); + $fout = fopen("/usr/local/etc/squid/squid.conf","w"); + fwrite($fout, "http_port 127.0.0.1:3128\n"); + fwrite($fout, "http_access deny to_localhost\n"); + fwrite($fout, "acl our_networks src 10.0.0.0/8\n"); + fwrite($fout, "http_access allow our_networks\n"); + fwrite($fout, "visible_hostname insomnia.benzedrine.cx\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"); + 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/bin/killall squid"); + + -- cgit v1.2.3