Create subdomains that won't appear in my rootdomain?

dataMerge

New member
Joined
Jul 13, 2007
Messages
2
Hi,

Is it possible to create subdomains that won't appear in my rootdomain folder?

Very powerful this DirectAdmin. However, there's one thing that bothers me very much. When I create a subdomain it appears as a folder in the 'root' domain while I want to host my rootdomain and subdomains separately. I'm working on these domains from several computers, so I have to synchronise regularly. Synchronising the rootdomain from the remote server it will download the subdomain folders as well because they are not present on my local rootdomain. But more dangerous: synchronising the rootdomain from my local station (delete remote files not pesent on local site) it will probably delete all the subdomains.

I worked with other providers and they had the subdomains in a separate 'subdomains' folder not IN, but ON THE SAME LEVEL as the publuc_html folder.

Is there a way out here?
dataMerge
 
I don't believe there is a way to do this, without making a lot of modifications to the Apache configs. I moved from a server where all my subdomains were separate from the domans public_html data, so this is different for me too. I would also like to have the subdomains be outside of my domains data because I have a lot of subdomains setup for friends and family.
 
Two ways to do it:

1) set up the subdomain is if it were a domain. In other words allow multiple domains in a user account, then set up a separate domain under that user.

2) Create a subdirectory public_subdomains at the same level as public_html, change the template so the subdomain directory will be set up in that directory instead of inside public_html, and create a separate ftp login.

Method one seems a bit easier to me :) .

Jeff
 
Thanx!! Now we're getting somewhere!!

Can you tell me which template I have to change (question of my provider)?

dataMerge
 
As Jeff said option 1 is easier and it will also allow you to use email with that subdomain.
 
Can you tell me which template I have to change (question of my provider)?

If my understanding of the template system is correct, login to the server as the root user, then do the following:

Code:
cp /usr/local/directadmin/data/templates/virtual_host*_sub.conf /usr/local/directadmin/data/templates/custom
cd /usr/local/drectadmin/data/templates/custom

Now, edit each file to change the document root. For example:

virtual_host_sub.conf:

Code:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|

As Floyd said, option #1 is going to be the easiest method. However, I think I'm going to try and modify the templates, if it's confirmed that I would be doing this correctly. More info can be found here:

http://help.directadmin.com/item.php?id=2

Hope this helps.
 
OK, I followed instruction on this page

http://help.directadmin.com/item.php?id=2

and looks like it works, except when I create subdomain it's still created in public_html folder. I would like to be created in folder that I specified in virtual_host conf file. I think that this could be changed in script that creates subdomain, but I can't find it. :confused:

Ohh, another question. I copied and changed both virtual_host_sub.conf and virtual_host2_sub.conf. Is that OK, or it's enough to copy just one (1st, I assume)?

Thank you
 
and looks like it works, except when I create subdomain it's still created in public_html folder. I would like to be created in folder that I specified in virtual_host conf file. I think that this could be changed in script that creates subdomain, but I can't find it. :confused:

I did the same thing, and DA is creating the subdomain in the public_html of the main domain. It seems to me that DA should be reading the templates and making the dirs in the specified places. Otherwise, what is the purpose of these templates?

DA, please complete the knowledgebase document with the information required to have the whole job done correctly and automatically when we create subdomains with custom templates.


Ohh, another question. I copied and changed both virtual_host_sub.conf and virtual_host2_sub.conf. Is that OK, or it's enough to copy just one (1st, I assume)?

I changed it in both of mine, too. I have no idea why there are two of them in there. If you're going to use secure subdomains, then I imagine you need to make corresponding changes there, too.

Cheers,
Rick
 
Subdomains created by DirectAdmin as subdomains will always be created as a subdirectory in the main domain; they don't even care about the templates.

To customize where you put a subdomain you must create it as if it were a main domain.

Jeff
 
To customize where you put a subdomain you must create it as if it were a main domain.

I don't quite understand this. You mean that I should create subdomains as domains. That's OK, but I just don't want to do this. I'll rather create subdomain maps myself.

Is it possible to comment out (or something like that) part of the code that actually create subdomain map? If yes, where can do this?

That would be great, because I wouldn't have to check if map is subdomain (empty) or it's something else.

regards
 
Yes that's what I mean.

If you don't want to do it, then fine, but given the way DirectAdmin has set up the subdomain system, if you don't want to do it, you're on your own.

There's no user-visible code for DirectAdmin; it's a compiled C++ program; you may be able to figure out a combination of your own skins and custom code.

Jeff
 
Back
Top