From owner-freebsd-isp Sun Jul 14 12:38: 1 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 E747C37B400 for ; Sun, 14 Jul 2002 12:37:54 -0700 (PDT) Received: from thud.tbe.net (thud.tbe.net [209.123.109.174]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70D7643E6E for ; Sun, 14 Jul 2002 12:37:54 -0700 (PDT) (envelope-from gary@tbe.net) Received: by thud.tbe.net (Postfix, from userid 1001) id 68A191C946C; Sun, 14 Jul 2002 15:35:29 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by thud.tbe.net (Postfix) with ESMTP id 64652DCF3E; Sun, 14 Jul 2002 15:35:29 -0400 (EDT) Date: Sun, 14 Jul 2002 15:35:29 -0400 (EDT) From: "Gary D. Margiotta" To: Simon Carr's Palm 3 HandHeld Cc: Mark Johnston , 'Odhiambo Washington' , freebsd-isp@freebsd.org Subject: Re: Scripts to Manage Virtual Hosts In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Hrm.. I think I'm going to check out the Include directive... that seems like a good idea, and is decently able to manage.. Also, yeah my idea for the database part is/was pretty much what you said... I just want the info stored in a database, and be able to create config files on that data which will reside locally on each box... Likewise I don't want to have to deal with a dead DB server which would throw a serious wrench in the works. I have scripts for doing DNS additions in much the same way, and again, I want the data in the database, but I want each server to have static files to reduce the whole one-point-of-failure thing. -Gary Running Windows is kinda like playing blackjack: User stays on success, reboots on failure On Sat, 13 Jul 2002, Simon Carr's Palm 3 HandHeld wrote: > 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