From owner-freebsd-isp Fri Jul 12 23:10:55 2002 Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C929A37B400 for ; Fri, 12 Jul 2002 23:10:49 -0700 (PDT) Received: from tomts6-srv.bellnexxia.net (tomts6.bellnexxia.net [209.226.175.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE14443E5E for ; Fri, 12 Jul 2002 23:10:48 -0700 (PDT) (envelope-from palm@simoncarr.com) Received: from localhost ([64.229.102.54]) by tomts6-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20020713061027.BRNR8251.tomts6-srv.bellnexxia.net@localhost>; Sat, 13 Jul 2002 02:10:27 -0400 Date: Sat, 13 Jul 2002 00:33:52 -0400 Subject: Re: Scripts to Manage Virtual Hosts Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v482) Cc: Mark Johnston , 'Odhiambo Washington' , freebsd-isp@freebsd.org To: "Gary D. Margiotta" From: Simon Carr's Palm 3 HandHeld In-Reply-To: Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.482) Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi Gary, Some thoughts; I've done something similar, but instead of writing all the VirtualHosts to one file it just creates a file for each VirtualHost called .conf in a specified directory, then in my httpd.conf I've got include "/usr/local/etc/apache/VirtualHost/" That'll read all the files in said directory and process them (you can see it with an apachectl configtest, it lists each one). An absolute godsend of a feature. I also toyed with the idea of using mod_sqlinclude, but the idea of my DB server going down for the count and then trying to restart an Apache server with 100+ VirtualHosts did not sit well... :) So the process is I've got the user configs in a database, but the VirtualHost files themselves are static text that reside in a directory. The perl script reads from the DB and creates any new entries, but if the DB server isn't there my Apache isn't crippled (totally). I haven't decided on a good method for disabling accounts but I'm getting there. I haven't dealt with binding VirtualHosts to specific IPs, I just have ... I'll eventually have to add :80 to the end of that when I've got SSL enabled on my servers. On Friday, July 12, 2002, at 10:34 , Gary D. Margiotta wrote: > I started writing some perl scripts which I use to add virtualhosts and > redirects to separate config files. I didn't like the idea of editing > the > httpd.conf directly, so I made use of the ResourceConfig directive, and > created 2 files called virtualhosts.conf and redirects.conf which apache > pulls in when started. > > The scripts are currently only able to add entries, and not remove them, > but should be able to be easily enough modified to include that, I just > haven't had the time to finish them up. I want to eventually hook up > the > scripts to keep the info in a database for much easier organization and > manipulation of domains, but again, lack of time. > > You'll notice that it also makes a call to a shell script that gets run > to > ifconfig the virtual IPs on the host interface. I also run that > before I > restart apache to make sure the new IP takes effect. > > -Gary > > Running Windows is kinda like playing blackjack: > User stays on success, reboots on failure > > >> -----Original Message----- >> From: owner-freebsd-isp@FreeBSD.ORG >> [mailto:owner-freebsd-isp@FreeBSD.ORG] On Behalf Of Odhiambo Washington >> Sent: Friday, July 12, 2002 8:51 AM >> To: FBSD-ISP >> Subject: Scripts to Manage Virtual Hosts >> >> >> [ I sent this to -questions but got no help ;) ] >> >> >> Hello Users, >> >> I believe someone already had written a script that can be used to >> manipulate >> httpd.conf to add/remove virtual host entries. >> I sincerely believe that this is somewhere so I don't have to start >> agonizing >> about re-inventing the wheel. >> Could someone kindly point me to where one is located, better even >> share >> with me >> what they have ;-) >> >> >> -Wash >> >> -- >> Odhiambo Washington "The box said 'Requires >> Wananchi Online Ltd. www.wananchi.com Windows 95, NT, or better,' >> Tel: 254 2 313985-9 Fax: 254 2 313922 so I installed FreeBSD." >> GSM: 254 72 743 223 GSM: 254 733 744 121 This sig is McQ! :-) >> >> >> The light at the end of the tunnel is the headlight of an approaching >> train. >> >> To Unsubscribe: send mail to majordomo@FreeBSD.org >> with "unsubscribe freebsd-isp" in the body of the message >> >> >> To Unsubscribe: send mail to majordomo@FreeBSD.org >> with "unsubscribe freebsd-isp" in the body of the message >> > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message