PDA

View Full Version : Multiple (add-on) domains, best practice?



ericc72
11-25-2007, 06:27 PM
I just got a bluehost account, and am happy with it. I do have a couple questions though after having dug into the file system and added a few add-on domains:

It appears that my main domain (the one that I registered at time of bluehost sign-up) has the document_root at ~/public_html/. Is there anyway to change this, or is this where it stays?

Related (and more importantly), add-on domains appear to only be able to have their document_root somewhere under ~/public_html/, with the default being ~/public_html/addondomain.com/.

I want to keep my ~/public_html/ folder clean, so I created a folder there called "_domains" in my ~/public_html/ folder so that I could put my add-on domains in this folder (i.e. ~/public_html/_domains/addondomain.com/). The reason for this is that I wanted to keep any proliferation of add-on domain separate from my main domain files.

Are there any best practices as to how to organize my folder structures if I plan to host more than a few domains? I don't plan to go overboard, but I would like to keep it all clean and well-structured.

Any suggestions appreciated. Thanks.

Early Out
11-25-2007, 06:33 PM
Are there any best practices as to how to organize my folder structures if I plan to host more than a few domains?Yes. Stick to the default structure. Your main domain's files go in public_html. Each addon domain or subdomain gets a subdirectory under that, like publ1c_html/addondomain, public_html/subdomain, and so on. There is really no reason to stray from this structure, unless you want to spend all your time wrestling with .htaccess problems.

There is no reason to keep your public_html directory "clean" - it's there for a reason, so why fight it?

ericc72
11-25-2007, 06:59 PM
Thanks Early Out.

I think I will need to delete my add-on domains, and re-add them on to get the proper structure set up per your post. I guess it isn't going to make my public_html directory that hard to navigate or anything, and I'd much rather have a functioning structure than trying to mess with it.

Can all domain folders (add-on or sub) have their own .htaccess, fastphp.ini, and php.ini files? As far as I can tell, all folders that have PHP files need the php.ini file (well at least if you change the default I guess). fastphp.ini file states it should be changed via control panel. And my .htaccess file in ~/public_html is empty, but I suppose that is the default and I will not mess with until I need to (and do my homework on Apache).

Can I delete the server error files when I set up a new domain (40X.shtml, etc.), or should these stay? And the cgi_bin folder appears empty in add-on domains, but is populated with some scripts in my main domain folder.

And what uses the .smilies folder? I know they are all PNG smilies, but just not sure what uses them.

Thanks to anyone who has any answers to these questions, and thanks for the patience as I get myself up to speed on my BlueHost account.

felgall
11-25-2007, 08:23 PM
Each folder can have its own .htaccess and php.ini
You can only have one fastphp.ini for the whole account.

If you have your own error files in a different location for all the different errors then you could delete the error pages but it wont hurt anything to just leave them there, it isn't like they are using any signigficant amount of space.

You only need to worry about what is in which cgi-bin if you are going to actually use Perl scripts in which case they should go in the one for the appropriate domain or dubdomain that is going to use it.

huggies
07-18-2008, 10:36 PM
Related to this thread, my main domain (only have the one so far) is at the root of /public_html. I'm about to add an add-on domain as per the instructions in this thread (and others).

However, my main domain has password protected the public_html root, and I do not wish the add-on domain to be password protected.

In other words
~/public_html/xxx -> password protected EXCEPT
~/public_html/add_on_domain/xxxx -> This I want to be public.

I originally had the main domain password protected via cpanel's "password protect directories" functionality. I'm sure that in turn set the .htaccess appropriately.

If anyone can assist me with learning how to modify cpanel settings, or .htaccess such that I keep my main domain behind password, but open up my add-on domains, I'd be much appreciated. I'm a novice at modifying .htaccess

Don't mean to thread-hijack either...this thread seemed appropriate. Please let me know though and I can start a new thread.

Much thanks!