You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nicolas Froidure <fr...@yahoo.fr> on 2010/12/05 12:28:31 UTC

[users@httpd] Multi-level virtualhost inherit

            Hello!

    Are there a way to make mutlti-level virtualhosts ?

    I've many virtualhosts on my httpd.conf file. There are 3 "classes" of 
virtual hosts (static content, dynamic content with rewrite rules, others).

    I would like to be able to define more than one base virtualhost for reuse 
them in my other virtualhosts. Is it possible ?

    Thank you.
---
nfroidure



      

Re: [users@httpd] Multi-level virtualhost inherit

Posted by Igor Galić <i....@brainsware.org>.
----- "FROIDURE Nicolas" <fr...@yahoo.fr> wrote:

> Hi,
> 
>      Thanks for the tip. It seems to be a better solution for me : In
> Debian it seems that each virtualhosts are confined on a single file
> and 
> included with the Include directive (with a path having a wildcard) on
> the main configuration file.

That's just the way Debian does it. And many folks aren't quite happy
with that solution.
You see, your run-of-the-mill vhost looks like

<VirtualHost *:80>
   ServerName some.example.com
   DocumentRoot /srv/web/some.example.com/htdocs
</VirtualHost>

Putting that in one file? Does it make sense? I don't know..
Lets see how this works out with mod_macro:

<Macro STDVHost $sname
  <VirtualHost *:80>
     ServerName sname
     DocumentRoot /srv/web/sname/htdocs
  </VirtualHost>
</Macro>


And then you have one line you can put in a file:
Use STDVhost some.example.com


>      In my first dedicated server, each virtualhost were directly 
> included in the main configuration files. Do you think that the 
> difference in terms of performances at startup or whatever is
> important ?

How many vhosts are we talking about?
10k? 150k? 480M?

If it's below 10k or even 1k, it shouldn't really matter.

>      Thanks.

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

---------------------------------------------------------------------
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] Multi-level virtualhost inherit

Posted by FROIDURE Nicolas <fr...@yahoo.fr>.
             Hi,

     Thanks for the tip. It seems to be a better solution for me : In 
Debian it seems that each virtualhosts are confined on a single file and 
included with the Include directive (with a path having a wildcard) on 
the main configuration file.

     In my first dedicated server, each virtualhost were directly 
included in the main configuration files. Do you think that the 
difference in terms of performances at startup or whatever is important ?

     Thanks.

Le 06/12/2010 09:43, Mark Montague a écrit :
>  You can also do what you want outside of Apache HTTP Server:  write a 
> script that generates httpd.conf from one or more input files, and run 
> this script (manually or automatically) before starting httpd.  You 
> can use M4, CPP, Perl, or many other tools to generate the 
> configuration file, depending on your needs.  This way you do not need 
> to load any special module; but you should pick a tool that other 
> people will also have who want to use your configuration.
>
> -- 
>   Mark Montague
>   mark@catseye.org
>
>
>
> On December 6, 2010 3:37 , FROIDURE Nicolas 
> <fr...@yahoo.fr> wrote:
>>         I want to stay on a "universal" Apache config. Now I know 
>> it's impossible without enabling a specific module. I'll deal with 
>> this restriction anyway.
>>
>>     Thank you Jorge.
>>
>> Le 05/12/2010 14:11, Jorge Schrauwen a écrit :
>>> You may want to look at mod_macro, or mod_perl if you want really
>>> complex setups.
>>>
>>>
>>> ~Jorge
>>>
>>>
>>>
>>> On Sun, Dec 5, 2010 at 12:28 PM, Nicolas Froidure
>>> <fr...@yahoo.fr>  wrote:
>>>>              Hello!
>>>>
>>>>      Are there a way to make mutlti-level virtualhosts ?
>>>>
>>>>      I've many virtualhosts on my httpd.conf file. There are 3 
>>>> "classes" of
>>>> virtual hosts (static content, dynamic content with rewrite rules, 
>>>> others).
>>>>
>>>>      I would like to be able to define more than one base 
>>>> virtualhost for
>>>> reuse them in my other virtualhosts. Is it possible ?
>>>>
>>>>      Thank you.
>>>> ---
>>>> nfroidure
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> 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
>>>
>>>
>>
>
>
> ---------------------------------------------------------------------
> 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
>
>

-- 
Cordialement, Nicolas Froidure, gérant, Elitwork SARL.


---------------------------------------------------------------------
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] Multi-level virtualhost inherit

Posted by Mark Montague <ma...@catseye.org>.
  You can also do what you want outside of Apache HTTP Server:  write a 
script that generates httpd.conf from one or more input files, and run 
this script (manually or automatically) before starting httpd.  You can 
use M4, CPP, Perl, or many other tools to generate the configuration 
file, depending on your needs.  This way you do not need to load any 
special module; but you should pick a tool that other people will also 
have who want to use your configuration.

--
   Mark Montague
   mark@catseye.org



On December 6, 2010 3:37 , FROIDURE Nicolas <fr...@yahoo.fr> 
wrote:
>         I want to stay on a "universal" Apache config. Now I know it's 
> impossible without enabling a specific module. I'll deal with this 
> restriction anyway.
>
>     Thank you Jorge.
>
> Le 05/12/2010 14:11, Jorge Schrauwen a écrit :
>> You may want to look at mod_macro, or mod_perl if you want really
>> complex setups.
>>
>>
>> ~Jorge
>>
>>
>>
>> On Sun, Dec 5, 2010 at 12:28 PM, Nicolas Froidure
>> <fr...@yahoo.fr>  wrote:
>>>              Hello!
>>>
>>>      Are there a way to make mutlti-level virtualhosts ?
>>>
>>>      I've many virtualhosts on my httpd.conf file. There are 3 
>>> "classes" of
>>> virtual hosts (static content, dynamic content with rewrite rules, 
>>> others).
>>>
>>>      I would like to be able to define more than one base 
>>> virtualhost for
>>> reuse them in my other virtualhosts. Is it possible ?
>>>
>>>      Thank you.
>>> ---
>>> nfroidure
>>>
>>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>


---------------------------------------------------------------------
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] Multi-level virtualhost inherit

Posted by FROIDURE Nicolas <fr...@yahoo.fr>.
         I want to stay on a "universal" Apache config. Now I know it's 
impossible without enabling a specific module. I'll deal with this 
restriction anyway.

     Thank you Jorge.

Le 05/12/2010 14:11, Jorge Schrauwen a écrit :
> You may want to look at mod_macro, or mod_perl if you want really
> complex setups.
>
>
> ~Jorge
>
>
>
> On Sun, Dec 5, 2010 at 12:28 PM, Nicolas Froidure
> <fr...@yahoo.fr>  wrote:
>>              Hello!
>>
>>      Are there a way to make mutlti-level virtualhosts ?
>>
>>      I've many virtualhosts on my httpd.conf file. There are 3 "classes" of
>> virtual hosts (static content, dynamic content with rewrite rules, others).
>>
>>      I would like to be able to define more than one base virtualhost for
>> reuse them in my other virtualhosts. Is it possible ?
>>
>>      Thank you.
>> ---
>> nfroidure
>>
>>
> ---------------------------------------------------------------------
> 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
>
>

-- 
Cordialement, Nicolas Froidure, gérant, Elitwork SARL.


---------------------------------------------------------------------
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] Multi-level virtualhost inherit

Posted by Jorge Schrauwen <jo...@gmail.com>.
You may want to look at mod_macro, or mod_perl if you want really
complex setups.


~Jorge



On Sun, Dec 5, 2010 at 12:28 PM, Nicolas Froidure
<fr...@yahoo.fr> wrote:
>             Hello!
>
>     Are there a way to make mutlti-level virtualhosts ?
>
>     I've many virtualhosts on my httpd.conf file. There are 3 "classes" of
> virtual hosts (static content, dynamic content with rewrite rules, others).
>
>     I would like to be able to define more than one base virtualhost for
> reuse them in my other virtualhosts. Is it possible ?
>
>     Thank you.
> ---
> nfroidure
>
>

---------------------------------------------------------------------
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