Re: Reducing apache2 config files.
Marc Aymerich wrote:
> Hi all!
> In my ISP we have hundreds of virtual hosts like this:
I have no experience with a number like that -- our vhosts per server
are in the tens.
> <VirtualHost 188.8.131.52:80>
> DocumentRoot /home/pangea/user1/public_html
> ServerName domain1.org
> ServerAlias www.domain1.org www.domain2.org domain2.org
> CustomLog /var/log/apache2/virtual/domain1.org common
> SuexecUserGroup user1 group1
> Action php-fcgi /fcgi-bin/php-fcgi-wrapper
> Alias /fcgi-bin/ /home/httpd/fcgi-bin.d/php5-user1/
> ScriptAlias /cgi-bin/ /home/pangea/user1/cgi-bin/
If the requirements can differ slightly from vhost to vhost you might
also have a look at mod_macro.
It is flexible an works reliable.
The downside compared to a solution that generates a file is that I
don't know of a way to view the configuration with expanded macros
which makes debugging the macros hard.
The downside compared to mod_vhost_alias and mod_rewrite is that you
have to add a configuration line for every vhost -- but for your
example this could be one line.