# Using apache DocumentRoot as variable in httpd.conf itself

## gsxr1300

Hi,

it's not a gentoo specific question, but we use only gentoo on about 200 servers, so i may ask here in the right place anyway  :Smile: 

To make it a bit easier for our programmers we would like to reference to the location of the DocumentRoot in the httpd.conf of the Vhost where definde some lines above.

Example:

```

<VirtualHost *:80>

   ServerName     admin.doma.in

   LogLevel       warn

   ErrorLog       /var/log/apache/admin.doma.in-error.log

   CustomLog      /var/log/apache/admin.doma.in-access.log combined

   Options        FollowSymLinks

   AccessFileName .htaccess

   DocumentRoot   "/www/admin.doma.in/htdocs"

   DirectoryIndex index.html index.php3 index.php

[...]

   include %DOCUMENT_ROOT/../<oursoftware>/etc/rewrite.conf

   Alias /tmp/ %DOCUMENT_ROOT/../var/tmp/

```

I've search apache.org (and other sites of course) but could not find the right way of usage. I don't even know what would be the right variable name (%DOCUMENT_ROOT above)

I only found the usage in CGI/Perl-scripts invoked by the apache user.

Is there any possibility to reach my goal or am i completely wrong?

Thanks,

  Ruediger

----------

## richard.scott

This may help:

http://httpd.apache.org/docs/2.0/vhosts/mass.html

It automatically changes the document root depending on the domain name used.

----------

