Custom HTTPD Configurations for multiple domains

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,577
In my custom PHP-FPM file at /usr/local/directadmin/data/templates/custom/php-fpm.conf I have this line:

Code:
php_admin_value[opcache.file_cache] = |HOME|/.opcache

However I am trying to to something like this:

Code:
|*if DOMAIN="DOMAIN.TLD"|
php_admin_value[opcache.file_cache] =
|*else|
php_admin_value[opcache.file_cache] = |HOME|/.opcache
|*endif|

However I need to be able to specify this for several individual domains, not only for one domain. But I am not able to figure out how to do this for several domains. For example this syntax is not valid, but shows what I try to do:

Code:
|*if DOMAIN="DOMAIN1.TLD"||DOMAIN="DOMAIN2.TLD"|
php_admin_value[opcache.file_cache] =
|*else|
php_admin_value[opcache.file_cache] = |HOME|/.opcache
|*endif|

Does anybody know how I can write the code so that DOMAIN1.TLD and DOMAIN2.TLD is getting

Code:
php_admin_value[opcache.file_cache] =

But all other domains is getting:
Code:
php_admin_value[opcache.file_cache] = |HOME|/.opcache
 
Hello,

Try and use PHP in templates then.

PHP:
|$/usr/local/bin/php
<?php
$data = "|HOME|/.opcache";
$domain = "|DOMAIN|";
$domains = array('domain.com','domain.net','domain.org');
if (in_array($domain, $domains)) {
   print "php_admin_value[opcache.file_cache] = ". $data;
}
?>
DONE|


Something like this... I did not test it.
 
Back
Top