httpd-users mailing list archives

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


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

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

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

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.


View raw message