Boyle Owen wrote:

is it possible to configure Apache2 to serve the contents of a directory, in a way so the first level of the structure serves as the name of a subdomain?

I don't see the problem. This is exactly what apache does by default. The 
DocumentRoot directive maps the base URL of the site (bar.myhost.mydomain) onto a 
filesystem path (/var/www/bar) then any additional path information in the URL is 
simply appended to the DocumentRoot (bar.myhost.mydomain/path/ --> 
/var/www/bar/path/)

What have you tried? What went wrong? (include error-log messages)...

Both Debian and Ubuntu install a default mapping (/etc/apache2/mods-available/default) that looks like the following:

NameVirtualHost *
<VirtualHost *>
        DocumentRoot /var/www/
        <Directory />
                [...]
        </Directory>
        <Directory /var/www/>
                [...]
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                [...]
        </Directory>
</VirtualHost>

This maps as follows:

mydomain.tld --> /var/www/
mydomain.tld/foo --> /var/www/foo/
...and so on...

Which directive do I have to change in order to get the "default" behaviour, as you said?

Regards,

Andreas


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to