DirectAdmin Auto generator apache config file

storm_shadow

Verified User
Joined
Oct 8, 2016
Messages
27
Hello Guys...
Int the last version of directadmin, httpd combin all domain pointer in subdomain Virtualhost , like this :
Apache config:
<VirtualHost 88.88.88.88:80 127.0.0.1:8080 >
ServerName www.sub.domain.com
ServerAlias www.sub.domain.com sub.domain.com sub.domain1.com www.sub.domain1.com sub.domain2.com www.sub.domain2.com sub.domain3.com www.sub.domain3.com sub.domain4.com www.sub.domain4.com
ServerAdmin [email protected]
...

But in new version of directadmin Httpd generate special Virtualhost for Subdomain per every Domain Pointer, like this:
Apache config:
<VirtualHost 88.88.88.88:80 127.0.0.1:8080 >
ServerName www.sub.domain1.com
ServerAlias www.sub.domain1.com sub.domain1.com
ServerAdmin [email protected]
...

<VirtualHost 88.88.88.88:80 127.0.0.1:8080 >
ServerName www.sub.domain2.com
ServerAlias www.sub.domain2.com sub.domain2.com
ServerAdmin [email protected]
...

<VirtualHost 88.88.88.88:80 127.0.0.1:8080 >
ServerName www.sub.domain3.com
ServerAlias www.sub.domain3.com sub.domain3.com
ServerAdmin [email protected]
...

Are there settings that will generate the same as before?
Where do I need to make change to generate it look like before?
Please help me for this, it's importnat
 
I think it depends on if you create the pointer as an alias or not.
 
You can't modify the code that writes the httpd.conf file.
 
The time problem is not due to the size of httpd.conf by the way. It doesn't take that long to write a few hundred MBs to a file. This situation has been true for many years.
 
Let us know the results. I still think its going to take a long time to add a domain once you get over a certain amount. I have been dealing with this for many years. long before they changed the virtual host.
 
Let us know the results. I still think its going to take a long time to add a domain once you get over a certain amount. I have been dealing with this for many years. long before they changed the virtual host.
The result was very good.
With pointers_own_virtualhost=1 , time to generate my user VirtualHost : 10 min
With pointers_own_virtualhost=0 , time to generate my user VirtualHost : 30 sec

For example if i had 600 domain pointers, with 500 subdomains, Directadmin add 300000 (500x600) VirtualHost setting for subdomains to user httpd.conf file. and httpd.conf file size will be very large.
But with pointers_own_virtualhost=0 , Directadmin just generate 500 VirtualHost setting to httpd.conf file.
 
Last edited:
The result was very good.
With pointers_own_virtualhost=1 , time to generate my user VirtualHost : 10 min
With pointers_own_virtualhost=0 , time to generate my user VirtualHost : 40 sec

You have a very slow host.
 
Dude, it doesn't matter how many resources or servers you have, it's important that the system you're using is optimized and compatible with any resource!

Really! Then I can expect to run DirectAdmin on slow hard drive from 15 years ago and with only 128 MB of RAM and Pentium 4 processor?

I admit that after about 1000 domains on one user DA can be slow but wow 10 minutes to add a pointer is crazy. You have something else wrong. I have one user who has over 7000 domains in his one account and it now takes almost 2 minutes to add a domain. Adding a domain is a lot more than simply adding a pointer.
 
The result was very good.
With pointers_own_virtualhost=1 , time to generate my user VirtualHost : 10 min
With pointers_own_virtualhost=0 , time to generate my user VirtualHost : 30 sec

For example if i had 600 domain pointers, with 500 subdomains, Directadmin add 3000000 (500x600) VirtualHost setting for subdomains to user httpd.conf file. and httpd.conf file size will be very large.
But with pointers_own_virtualhost=0 , Directadmin just generate 500 VirtualHost setting to httpd.conf file.
Thanks for the info. I'm always happy to find places for optimization, and this info was sufficient for me to find places where we can speed it up.
I found the code that reads in the large lists was using the default read/sort method, which sorts after each line insertion to avoid duplicates.
We can instead rely on the file not having duplicates (as it's checked before adding anyway), so the sort only happens at the end of the read. This should provide a "Big O" optimization from being exponential delay the larger the list, to one single sort which should be quick on it's own. Basically, for large pointer lists, I'm thinking you'll hopefully see great improvement, and if not we can dig further to see what the slow-down is.

Pre-release binaries are available now with the speedup. Let us know how it goes.

Note that the above changes to not address the size of the file. The pointers_own_virtualhost is the way to control that. The above is only a code efficiently optimization with the same output.

If anyone else finds anything related, where large lists start to slow, exponentially, then just let me know and I can check which sorting method is used (once per line-read to avoid duplicates, or once after full-read but allows duplicates)... or the other option is an insertion read, which puts it in the right place, avoid duplicates but wouldn't be as quick as the "sort-after" method, so the need varies depending on which data we're working on, and in which context.
 
  • Like
Reactions: Kal
Back
Top