Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 16337 invoked from network); 23 Jul 2009 14:21:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Jul 2009 14:21:24 -0000 Received: (qmail 22410 invoked by uid 500); 23 Jul 2009 14:22:25 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 22379 invoked by uid 500); 23 Jul 2009 14:22:25 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 22370 invoked by uid 99); 23 Jul 2009 14:22:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2009 14:22:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jonas_lists@frukt.org designates 81.228.8.83 as permitted sender) Received: from [81.228.8.83] (HELO pne-smtpout1-sn2.hy.skanova.net) (81.228.8.83) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2009 14:22:15 +0000 Received: from chip.frukt.org (195.67.112.220) by pne-smtpout1-sn2.hy.skanova.net (7.3.140.3) id 4A48C447001D2061 for users@httpd.apache.org; Thu, 23 Jul 2009 16:21:54 +0200 X-Scanned-By: chip.frukt.org, using MIMEDefang 2.64 with local filter 31.214.se23 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=frukt.org; s=mail; t=1248358914; bh=I6wD/tWYZ2h8+nLGUSKZN89JItg=; h=X-Scanned-By: X-SMTP-From:Authentication-Results:Received:Received:Message-ID: Date:From:Organization:To:Subject:Content-Type:Reply-To; b=aVdmAh3 77BCsfNlbgsV+bjqMkZHIJDwN2f1GWhCwDKZDSbFBn9gkCBdi2wndhDvOK4aqtQRFwl +mWvFZzBQ8zQ+AETYeHbUfhZ1COgZJYixVOA129+BgqW+o+ii0F43rvtu1BVaQKy23Y UUv38DDVO0R+YBFbBDDR7nr9E1t2wA= X-SMTP-From: passed localhost [127.0.0.1] (chip.i.frukt.org) X-Hashcash: 1:22:090723142019:users@httpd.apache.org:host=chip.frukt.org:n6NEKJO3002705LGPA+s3Xilyp1eL1:FuG+ X-Fortune: Serving coffee on aircraft causes turbulence. X-Exclamation: Hubba, hubba, hopp! Authentication-Results: chip.frukt.org; auth=pass smtp.auth=QPymNen891Lr7meO6glmqg X-Virus-Scanned-By: chip.frukt.org, using CLAMD Received: from chip.i.frukt.org (localhost [127.0.0.1]) by chip.frukt.org (envelope-from ) (sm etc) with ESMTP id n6NEKJO3002705 for ; Thu, 23 Jul 2009 16:20:19 +0200 (CEST) Received: from chip.frukt.org (localhost [127.0.0.1]) by chip.i.frukt.org (envelope-from ) (sm queue) with ESMTP id n6NEK3ou002700 for ; Thu, 23 Jul 2009 16:20:03 +0200 (CEST) Received: from [10.0.4.37] ([10.0.4.37] [10.0.4.37]) by chip.frukt.org (envelope-from ) (asasmtpd v0.16a2) with ESMTPA id 1mtZ9p-Hk-fjFOW; Thu, 23 Jul 2009 16:20:03 +0200 (auth QPymNen891Lr7meO6glmqg) Message-ID: <4A687187.3080305@frukt.org> Date: Thu, 23 Jul 2009 16:19:51 +0200 From: Jonas Eckerman Organization: Frukt & FSDB User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: users@httpd.apache.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] httpd.config "subroutine" Mike -- EMAIL IGNORED wrote: > I have several and numerous > sections that have large sets of identical directives. > If there a way to define a "subroutine" in httpd.config > that can be called in these sections? If you want to be able pass simple "parameters" to the "subroutine" sections, check out mod_macro at . I use it for vhosts the way you describe, and I really like it. An example: ---8<--- ServerAdmin %admin ServerName www.%domain ServerAlias %domain %aliases Include /usr/local/etc/apache22/filter/proxy.conf ProxyPass / http://%server/ keepalive=on retry=10 ProxyPassReverse / http://%server/ ProxyErrorOverride On ProxyPreserveHost On ProxyPassReverseCookieDomain %server www.%domain CacheEnable disk / Use Reverse 10.0.7.11:80 admin@fsdb.org 10.0.7.13 edbu.org w3.edbu.org Use Reverse 10.0.7.11:80 admin@fsdb.org 10.0.7.13 wfdb.org w3.wfdb.org Use Reverse 10.0.7.202:80 admin@fsdb.org 10.0.6.10 fsdb.se w3.fsdb.se ---8<--- There are 28 more "Use Reverse " lines in the config, with different addresses and admins, and some with a whole bunch of aliases at the end. And then there's a bunch of vhosts using other macros as well. This way made it a lot easier to maintain than using includes. Another option could be mod_perl, wich, IIRC, allows you to use perl in the config files. Regards /Jonas -- Jonas Eckerman Fruktträdet & Förbundet Sveriges Dövblinda http://www.fsdb.org/ http://www.frukt.org/ http://whatever.frukt.org/ --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org