bertvandepoel
Verified User
We've been working on some customised caching stuff for some of our customers who have issues with underperforming websites. We'd like to integrate this nicely into DirectAdmin using a plugin so they can enable and disable it for specific websites. In practice this means adding some ProxyPass rules and an extra vhost for thos sites that are being directed through caching. I'm finding it quite challenging however to control VirtualHosts in DirectAdmin. I can't seem to find any API to make changes to specific vhosts and in general it doesn't seem to be a very accessible part of DA.
I've managed to make a very basic PoC using CUSTOM tokens under the Customize httpd configuration option. I have a few practical questions however, so I was hoping some of my fellow forum members could help with this:
1. To prevent redirection loop, I need to let the website know when https is being used. I currently use 'RequestHeader set X-Forwarded-Proto "https"' in CUSTOM2. Is there a way to add a check similar to |*if SUB|
2. I currently have a full vhost inside CUSTOM1. This means that some of the generated parts I'm doing manually, which is not ideal if the PHP version gets changed or something along those lines. Is there a way to just generate an extra vhost on top of :80 and :443 on yet another port but beyond that identical apart from some added headers?
3. Is there an API call to set these CUSTOM tokens? I didn't seem to find one immediately
4. I noticed there's an API you can call to get all the domains of a user, but is there also a way to get them grouped together per vhost (so all pointers and the main domain together)?
5. Is anyone aware of any good examples/tutorials to create nice DirectAdmin interfaces? I'd like what I'm creating to look good but the plugin development docs seem really scattered and chaotic.
Any help to any of these questions is much appreciated. I really hope I will pull this off!
I've managed to make a very basic PoC using CUSTOM tokens under the Customize httpd configuration option. I have a few practical questions however, so I was hoping some of my fellow forum members could help with this:
1. To prevent redirection loop, I need to let the website know when https is being used. I currently use 'RequestHeader set X-Forwarded-Proto "https"' in CUSTOM2. Is there a way to add a check similar to |*if SUB|
2. I currently have a full vhost inside CUSTOM1. This means that some of the generated parts I'm doing manually, which is not ideal if the PHP version gets changed or something along those lines. Is there a way to just generate an extra vhost on top of :80 and :443 on yet another port but beyond that identical apart from some added headers?
3. Is there an API call to set these CUSTOM tokens? I didn't seem to find one immediately
4. I noticed there's an API you can call to get all the domains of a user, but is there also a way to get them grouped together per vhost (so all pointers and the main domain together)?
5. Is anyone aware of any good examples/tutorials to create nice DirectAdmin interfaces? I'd like what I'm creating to look good but the plugin development docs seem really scattered and chaotic.
Any help to any of these questions is much appreciated. I really hope I will pull this off!