httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Binyamin <7rai...@inbox.lv>
Subject [users@httpd] Common configuration-set for all VirtualHost's
Date Wed, 21 Oct 2015 22:05:47 GMT
בע"ה

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

Mime
View raw message