Changing the DocumentRoot for a subdomain

jlpeifer

Verified User
Joined
Jun 6, 2006
Messages
97
I have subdomain we'll call yadda.domain.com

I've installed a Web app within that domain that has it's own directory tree
Code:
/home/user/domains/domain.com/yadda/
/home/user/domains/domain.com/public_html/yadda/[B]assets[/B]/
/home/user/domains/domain.com/public_html/yadda/[B]bin[/B]/
/home/user/domains/domain.com/public_html/yadda/[B]public[/B]/

I need to be able to set the public directory above as the DocumentRoot for the yadda subdomain. I've attempted using the httpd.conf configuration page of DA to set the DocumentRoot, but the resulting path saved to DocumentRoot is always mangled in a way that it's unusable.

Example, inserting the following into the VirtualHost area...
Code:
|*if SUB="time"|
|?DOCROOT=/home/user/domains/domain.com/public_html/yadda/public|
|*endif|

Results in errors...
AH00112: Warning: DocumentRoot [/home/user/domains/domain.com/public_html/yadda/public/yadda] does not exist
AH00112: Warning: DocumentRoot [/home/user/domains/domain.com/public_html/yadda/public/yadda] does not exist

The script for modifying the DocumentRoot seems to be appending or inserting data to my request that results in an illegitimate path structure.

How do I get around this?
 
Add the "yadda" subdomain as a new domain (under the same user), not with the subdomains feature. That way the "yadda" subdomain has it's own config files and you can set the docroot very easily.
 
Now that's an elegant and simple solution Erulezz. Thanks for the input! It definitely got me further down the path. Have a good one!
 
Add the "yadda" subdomain as a new domain (under the same user), not with the subdomains feature. That way the "yadda" subdomain has it's own config files and you can set the docroot very easily.

Hello Reviving old thread, i have same question and i created new domain witha username.
I can access the default welcome scree, now i want to change document root to main domain. This is my setup so far:

Main Domain: domain.com

New domain under same user: sub.domain.com [this was entered as new domain not as subdomain under same user], there are other sub-domains under this account.

Now i want to change the document root of sub.domain.com to domain.com

Can you provide me with line of code that i need to enter in custom httpd configs to get desired results.

thansk
 
Last edited:
Back
Top