You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jamie Randell <ja...@gmail.com> on 2008/01/16 16:13:56 UTC

[users@httpd] Question about virtual hosts and wildcards

Hi,

I am only semi-experienced with Apache, and have maybe a strange question.
I need to set up a name-based virtual host pointing the subdomain "foo" to a
certain directory for any domain that's configured in DNS to point to the
box.  Would it work if I set it up with one of those domains in the
ServerName slot, e.g. "foo.domain.com", and added a ServerAlias for
"foo.*.com"?

Alternately, is there a limit on how long the ServerAlias line can be in
terms of characters?  Or would I want to add separate, multiple ServerAlias
lines for large numbers of subdomains - would that concatenate the entries,
or drop all but one line, or cause Apache to puke?

It's kind of a production environment, so I don't really have the leisure to
experiment and try it out, and am hoping to gain some insight here.  Thanks
in advance for any help you can provide.

-- 
Jamie M. Randell
jamiemr@gmail.com

Re: [users@httpd] Question about virtual hosts and wildcards

Posted by Christian Folini <ch...@post.ch>.
On Wed, Jan 16, 2008 at 11:11:22AM -0500, Jamie Randell wrote:
> Yes, I've read the docs.  They say, "The wildcard characters * and ? can be
> used to match names", but as the examples I've seen only use the wildcards
> to match subdomains, I had doubts as to whether they'll work in the domain
> place.

Okay. I saw it leaves some doubt in this regard.

> Guess I'll have to try it and see.

yep. If it works, you might want to give feedback to the
apache documentation project.

regs,

Christian

-- 
Christian Folini, Swiss Post IT, Unix / Apache Engineering
+41 (0)58 338 79 96               christian.folini@post.ch

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Re: [users@httpd] Question about virtual hosts and wildcards

Posted by Jamie Randell <ja...@gmail.com>.
Yes, I've read the docs.  They say, "The wildcard characters * and ? can be
used to match names", but as the examples I've seen only use the wildcards
to match subdomains, I had doubts as to whether they'll work in the domain
place.

Guess I'll have to try it and see.

On Jan 16, 2008 10:30 AM, Christian Folini <ch...@post.ch> wrote:

> Hi Jamie,
>
> I think your question is covered in the online documentation:
> http://httpd.apache.org/docs/2.0/vhosts/name-based.html
>
> On Wed, Jan 16, 2008 at 10:13:56AM -0500, Jamie Randell wrote:
> > It's kind of a production environment, so I don't really have the
> leisure to
> > experiment and try it out, and am hoping to gain some insight here.
>
> I doubt you should go straight to the production server.
> Your test box need not support your full production setup.
> Any box running apache would already help here. And then
> manipulate the hosts-file on the client and see what happens.
>
> regs,
>
> Christian
>
> --
> Christian Folini, Swiss Post IT, Unix / Apache Engineering
> +41 (0)58 338 79 96               christian.folini@post.ch
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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
>
>


-- 
Jamie M. Randell
jamiemr@gmail.com

Re: [users@httpd] Question about virtual hosts and wildcards

Posted by Christian Folini <ch...@post.ch>.
Hi Jamie,

I think your question is covered in the online documentation:
http://httpd.apache.org/docs/2.0/vhosts/name-based.html

On Wed, Jan 16, 2008 at 10:13:56AM -0500, Jamie Randell wrote:
> It's kind of a production environment, so I don't really have the leisure to
> experiment and try it out, and am hoping to gain some insight here.

I doubt you should go straight to the production server.
Your test box need not support your full production setup.
Any box running apache would already help here. And then
manipulate the hosts-file on the client and see what happens.

regs,

Christian

-- 
Christian Folini, Swiss Post IT, Unix / Apache Engineering
+41 (0)58 338 79 96               christian.folini@post.ch

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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