Hallo,
ich habe auf meinem Server mehrere VHosts liegen, die ich bisher alle von Hand konfiguriere. Nervig ist das aber immer, wenn ich bei allen VHosts eine Einstellung ändern muss. Deshalb hätte ich gerne eine zentrale Config, die für die jeweiligen VHosts eingebunden wird. Also etwa so:
default.incl
ServerName ${Subdomain}${Domain}
ServerAlias www.${Subdomain}${Domain}
DocumentRoot /var/www/${Subdomain}${Domain}/htdocs
SuPHP_UserGroup ${Subdomain}${ServerName} ${ServerName}
<Directory /var/www/${ServerName}/htdocs>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
und für die vhosts dann nur noch
webmail_example_com.conf:
<VirtualHost *:80>
SetEnv Subdomain webmail.
SetEnv Domain example.com
Include /etc/apache2/vhosts.d/default.incl
</VirtualHost>
So funktioniert das allerdings nicht, weil Apache die Variablen nicht ersetzt. Wie geht das richtig? Oder muss ich tatsächlich pro vhost mindestens 6 mal den Domain-Namen eingeben: (ServerName, htdocs-Pfad, 2*log-Pfad, 2*ssl-Pfad etc.)?
Danke schon mal für die Hilfe,
Mike