Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-29, 09:20:52

Author Topic: [TIP] - how to create custom config NGINX, PHP-FPM for multiple CMS/Domain  (Read 8128 times)

0 Members and 1 Guest are viewing this topic.

Offline naujasdizainas

  • Junior Member
  • *
  • Posts: 44
  • Karma: +1/-0
  • Gender: Male
    • View Profile
    • http://www.naujasdizainas.com
If all domain user one CMS, ok +/- how to config NGINX.
But if have like Magento, Joomla, Wordpress. For wordpress config I see file wp-proxy.conf and etc.
But for other CMS how make config like rewrite? Important: need config if run cleanup.sh or fix...sh configuration file leave unchanged. It's posible? 

Tips in -  http://forum.mratwork.com/kloxo-mr-tips-and-tricks/need-help-or-info-nginx-php-fpm-config-for-multiple-cms/msg30608/#msg30608
« Last Edit: 2014-03-01, 19:56:06 by naujasdizainas »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Need help or info NGINX, PHP-FPM config for multiple CMS
« Reply #1 on: 2014-03-01, 15:47:50 »
Basic 'custom rule', all files inside '/home/<webserver>/tpl' and '/home/<webserver>/conf/globals' will without overrite when update run cleanup if copy this files with 'custom.' prefix (let say copy domains.conf.tpl to custom.domains.conf.tpl) and Kloxo-MR will be process this custom file instead original files.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline naujasdizainas

  • Junior Member
  • *
  • Posts: 44
  • Karma: +1/-0
  • Gender: Male
    • View Profile
    • http://www.naujasdizainas.com
Re: Need help or info NGINX, PHP-FPM config for multiple CMS
« Reply #2 on: 2014-03-01, 18:10:56 »
Ok, thanks.
About custom i know. But question about config for multiple cms.
Situation:
Site A - run Magento CMS.
Site B - run Joomla CMS.
Server run Nginx + PHP-FPM. We make  'custom rule', all files inside '/home/<webserver>/tpl' and '/home/<webserver>/conf/globals'. Fine ...
But this rule is global for service but not for idividual site. If server run lighttpd, in admin console exist rewrite rule for lighttpd for individual site, but for Nginx not found.
I ask how to make rewrite if run Nginx for individual site. It's possible?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Need help or info NGINX, PHP-FPM config for multiple CMS
« Reply #3 on: 2014-03-01, 18:47:42 »
Use your imagination.

For example:

Look at '/home/nginx/tpl/domains.conf.tpl' in portion:

Code: [Select]
if (file_exists("{$globalspath}/custom.php-fpm.conf")) {
    $phpfpmconf = 'custom.php-fpm.conf';
} else {
    $phpfpmconf = 'php-fpm.conf';
}

and I want modified to:
Code: [Select]
if (file_exists("{$globalspath}/custom.php-fpm.conf")) {
    $phpfpmconf = 'custom.php-fpm.conf';
} else {
    if ($domainname === 'tester1.com') {
        // need tester1.com.php-fpm.conf
        $phpfpmconf = $domain.com . 'php-fpm.conf';
    } else if ($domainname === 'tester2.com') {
        // need tester2.com.php-fpm.conf
        $phpfpmconf = $domain.com . 'php-fpm.conf';
    } else {
        $phpfpmconf = 'php-fpm.conf';
    }
}
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline naujasdizainas

  • Junior Member
  • *
  • Posts: 44
  • Karma: +1/-0
  • Gender: Male
    • View Profile
    • http://www.naujasdizainas.com
Re: Need help or info NGINX, PHP-FPM config for multiple CMS
« Reply #4 on: 2014-03-01, 19:19:17 »
Thanks!
That is what I need ...

Little changes:
Code: [Select]
if (file_exists("{$globalspath}/custom.php-fpm.conf")) {
    $phpfpmconf = 'custom.php-fpm.conf';
} else {
    if (file_exists("{$globalspath}/$domainname.'php-fpm.conf")) {
    // add custom $domainname.php-fpm.conf
        $phpfpmconf = $domainname. 'php-fpm.conf';
    } else {
        $phpfpmconf = 'php-fpm.conf';
    }
}

Not tested yet, but thing must work
« Last Edit: 2014-03-01, 20:08:26 by naujasdizainas »

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix

Page created in 0.068 seconds with 21 queries.

web stats analysis