Default document root for new domains

marson

Verified User
Joined
Jan 30, 2012
Messages
53
Hello

Is it possible to change default DocumentRoot for new domain. what I mean is that default docroot is /home/user/domains/domain.com/public_html but I want to use /home/user/domains/domain.com as a documentroot without public_html. I know that I can change the documentroot for every domain separately but is it possible to change default document root with the above structure for new domains?
 
Just out of curiosity? What is the benefit of jumping out of the default? As every domain has it's own public_html anyway.

To also answer your question, you can create a custom virtualhost file and change the default docroot. Scroll down a bit here.
 
Additional issue with doing what @marson is proposing, it will expose directories that should not be accessible from the web (logs/stats/public_ftp).
 
Because client want this ;) I argue the same as you but... "On other hosting I had everything at domains/domain.com and I want to have as it was earlier"
 
Lol. If a client says that to me, I would answer with "well, you have to use public_html, we do things in a secure way here to prevent hacks and abuse of customer accounts and the system.
If other hosters want to be stupid, it's their choice, we don't do that here as wel as most hosters won't because of security". If he then wants another host then, oke goodbye and good luck finding one which does this.

But thank you for satisfying my curiosity. ;)

Maybe there is a workaround to keep things safe, not sure if this is possible, use custom public_html but just rename it to domain.com. This would create /home/user/domains/domain.com/domain.com where the last domain.com is in fact the docroot.
But again... I'm not sure if that is possible this way.
 
Lol. If a client says that to me, I would answer with "well, you have to use public_html, we do things in a secure way here to prevent hacks and abuse of customer accounts and the system.
If other hosters want to be stupid, it's their choice, we don't do that here as wel as most hosters won't because of security". If he then wants another host then, oke goodbye and good luck finding one which does this.

But thank you for satisfying my curiosity. ;)

Maybe there is a workaround to keep things safe, not sure if this is possible, use custom public_html but just rename it to domain.com. This would create /home/user/domains/domain.com/domain.com where the last domain.com is in fact the docroot.
But again... I'm not sure if that is possible this way.

The client have a managed VPS, not an shared hosting so he have only his website, so it doesn't impact other clients. however when I told him that we wil not support in case of problem then... OK I will use public_html directory ;)
 
Back
Top