アクセスに使用したホスト名に基づいてすべてのリクエストを動的に処理できる単一の仮想ホストを設定したいと思います。%{HTTP_HOST}をDocumentRootで使用できる場合、これはおそらくまさに私が望むものです。
<VirtualHost *:80>
ServerAdmin me@example.com
DocumentRoot /var/www/live/%{HTTP_HOST}/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/live/%{HTTP_HOST}/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel warn
ErrorLog /var/www/live/%{HTTP_HOST}/logs/error.log
CustomLog /var/www/live/%{HTTP_HOST}/logs/access.log combined
</VirtualHost>
...残念ながら、%{HTTP_HOST}はDocumentRoot(Warning: DocumentRoot [/var/www/live/%{HTTP_HOST}/public] does not exist
)では許可されていません。他にどのように私は私の目標を達成することができますか?
更新: キャッチオール仮想ホストを単一のディレクトリにポイントし、.htaccessでmod_rewriteを使用してパスを動的に選択することを考えましたが、(正直なところ)疲れ果てています。朝にまたやってみますが、それまでの間、いいアイデアがあればぜひ聞いてみたいです!ありがとうございました!