Common configuration-set for all VirtualHost's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



בע"ה

Hello,


Does Apache (httpd) has compatibility to define configuration-set for all VirtualHost's like:


# Define common configuration-set fort all VirtualHost's and any port:
#
<VirtualHost _default_>
    AllowEncodedSlashes On

    <IfModule rewrite_module>
        RewriteEngine On
        RewriteOptions Inherit
    </IfModule>

    # Make it even more generic with "variables":
    ServerAlias www.%{ServerName}
    <Directory %{DocumentRoot}>
        php_admin_value open_basedir %{DocumentRoot}
    </Directory>
    <Directory %{DocumentRoot}/*>
        AllowOverride None
    </Directory>
</VirtualHost>
#
# Common configuration-set for specific port 443:
<VirtualHost _default_:443>
    SSLEngine on
    SSLCertificateFile "server.crt"
    SSLCertificateKeyFile "server.key"
</VirtualHost>
#
#
# And here comes real servers (with ServerName and DocumentRoot) where the configuration-set will apply to them
#
<VirtualHost _default_>
    ServerName domain.com
    DocumentRoot /domain

    # In case if want to differ the common configuration-set configuration:
    <Directory /domain>
        php_admin_value open_basedir /domain/assets
    </Directory>
</VirtualHost>
<VirtualHost _default_>
    ServerName domain2.com
    DocumentRoot /domain2
</VirtualHost>


If there are no incompatibility for that, then I propose to add it!
The problem: without this compatibility the VirtualHost's configuration file is very long while having many VirtualHost's and the same or similar configuration for all VirtualHost's.



Binyamin

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux