Results 1 to 2 of 2

Thread: Custom HTTPD Configurations for multiple domains

  1. #1
    Join Date
    Apr 2009
    Posts
    2,132

    Custom HTTPD Configurations for multiple domains

    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

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,133
    Hello,

    Try and use PHP in templates then.

    PHP Code:
    |$/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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •