Subdomain location

notexa

New member
Joined
Sep 26, 2007
Messages
3
Currently all subdomains for a specific url are created in the root dir. Is it possible to change certain files so that subdomains for that domain are created under /subdomains/... ?

If so, what do I need to change ?

Thanks.
 

Snookieboy

New member
Joined
Jan 3, 2008
Messages
2
Got the same request here, All the folders in the root are messy and Cpanel allows it fine. The only way I can see is going through the apache http config and changing it all there, but that seems overkill for something DirectAdmin should be able to do itself.
 

jlandes

Verified User
Joined
Dec 1, 2005
Messages
624
Location
Lewistown, Pennsylvania, USA
Search the forums, this has been asked multiple times. It is very difficult to change the location where subdomains are created. I wish that it could be changed through DA, but I have not had any successful luck in doing so.
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
8,937
Hello,

To change the path, use this guide:
http://help.directadmin.com/item.php?id=2

Except only do it for the 2 subdomain conf files instead of the 4.

Then change the DOCROOT value to what you want.
That's for a global change.

If you only want to set the subdomain paths for just 1 domain, then use this guide:
http://help.directadmin.com/item.php?id=3
except, use:
Code:
|*if SUB|
|?DOCROOT=/new/path/you/want/`domain`/`SUB`|
|*endif|
John
 

jlandes

Verified User
Joined
Dec 1, 2005
Messages
624
Location
Lewistown, Pennsylvania, USA
John,

I have attempted this before, but DirectAdmin still creates the subdomain in the public_html folder and not in the path that is specified in the httpd.conf file. Am I doing something wrong?
 

RadMan

Verified User
Joined
Apr 12, 2007
Messages
209
Location
Canada
John..

There is another problem with having subdomains being created in the public_html folders and that is "duplicate folder titles"..

I just created one that already had the same folder name in the root directory..

Damn good thing I caught it and changed the name of the existing folder because it would have deleted half a website if I had deleted the subdomain using the Control Panel..

As we know you cannot create a duplicate folder name in the same directory but according to the Subdomain Management panel, the subdomain was created anyway...

Creating a subdomain outside the root folder should have been a "given" right from the getgo so that one can treat the subdomain as a semi-separate entity and not as an additional folder in the primary domain name.. :(

As the primary developer of this software, I'm wondering why you set it up this way in the first place???

Ed
 
Last edited:

jlandes

Verified User
Joined
Dec 1, 2005
Messages
624
Location
Lewistown, Pennsylvania, USA
RadMan,

I agree with you. Not only for the reason that you mention but also because when subdomains are created in the public_html folder, it tends to get rather crowded. I wish that I could successfully change the location where my subdomains are created, but cannot find a way that works correctly. :(
 

RadMan

Verified User
Joined
Apr 12, 2007
Messages
209
Location
Canada
Subdomain bug.

All I want is for my customers to have the ability to create a subdomain using the existing feature in the control panel..

I don''t want to reconfigure the server, change the DNS, alter the paths or check something called BIND which I know nothing about...

Furthermore, the average website owner wouldn't know what the hell to do neither, nor should he have to as all that 95% of them want to do want to do is to keep it simple stoopid so they can get a website online without a minimal effort...

Ed
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
They can have all of that by creating the subdomain as it's own domain.

Jeff
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,902
Location
GMT +7.00
Oh, eh... Nothing difficult to set subdomains in any other place within user's homedir)))
With the help of PRE and POST scripts.
 

felosi

Verified User
Joined
Jun 17, 2006
Messages
152
wow, Directadmin still hasnt got this yet? I went and signed up a client the other day, he asked about this feature. I knew cpanel has it so Im like surely DA has it by now and it doesnt!

What a very simple and basic feature to be lacking. Not to mention quite a few users need this feature, its not like its some special oddball thing
 

floyd

Verified User
Joined
Mar 29, 2005
Messages
5,285
Go to Domain Administration, click Add Another Domain, put the subdomain in the textbox, click Create. Subdomain will have its own directory under the username/domains.
 

__co__

Verified User
Joined
Sep 5, 2006
Messages
39
We had the same question today. Creating a separate domain for a subdomain is an option, but I would consider this overkill if you only want to place HTML data on that subdomain. Creating it as a seperate domain only makes sense imo if you also want to use mailfacilities with '@sub.domain.com' adresses.

Placing the subdomain as a directory under the public_html is a point of discussion, I would say that this is not the best practise for the following reasons:

1) As mentioned above, it 'clutters' the public_html
2) Risk of potentially deleting the subdomain folders. One (not just n00bs) would not expect the directories to be the containers of the subdomain data.
3) Not be able to use subfolders in the URL which match a subdomain name without using an htaccess rewrite rule
4) Risk of bypassing possible security/php settings since the subdomains are also available under 'domain.com/sub'. I already saw something similar when using 'serveraddress/~username'. It will bypass settings which are defined in apache's virtualhost container for the subdomain.

Anyway, guides to change the default location are available. Although the feature is not available within DA's gui, you should be able to serve your clients in their specific needs. I can anyway.
 

floyd

Verified User
Joined
Mar 29, 2005
Messages
5,285
I don't see it as being overkill because the only thing that is extra in a regular domain that is not in a subdomain is the mail. Everything else I can think of is the same.

For both:
Directories have to be created.
DNS entries have to be made.
HTTP configurations have to be done.

The only difference I see is mail.

But yes what one want to do is easily done if directions are followed. If people put half as much effort in following the directions as they do in complaining about this they would save a lot of time.

I am not sure what you mean by "if you only want to place HTML data on that subdomain."
 

__co__

Verified User
Joined
Sep 5, 2006
Messages
39
What I mean is if you only want to serve a webpage on the subdomain, no email, no child subdomains (sub.sub.domain.com), no FTP-accounts etc.

Yes, DNS-entries have to be made, but for a single subdomain this only is a host-record in the parent zone. If you create a new domain for a subdomain, an entire new zone is created.
 

floyd

Verified User
Joined
Mar 29, 2005
Messages
5,285
The difference in time it takes DA to create it as a subdomain and a regular domain is negligible. There is no detectable extra load on the server. The extra space used is very little. I don't see a real difference. IMHO its certainly not worth doing any custom configuration.
 

felosi

Verified User
Joined
Jun 17, 2006
Messages
152
I think the issue is specifyying a custom location for the subdomain crating a new domain with subdomain will still place it in a system defined directory that you cannot modify. I think you got off on something else with the adding domains thing. It doesnt matter. the ability to specify a custom location for a subbdomain is the issue
 

floyd

Verified User
Joined
Mar 29, 2005
Messages
5,285
crating a new domain with subdomain
You don't create a new domain with subdomain. You create the subdomain AS a regular domain. That will solve the problem of keeping the subdomain separate from the regular primary domain.

will still place it in a system defined directory that you cannot modify.
Absolutely not true. http://help.directadmin.com/item.php?id=2
You can do this for all the template.

the ability to specify a custom location for a subbdomain is the issue
Yes we know. The OP said:
Is it possible to change certain files so that subdomains for that domain are created under /subdomains/...
DA Support replied with the same link I just gave you. The question has been answer with two options.

If you want end users to be able to specify subdomain directories themselves and stuff anywhere then no that is no possible nor is it a good idea. It creates a big mess of things for you when you have to try to figure out what they did when they have a problem.
 

felosi

Verified User
Joined
Jun 17, 2006
Messages
152
man you still have not read this thread I dont see why you are replying wit this same crap everytime. The issue is specifying a custom location as USER!!!! Just like cpanel's subdomain feature . No one is talking about editing no stupid templates as root.

People want to be able to for their users to specify a subdomain location like in cpanel. Simply read instead of filling your reply box up and hitting the button so fast

I give up anyway even directadmin support dont understand it so I doubt it will be implemented soon
 

floyd

Verified User
Joined
Mar 29, 2005
Messages
5,285
The issue is specifying a custom location as USER!!!!
That was never made clear. But I did cover that in my last post. Its not a good idea as it can confusing things greatly. But if you still want to do it then it can be done.

Just like cpanel's subdomain feature
How would I know what Cpanel does. I don't use that Cpanel crap. Making a comparison to Cpanel is not going to help you much since most of us here don't use it.

And stop being so rude or you won't get help from anybody.
 
Top