httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hajo Locke <Hajo.Lo...@gmx.de>
Subject Re: [users@httpd] apache 2.4 wildcardsubdomains
Date Tue, 13 Sep 2016 11:38:09 GMT
Hello,

Am 13.09.2016 um 13:00 schrieb Daniel:
> Always define a ServerName, AFAIK *.example.com <http://example.com> 
> would not be valid in 2.2 either, even if it let you define it without 
> error, ServerName should always have a valid resolvable name, at least 
> from the client that will query it.
>
> Note that if you have several virtualhosts ServerName is important so 
> httpd will know exactly to which virtualhost it must deliver each request.
>
> In your case since you want to match all subdomains, just add a name 
> of one of your main subdomains for ServerName directive. eg: 
> ServerName main.example.com <http://main.example.com>
ok, thanks. so we will generate a uniq name for servername.  Because 
wildcardsubdomainhost should only trigger for not existing subdomains, 
we can not choose main.example.com as name. we have to make sure it is 
not used already.
>
> 2016-09-13 11:36 GMT+02:00 Hajo Locke <Hajo.Locke@gmx.de 
> <mailto:Hajo.Locke@gmx.de>>:
>
>     Hello List,
>
>     in apache 2.2 we had a typical vhost like this to realize
>     wildcardsubdomains:
>
>     <VirtualHost *:80>
>     ServerName *.example.com <http://example.com>
>     ServerAlias *.example.com <http://example.com>
>     DocumentRoot /var/www/wildcardexample/public_html
>     </VirtualHost>
>
>     In apache 2.4 wildcards are not allowed in servername. Is it ok to
>     just comment out servername and run this vhost only with
>     "ServerAlias *.example.com <http://example.com>"?
>     It seems that servername is not a mandatory directive, apache 2.4
>     is starting without problems.
>     Or is there an better way to realize?
>
>     Thanks,
>     Hajo
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>     <mailto:users-unsubscribe@httpd.apache.org>
>     For additional commands, e-mail: users-help@httpd.apache.org
>     <mailto:users-help@httpd.apache.org>
>
>
>
>
> -- 
> *Daniel Ferradal*
> IT Specialist
>
> email dferradal at gmail.com <http://gmail.com>
> linkedin es.linkedin.com/in/danielferradal 
> <http://es.linkedin.com/in/danielferradal>

Thanks,
Hajo

Mime
View raw message