Exclude vhost from being templated

thorrr

New member
Joined
Jun 7, 2010
Messages
2
Is there any way to exlude a domain/subdomain 's vhost from being auto generated from the template files? so that i could just make a static vhost and include it in httpd.conf?

I have been trying to organize the template to fit my needs but i kept running into difficulties. Does the templating system allow you to do an if...elseif...elseif...else structure? I gave it a quick test and it seemed that all it supported was if...else.

I suppose i could just delete the sub from DA, and just create DNS for it and include it in httpd.conf, but i would rather not do that.

Any suggestions, i have tried searching around for this with no luck...

Thanks,

Thorrr
 
Not a single sub-domain, but a whole httpd.conf for a certain user with his all domains and sub-domains without ability to do any changes and to add new domains and to remove old.

see chattr/chflags
 
Not a single sub-domain, but a whole httpd.conf for a certain user with his all domains and sub-domains without ability to do any changes and to add new domains and to remove old.

see chattr/chflags

Thanks for that info, i do remember seeing that in another post. I read the man pages and that would *do* what i wanted, but it's not a great solution.

Why do you need that? Probably it can be done other way?

I had wanted to make some changes, and after a few failed attempts last night i had wondered if this was an available option. Less clutter in the templates, and more configurability.

I spent some time today(i was very tired when i tried it last time :P) reorganizing the templates quite a bit and managed to get it working with the changes i had made.

I still don't see how something like this would be possible with the templates

eg:
This excerpt
Say i wanted theese options by default for all created sub domains.
but in one SUB, "test1" i wanted the opposite of that -Includes +Indexes
Code:
	<Directory |DOCROOT|>
		Options +Includes -Indexes
		
|*if SUB="tracker"|
               Options -Includes +Indexes
|*endif|

both of those options lines would be put in, what would apache decide? I dont see a way around this. Perhaps i am overcomplicating the issus and i just cant see the solution, but i think that the ability to have a static conf for a certain domain or subdomain would be a nice feature.

Perhaps i can find a way of implementing it.

In any case i managed to get what i wanted for the moment with the template :D

Thanks again for your help.
 
Ok, I can suggest you a solution. Remember, there could be much better ways to go.

1. Open for update /usr/local/directadmin/data/templates/custom/virtual_host2.conf.

2. In top add line with

Code:
|?CUSTOM_OPTIONS=Options +Includes -Indexes|

3. Change line

Code:
Options +Includes -Indexes

into

Code:
|CUSTOM_OPTIONS|

4. Delete

Code:
|*if SUB="tracker"|
               Options -Includes +Indexes
|*endif|

5. Save and exit.

6. Update other templates, if needed (be careful).

7. Since that var CUSTOM_OPTIONS is set. You can redefine it in Custom Httpd Configurations

Admin Login into Directadmin -> Add Custom Httpd Configurations -> Select domain -> add into top text area

Code:
|?CUSTOM_OPTIONS=Options -Includes -Indexes|

8. Click on "Save" button.

Remember, this specific solution works with only regular domains, not sub-domains. Perhaps, you need to correct something in order to feet your needs.
 
Back
Top