Organizing Home Directory


#1

Just wanted to see if there’s nothing wrong w/ organizing your user’s home dir from:

~/domain1.com
~/sub1.domain1.com
~/sub2.domain2.com
~/domain2.com
etc.

to…

~/www/domain1/domain1.com
~/www/domain1/sub1.domain1.com
~/www/domain1/sub2.domain1.com
~/www/domain2/domain2.com
etc.

Other than the path being long, any factors to consider? Just wanted to see how people w/ lots of sub/domains for a sole user organize theirs.

TIA


#2

If you really want to, that’ll work. You may specify the directory when creating your Fully Hosted (sub)domain.

I like the addition of the “www” subdirectory, as it somewhat mimics the Logs directory.

In my case, each Domain I create belongs to a separate User, so the domains aren’t all in the same directory, and easier to hand off management responsibilities.

If you prefer that all of your domains belong to one user, then your setup is very manageable and clean. In some cases, you may have to create a ~/www/domain1/data_dir/ folder for data you don’t want to have in your web space.

-Scott


#3

Thanks for the reply Scott. I do know what you mean about having other sub/domains for different Users be in charge of them.

There’s only been one instance that a subdomain has been granted to another user, but I guess its okay that it be on its default path “~/sub.domain.com”.

Anyways, thought I would just chime in to see what people do w/ the scenario where they want their home dirs to be clean.


#4

I agree with everything Scott has said, but I’d add one caveat regarding what you are describing even if the subdomains/domain are owned by the same user.

Depending upon what you install in those subdomains, you could be in for some tweaking (and potential attendant aggravation) as a result of clashing/conflicting rewrite rules or other .htaccess settings that might be harder to debug as you work your way up the directory tree because of the way .htaccess works and the way many popular web applications use it.

Keeping each subdomain “separate” and accountable to only its own .htaccess file can make this a less problematic, IMHO. :wink:

–rlparker
–DreamHost Tech Support


#5

@rlparker: You might have lost me for the last part (sorry). Could you further explain maybe w/ an example, or is it basically like the following?

~/www/domain1/domain1.com
~/www/domain1/sub1.domain1.com
~/www/domain1/sub2.domain1.com
~/www/domain2/domain2.com

?.. That is each sub/domain is installed in its own dir but just under the added “www/domain-basename/”

TIA


#6

I was just pointing out that you need to be careful to realize that, in the structure you described, any .htaccess file you place in “www/domain-basename/” would impact all domains/subdomains beneath that dir unless counteracted by another .htaccess file in that directory.

If you don’t plan to do that then, of course, my warning would not apply. :slight_smile:

–rlparker
–DreamHost Tech Support


#7

@rlparker: Oh yah, understood. The “domain-basename/” dir is just blank. Thanks for the reminder.


#8

I do my directory organization in a similar fashion but a little backwards from what you’re doing. Taking into account subdomains, my setup looks like:

/example.com/www/ for “example.com” and “www.example.com
/example.com/demo/ for “demo.example.com
/example.com/admin/ for “admin.example.com

…and so forth. This way allows me to simply pick a domain and backup all the subs in one shot so-to-speak. Works like a charm and makes using my chosen IDE a breeze.


#9

Right on. Just have to keep in mind those sub-dirs under domain.com aren’t folder themselves =)