Ability to easily point subdomain document root

Followed all steps, did not work

Hi There,

I followed all the steps of the instruction, however the subdomain cannot be found.
However, I see that it has worked for the contents of the httpd.conf file has been changed accordingly.

What could be the reason the subdomains are not pointing to the new folder location?

Thanks
 
Hi Martynas,

Thanks for the scripts and edits. I'm a happy user :-)

An improvement on the script below would be to check if the "REMOVE DIRECTORY CONTENTS" checkbox has been checked:

Code:
#!/bin/sh
if [ $contents -gt 0 ]; then
    rm -rf /home/$username/domains/$domain/subdomains/$subdomain
fi
exit 0;

Last sub is a subdomain name, for example if you had ditto.mydomain.com, the full path to it would be /home/username/domains/mydomain.com/subdomains/ditto. Also, I forgot to add a removal script. The following needs to be added to /usr/local/directadmin/scripts/custom/subdomain_destroy_post.sh:
Code:
#!/bin/sh
rm -rf /home/$username/domains/$domain/subdomains/$subdomain
exit 0;
 
Hello,

This feature request has been in the versions system for quite some time.
http://www.directadmin.com/features.php?id=1007

However, it's not an easy fix as much of the way the templates are setup will break if we change variable structures for anyone who are using custom templates or the custom httpd config tool.
It might not be impossible, but if it's implemented, a completely backwards compatible setup would be required, which could be tricky.

John

Any news when it will be aviable in DirectAdmin? Still is missing default feature for me and my customer...
 
@iblinder Please double-check the screenshot link, it's not working.
 
Since my created Feature Request thread was locked, I will post my message here, since this is the only other Feature Request thread on this topic.

I am absolutelly shocked, that DirectAdmin still has not implemented "Document Root" feature. This should be listed as a priority.
I think sometimes programmers/CEO's of such software forget that the main reason of all this is to enable non-sysadmins to be able easily control their servers and websites. So giving us tens of commands and patching instructions - just doesn't do it.

I would like to request to implement a feature, which in cPanel has been for years - the ability to set Subdomain Document Root location (in fact ANY domain).

cPanel uses Addon Domain feature, which adds domains as a Subdomain of a main account Domain, with an option to specify Domain's Document Root path at the time of adding it. Default location being: /home/user/domain.com
When user adds a Subdomain it works in exactly same way - it gives an option to specify Subdomain's Document Root, with the default value being /home/user/subdomain.domain.com.
Keep in mind that user is allowed to change these paths/Document Roots to any name or any location under /home/user/.
When user creates an Alias to a main Domain, the Document Root just automatically points to main domain's public_html folder, which is at /home/user/public_html. And also that is the ONLY ONE public_html folder for a domain (there are none created for subdomains).
So everything is very simple and well organised.

DirectAdmin does not need to be exactly like in cPanel. If DirectAdmin prefers to keep current structure of domains which is:
/home/user/domains/domain.com/public_html
instead of:
/home/user/public_html
and allow every domain have it's own public_html folder, then that is perfectly fine, since it does give a great sense of organisation for Domains. Subdomains, on the other hand is different story.

I am using WHMCS for my billing needs and as it is known, the common way to reach billing site is by using Subdomain like billing.domain.com (which is in fact recommended way as well), but in DirectAdmin, when you add Subdomain, it's folder (Document Root) is placed INSIDE main domain's public_html folder and that means that the contents of subdomain will be reachable also with address like: www.domain.com/subdomain - and for most of the cases we don't need this at all.

There were people suggesting to add subdomain as a domain name, but that is not the best way of solving this problem as it creates more issues and more things to deal with, like unnecessary DNS Zones - I think most users, just like me would prefer having their DNS zones organised and all domain records kept in same Zone file. Also it, once again places billing software file in public_html folder of a new subdomain posing as domain name in DirectAdmin. Personally I prefer WHMCS files not to be in any public_html folder at all (not just few WHMCS folders that they recommend taking out from public_html), I believe that adds even more security for this, so the only way to change that in DirectAdmin is to have an ability to Set Custom Document Root for Subdomains (at least for Subdomains, since adding this feature for Domains as well, would require changing directory structure of DirectAdmin as mentioned earlier).

As far as my understanding is, to implement this feature we only need DirectAdmin to specify a PATH/LOCATION to created Subdomain Files Folder (which will be set by user at the point of adding Subdomain) on a system. No new public_html/public_ftp and so on needed. Just a setting for system to know where particular Subdomain's files are kept. Thats it.

Please consider this feature (https://www.directadmin.com/features.php?id=1007) as a priority.

What do other DirectAdmin users think about this?

Thank You.
 
Since my created Feature Request thread was locked, I will post my message here, since this is the only other Feature Request thread on this topic.

I am absolutelly shocked, that DirectAdmin still has not implemented "Document Root" feature. This should be listed as a priority.

/snipped/

Please consider this feature (https://www.directadmin.com/features.php?id=1007) as a priority.

What do other DirectAdmin users think about this?

Thank You.

As a shared/reseller hosting user, with most of the hosting providers (I've used) with cPanel, for me this would be a very welcome change - I'd call it improvement.
Also, if the "default" directory structure could be changed to the way cPanel does it: home/user/public_html, it would make website migrations to (and from) DirectAdmin a lot simpler for me (no need to edit any paths).

So far, as an "advanced user" (as objective as one can be about themselves), with quite some experience with creating, migrating, backing up websites (all using cPanel) I really am struggling with DirectAdmin. This is one of the things that would make my life easier, make me feel a lot more comfortable migrating back and forth - and that is important for me. That in and of itself is my problem, but I'm not sure how others are coping, whether hosting providers using DirectAdmin see an increase in support ticket numbers etc.


To comment on your second sentence (beginning of the quoted post). This is all based on my knowledge and presumptions - not working for DirectAdmin:
After the cPanel's price hike, DirectAdmin has surely seen a (unexpected) surge in the number of customers. New ones, ones that weren't planning on using it with the old cPanel pricing.
I would guess it puts an enormous load on both the customer support and developers (since each of users probably has an idea of what could be improved and how).
From my own experience with IT, changes often take a lot of thinking, planning and testing. It's better to do nothing, than do something wrongly, so it needs to be re-done again. It's often even more difficult when you already have a finished product that is up and running - especially if it is needed to make the transition so that the previous versions don't get messed up after the upgrade.
Personally, I'm not expecting this to be implemented ever, unfortunately - would be very pleasantly surprised if DA manage to pull it off.
Another thing to consider is whether they have a very good reason for having made it like that in the first place - it is beyond my level of expertise.

The most us, as customers, can do is provide feedback (as objectively as possible) and be patient.
I'm still sticking with cPanel for all the "important stuff". Waiting for most of the hosting providers to learn the ropes of the DA and also learning it myself (got a second reseller DA hosting, to see if there's much difference between particular hosting setups).
It is my impression that it will all be good (having a decent competitor to cPanel, with reasonable pricing so far), but it will take a lot of patience and hard work for both the customers, hosting providers and DirectAdmin team.
 
What do other DirectAdmin users think about this?
Never needed it, because it's very easy to create a subdomain as user and also use it like that subdomain.
The subdirectory made for the subdomain IS the subdomains root directory so that's easy to use and most directadmin customers do know this.
Probably the reason this is not a number 1 priority.

There are some special cases in which people want to have http://sub.domain.com not pointing to http://www.domein.com/sub for some reasons but we never needed this. It might be necessary in some cases I heard from former cPanel admins.

So I don't mind if it would be implemented, but I also don't mind if it doesn't.
 
I would actually like to see DirectAdmin fold the "Subdomain", "Domain Alias", "Domain Pointer" features all into a single "Domains" feature.

In DirectAdmin, subdomains cannot have their own secure certificate. With the way everyone is marching towards TLS every where, I figure this is an issue that needs to be resolved. But instead of actually "fixing" the Subdomain Management to allow for secure certificates to be installed... why not just fold all of this into a "Domains" feature, where you can use a subdomain "domain" or a total different full "domain" and specify where the DocumentRoot for that "domain" needs to be set to (which would allow you to create domain aliases that show the same content)... which I would probably just do with a symlink.
 
Never needed it, because it's very easy to create a subdomain as user and also use it like that subdomain.
The subdirectory made for the subdomain IS the subdomains root directory so that's easy to use and most directadmin customers do know this.
Probably the reason this is not a number 1 priority.

There are some special cases in which people want to have http://sub.domain.com not pointing to http://www.domein.com/sub for some reasons but we never needed this. It might be necessary in some cases I heard from former cPanel admins.

So I don't mind if it would be implemented, but I also don't mind if it doesn't.

One of the points of using a subdomain is to create some separation.
The way DirectAdmin does it now nullifies that option, since subdomain.example.com is visible in www.example.com/subdomain

It is a serious omission.

While I'm not sure why the main domain root isn't like "usual" - home/account_username (maybe there is a good reason for it I don't see), but it's hard to justify the way subdomains are set. We should have an option to choose where subdomains at least are stored.

Having said that, has anyone tried adding a subdomain like a domain (using the add domain option)?
Does it work fine?
 
Yes it does and you have all the funciotnality as if it was a domain (meaning email @subdomain.domain.tld, subdomains as sub.subdomain.domain.tld etc)

Having the domain root in /home/account_username makes things confused, having a domains subdirectory where all the user's domain are stored it's way more clean, specially if a user have multiple domains.

I do agree and I would like to have something like /home/account/domains/domain.tld/subdomains/subdomain/private_html
But I do also understand that changing this "standard" configuration after all those years and with many customizations done on the template (I for example have tons of custom templates) will require quite a bit of work for DA and for everyone who does customize his templates.

Said that, I wouldn't mind have to rework the template if the goal have dedicated subdomains folder and I believe we will gonna get there at some point :)

Best Regards
 
Yes it does and you have all the funciotnality as if it was a domain (meaning email @subdomain.domain.tld, subdomains as sub.subdomain.domain.tld etc)

Having the domain root in /home/account_username makes things confused, having a domains subdirectory where all the user's domain are stored it's way more clean, specially if a user have multiple domains.

I do agree and I would like to have something like /home/account/domains/domain.tld/subdomains/subdomain/private_html
But I do also understand that changing this "standard" configuration after all those years and with many customizations done on the template (I for example have tons of custom templates) will require quite a bit of work for DA and for everyone who does customize his templates.

Said that, I wouldn't mind have to rework the template if the goal have dedicated subdomains folder and I believe we will gonna get there at some point :)

Best Regards

Happy to hear subdomains added as domains work.

As for the directory structure, shorter is simpler and cleaner. For those using NTFS, it also makes copying files to and from the computer easier (because of the path length limit). IMO, having public_html directly in the root of user's account is perfectly clear, i.e. not confusing. At least it hasn't been for me. I know which domain is the main for the account.

Multiple domains aren't something I'd advise using within the same account (for isolation and security reasons), but when it is needed, don't see a problem of adding "public_html_example" at the root of the user's account.
 
Back
Top