Moving the document root

Illarane

Verified User
Joined
Mar 10, 2009
Messages
31
Moving the document root away from /home/username

Hi,

My boss has decided that he wants a graphical control panel on our servers, and since we use Debian, DirectAdmin and Webmin (ahaha!!) seem to be about the only thing we can use. We installed DirectAdmin on one of the boxes, and have hit a snag.

DirectAdmin wants to put domains in /home/username/domains/domain.tld, but our web root is located on a different partition (makes backups easier, and means that we can re-install the OS if necesary without having to work around the web root) and domains go into /www/vhosts/subdomain.domain.tld.

Is it possible to reconfigure DirectAdmin so that it will work with this layout?

Thanks,

Ben.
 
Last edited:
you can change it to like /www/vhosts/username but I dont think /www/vhosts/domain
 
Most of us just put /home on it's own partition. Is there a reason that doesn't work for you?

Jef
 
Most of us just put /home on it's own partition. Is there a reason that doesn't work for you?

Jef

Hi, Jef,

We're installing it on a pre-existing server, so it's got a lot of stuff that's already been set up on it that we can't really move without a lot of time and pain. Also, we're not using it to manage reseller hosting, which is what it's apparently designed for, so we'd like to change the software to work with us, rather than the other way round. ;)

Ideally, we want all domains set up on the box to show up in each other's DirectAdmin accounts (this might not be possible, I gather) and for them all to do in to /www/vhosts/domain.tld so that they are all in one place, rather than loads of different places.

Does that make sense? :/

Ben.
 
Does that make sense? :/
I guess it does to you :D.

I've not studied it to see if you can do it or not. In general DirectAdmin is quite flexible; if you can do it without DirectAdmin, then go ahead and set up an example structure, and post it, and perhaps either I or others who read and post here can figure out if DirectAdmin can do it.

Jeff
 
Hehe, OK.

Our domains are laid out like this:
Code:
/www
    /vhosts
        /www.foo.com
            /httpdocs
            /logs
            /cgi-bin
            /tmp
            /sessions
        /www.bar.com
            same as www.foo.com
        /subdomain.bin.com
            etc

Basically, I want to keep the same layout but make DirectAdmin control the creation and management of each domain. Also, if possible, can I change the template used to generate the vhost config files? We've made a load of tweaks to our ones for general security and PCI DSS-compliance reasons, and DirectAdmin doesn't seem to know anything about that. ;)

If it is possible to do this, I'd be really grateful if someone could point me in the right direction. :)

Thanks,

Ben.

Edit: Just a quick note: We put /home on its own partition as well. It just makes things a lot easier to back-up and manage.
 
Last edited:
Oh, the other thing was whether or not it's possible to get DirectAdmin to use the Apache bundle that comes with Debian rather than the one it downloads? This one probably isn't possible, but it'd be nice if I could get it to tie in neatly with the OS rather than asserting itself over it. :)

Edit: And I've just noticed that DirectAdmin doesn't point https connections at the same place as the http connections. I assume this is in the vhost template file, wheresoe'er that is?

EditEdit: Found the templates. :) Just trying to figure out if changing ?DOCROOT in the conf files will make DA put stuff into different paths or not...

EditEditEdit: OK, I've created custom virtual_host2*.conf files and put them in, but changing the DOCROOT token in there doesn't make DirectAdmin create the new domain's directories in the right place. How can I get this bit to work? It doesn't seem to be in the KnowledgeBase. :/ (Maybe I'm looking for the wrong keywords...)
 
Last edited:
You are going to have to use domain_create_post.sh to do this and probably more.

If you continue along this line of thinking you are going to have more trouble and nobody here is going to be able to help you because you have broken away from the standard.
 
Is there any documentation for post_domain_create.sh? I.E.: Where it's supposed to go? Searching for it on the forums returns no hits, as does a search on the Knowledgebase. :/
 
"Sorry - no matches. Please try some different terms.

The following words are either very common, too long, or too short and were not included in your search : domain_create_post.sh"

Edit: OK, found the readme at /usr/local/directadmin/scripts/custom/README linked from something unrelated I found on Google by chance. Is there any chance this file can be put into the Knowledgebase or something?
 
Last edited:
Ok, now my subdomain_destroy_post.sh script is causing an "Error removing subdomain(s)" page to appear even though there's no error in the script, and I can't find anything on this happening in Google. Any ideas?
 
How do you know there's no error in the script? Have you subjected it to peer review?

And ... as Floyd has written (above) you're putting yourself in a position where no one will be able to help you as you've strayed so far from the DirectAdmin standard.

I'm positive that we or other experienced Linux/Unix administration companies can figure it out, but because you've strayed from the standard I'm just as sure that it will be very expensive and may take you further away from the standard.

For example, once you've made a lot of custom templates, are you aware that those templates will NEVER be updated. That may or may not be important to you, but overtime it creates a support nightmare.

Jeff
 
How do you know there's no error in the script? Have you subjected it to peer review?

And ... as Floyd has written (above) you're putting yourself in a position where no one will be able to help you as you've strayed so far from the DirectAdmin standard.

I'm positive that we or other experienced Linux/Unix administration companies can figure it out, but because you've strayed from the standard I'm just as sure that it will be very expensive and may take you further away from the standard.

For example, once you've made a lot of custom templates, are you aware that those templates will NEVER be updated. That may or may not be important to you, but overtime it creates a support nightmare.

Jeff

The vhost templates aren't really an issue, to be honest. As long as we check them occasionally to make sure that the syntax of the variables hasn't changed, we should be able to cope with those.

I know there're no errors in the script because it parses correctly, and I've tested it manually with various valid and invalid values in the environment variables. Unless there's something extra which I've missed in the script which tells DA that there's been a successful execution and it's done everything correctly, it should be working fine. Instead, I'm getting an error page with a blank error message in it (It just says "{subdomain-name-here}:" and nothing else).

On the straying from the standard note, this isn't that drastic a change. All I've done is told it to use a different docroot in the vhost config and attempted to get it to create the directories n the right place. It shouldn't really be this difficult, but it's obvious from the start that DA is intended more as a control panel for reseller systems than general domain management. That said, a vhost_path=/home/|USERNAME|/domains/|DOMAIN| entry in options.conf or similar would be nice. :)
 
Hello,

To search the versions system, you go to www.directadmin.com and click "view version history". You then get a search field like so:
http://www.directadmin.com/versions.php

This is where all new features and fixes are listed and is the best place to get the docs on how something works.

The knowledge base:
http://help.directadmin.com
is for commonly asked questions and how-to's for the usage of some of these features.

The bulk of my support email replies usually contains links to one of these databases.

John
 
'cause it's pants. ;)

I don't know what that means.

You probably need to learn how to use the search tools. Search tools cannot be customized for individual's search methods. People using the search tools need to learn how to use them.
 
Back
Top