1

My virtualhost configuration file sites-available/site.conf contains (some lines omitted):

<VirtualHost *:443>
  <Directory /var/www/html/my_website>
    # set options
  </Directory>
</VirtualHost>

This sets the options in my_website directory. I can do the same with a Define directive:

<VirtualHost *:443>
  Define website /var/www/html/my_website
  <Directory ${website}>
    # set options
  </Directory>
</VirtualHost>

But if I try the same with an Apache server variable %{DOCUMENT_ROOT} the options are not set:

<VirtualHost *:443>
  DocumentRoot /var/www/html/my_website
  <Directory %{DOCUMENT_ROOT}>
    # set options
  </Directory>
</VirtualHost>

Why is %{DOCUMENT_ROOT} not working in this case?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.