Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Sep 2000 18:40:42 -0500
From:      Steve Price <sprice@hiwaay.net>
To:        freebsd-isp@freebsd.org
Subject:   named virtual hosts
Message-ID:  <20000912184042.D55208@bsd.planetwe.com>

next in thread | raw e-mail | index | archive | help
I have the following setup for Apache and was trying to reduce some
of the duplicate lines.  What I have looks something like this.
Because this box will be hosting ~400 domains shortly I can't just
make the variables global.  Well I can make some of them global by
using VirtualDocumentRoot and VirtualScriptAlias, but that doesn't
work for all the duplicated lines.

NameVirtualHost 192.168.21.21
<VirtualHost 192.168.21.21>
 DocumentRoot	/home/foo/www
 ServerName	www.foo.com
 ServerAdmin	webmaster@foo.com
 ErrorLog	/home/foo/logs/error.log
 TransferLog	/home/foo/logs/access.log
 ScriptAlias	/cgi-bin/ /home/foo/cgi-bin/
</VirtualHost>
<IfDefine SSL>
 <VirtualHost 192.168.21.21:443>
   DocumentRoot	/home/foo/www
   ServerName	www.foo.com
   ServerAdmin	webmaster@foo.com
   ErrorLog	/home/foo/logs/error.log
   TransferLog	/home/foo/logs/access.log
   ScriptAlias	/cgi-bin/ /home/foo/cgi-bin/
   SSLEngine			on
   SSLCertificateFile		/home/foo/ssl/ssl.crt
   SSLCertificateKeyFile	/home/foo/ssl/ssl.key
 </VirtualHost>
</IfDefine>

What I'd like to be able to do is something like this instead.

NameVirtualHost 192.168.21.21
<VirtualHost 192.168.21.21>
 DocumentRoot	/home/foo/www
 ServerName	www.foo.com
 ServerAdmin	webmaster@foo.com
 ErrorLog	/home/foo/logs/error.log
 TransferLog	/home/foo/logs/access.log
 ScriptAlias	/cgi-bin/ /home/foo/cgi-bin/
 <IfDefine SSL>
  # The following will not work.
  #<If Port == 443>
  # SSLEngine		on
  # SSLCertficateFile	/home/foo/ssl/ssl.crt
  # SSLCertficateKeyFile	/home/foo/ssl/ssl.key
  #</If>
 </IfDefine>
</VirtualHost>

Any suggestions?  Thanks.

-steve


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000912184042.D55208>