Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a set of virtual hosts that need separate vhost definitions for *:80 and *:443. After creating these, I've found that I've got 20-40 configuration parameters that both *:80 and *:443 share; Is there a way to specify these once and have them shared, rather than twice (once in each VirtualHost definition?)

share|improve this question

2 Answers 2

Just create a separate config file fragment containing the shared directives and Include it from both virtual host definitions. (Make sure it's placed someplace where Apache won't try to include it by itself, like it would a .conf file in a conf.d directory.)

share|improve this answer

Rewriting in Virtual Hosts

#By default, mod_rewrite configuration settings from the main
#server context are not inherited by virtual hosts. 
#To make the main server settings apply to virtual hosts, 
#place the following directives in each <VirtualHost> section:
#
RewriteEngine On
RewriteOptions Inherit
#   
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.