Removing/Omitting VirtualHost entries from directadmin

peach

Verified User
Joined
Feb 15, 2009
Messages
19
Hi

I'm creating a Drupal multisite setup which involves custom virtual host entries in httpd.conf, with multiple domain names pointing to the same documentroot.

The problem is that DirectAdmin creates its own virtual host entries automatically in the data/users/admin/httpd.conf file and this file updates everytime you save domain name properties, so theres no point in deleting it their.

How can I prevent the vhosts entries from being generated for "some domains" on my setup, without having to stop having the domains in DA (I still want to use email and SSL from Direct Admin). Maybe it can be done with a custom virtual host template that uses a conditional to check if the domain is special, and then write to entry. is this even possible?
I dont know much about this type of scripting, its my first server.
 
In BSD you can use 'chflags' to set the system immutable flag for the file, so not even root can overwrite it. Linux probably has its own version of this.

I requested, many years ago, a DA feature of custom templates on a per-user basis (per-domain in effect) , but don't think it was ever taken up.
 
chattr

Thx! I've learned that linux has a command called chattr that makes files immutable. This is a sub-optimal solution because it breaks DA but at least I some sort of a solution.

How about those per-user templates DA? isn't this something that can easily be programmed into the current template? What sort of language is in the template anyways, is it what you call "shell scripting"?
 
templates come in all shapes and sizes.

here they're simply used to provide a skeleton for the final
config file, and DA fills in the appropriate data, i.e

|DOMAIN| could become test.com etc...

(presumably the program looks for something delimited
by '|' and tries to replace, not an uncommon method)

many programs have the idea of a 'template path'
which can be many paths appended, so it will
1. try path one, if file wanted is there, use it
2. if not try the next path in the list

in Perl it was originally introduced in the 'advanced perl
programming' book, where they wrote a templating
system called Jeeves. but i'm sure others have used it
earlier for other reasons/requirements.

if DA uses:
1. try /usr/local/directadmin/data/templates/custom/
then falls back to
2. /usr/local/directadmin/data/templates/

there appears to be no difficulty in adding in one earlier, in
the user's directory
/usr/local/directadmin/data/users/<USERNAME>/

and try that first, and that would be that.
 
Back
Top