Issue
I want to be able to include multiple virtualhost files into httpd.conf. I know that it's possible to include one using something like:
However, I want to be able to import all virtualhost files within a certain directory, without needing to hardcode the include statements. Is there an appropriate command/syntax for this? I know the directory and have a suitable regular expression:
^.+-[0-9]+\.txt
Solution
The syntax of the Include directive is the following:
Include file-path|directory-path|wildcard
You can do for example:
Include /usr/local/apache2/conf/vhosts/dom1-*.conf
to include all configuration starting with dom1-
from the directory /usr/local/apache2/conf/vhosts/
. Note that you can use wildcards but you cannnot use a full regex.
Answered By - Ortomala Lokni Answer Checked By - Marie Seifert (WPSolving Admin)