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-28, 23:16:59

Author Topic: Kloxo-MR template-based config  (Read 21848 times)

0 Members and 1 Guest are viewing this topic.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Kloxo-MR template-based config
« on: 2013-01-11, 12:40:26 »
Taken from http://forum.lxcenter.org/index.php?t=m ... msg_102683

This is config directories structure:
Code: [Select]
/home
   |
   |____ apache
   |       |
   |       |____ conf
   |       |       |
   |       |       |____ defaults ==> content config for 'defaults' files
   |       |       |
   |       |       |____ domains ==> content config for 'domains' files
   |       |       |
   |       |       |____ globals ==> content config for 'globals' files (including files for 'defaults' and  'domains' files)
   |       |
   |       |____ etc
   |       |       |
   |       |       |____ conf ==> overwrite files for /etc/httpd/conf
   |       |       |
   |       |       |____ conf.d ==> overwrite files for /etc/httpd/conf.d
   |       |       |
   |       |       |____ init.d ==> overwrite files for /etc/rc.d/init.d (with remove extension .init)
   |       |
   |       |____ tpl ==> template files for 'defaults' and 'domains' files (processed by 'sh /script/fixweb')
   |
   |____ bind
   |       |
   |       |____ conf
   |       |       |
   |       |       |____ defaults ==> content config for 'defaults' files
   |       |       |
   |       |       |____ master ==> content config for 'master' files
   |       |       |
   |       |       |____ reverse ==> not implementing yet
   |       |       |
   |       |       |____ slave ==> not implementing yet
   |       |
   |       |____ etc
   |       |       |
   |       |       |____ conf ==> overwrite files for /etc/name.conf
   |       |
   |       |____ tpl ==> template files for 'domain', 'master list' and 'transfered' files (processed by 'sh /script/fixdns')
   |
   |____ djbdns
   |       |
   |       |____ axfrdns==> content config for 'tcp' and 'tcp.cdb' files for transfered
   |       |
   |       |____ conf
   |       |       |
   |       |       |____ defaults ==> content config for 'defaults' files
   |       |       |
   |       |       |____ master ==> content config for 'master' files
   |       |       |
   |       |       |____ reverse ==> not implementing yet
   |       |       |
   |       |       |____ slave ==> not implementing yet
   |       |
   |       |____ dnscache ==> not implementing yet
   |       |
   |       |____ etc
   |       |       |
   |       |       |____ conf ==> overwrite files for /etc/name.conf
   |       |
   |       |____ tinydns
   |       |       |
   |       |       |____ root ==> content config for 'data' and 'data.cdb' files for master
   |       |
   |       |____ tpl ==> template files for 'domain', 'master list' and 'transfered' files (processed by 'sh /script/fixdns')
   |
   |____ lighttpd
   |       |
   |       |____ conf
   |       |       |
   |       |       |____ defaults ==> content config for 'defaults' files
   |       |       |
   |       |       |____ domains ==> content config for 'domains' files
   |       |       |
   |       |       |____ globals ==> content config for 'globals' files (including files for 'defaults' and  'domains' files)
   |       |
   |       |____ etc
   |       |       |
   |       |       |____ conf ==> overwrite files for /etc/lighttpd
   |       |       |
   |       |       |____ conf.d ==> overwrite files for /etc/lighttpd/conf.d
   |       |       |
   |       |       |____ init.d ==> overwrite files for /etc/rc.d/init.d (with remove extension .init)
   |       |
   |       |____ tpl ==> template files for 'defaults' and 'domains' files (processed by 'sh /script/fixweb')
   |
   |____ nginx
   |       |
   |       |____ conf
   |       |       |
   |       |       |____ defaults ==> content config for 'defaults' files
   |       |       |
   |       |       |____ domains ==> content config for 'domains' files
   |       |       |
   |       |       |____ globals ==> content config for 'globals' files (including files for 'defaults' and  'domains' files)
   |       |
   |       |____ etc
   |       |       |
   |       |       |____ conf ==> overwrite files for /etc/nginx
   |       |       |
   |       |       |____ conf.d ==> overwrite files for /etc/nginx/conf.d
   |       |       |
   |       |       |____ init.d ==> overwrite files for /etc/rc.d/init.d (with remove extension .init)
   |       |
   |       |____ tpl ==> template files for 'defaults' and 'domains' files (processed by 'sh /script/fixweb')
   |
   |____ php-fpm
   |       |
   |       |____ etc ==> overwrite files for /etc
   |       |       |
   |       |       |____ init.d ==> overwrite file for /etc/rc.d/init.d (with remove extension .init)
   |       |
   |       |____ tpl ==> template files for /etc/php-fpm.conf (for php 5.2) and /etc/php-fpm.d/<pool>.conf (for php 5.3/5.4) (processed by 'sh /script/fixweb')
   |
   |____ phpini
   |       |
   |       |____ etc ==> overwrite files for /etc
   |       |       |
   |       |       |____ php.d ==> overwrite file for /etc/php.d
   |       |
   |       |____ tpl ==> template files for /etc/php.ini and /home/httpd/<domains>/php.ini files (processed by 'sh /script/fixphp')
Note:
- All files inside 'conf/globals/', 'etc/' and 'tpl/' can be customize with copy this file(s) to file(s) with 'custom.' prefix name and than modified this 'custom.' file
- Files inside 'tpl/' in format 'inline-php' (embedded php code)
- After modified 'custom.' file(s) need running:
Code: [Select]
# for apache/lighttpd/nginx/php-fpm
sh /script/fixweb

# for phpini
sh /script/fixphp

# for apache
service httpd restart

# for lighttpd
service lighttpd restart

# for nginx
service nginx restart

# for php-fpm/phpini for using nginx/lighttpd/php-fpm_event/_worker
service php-fpm restart
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Kloxo-MR template-based config
« Reply #1 on: 2013-02-21, 22:44:02 »
After template files have been changed in future releases, Do we need to update our custom template files?

If there was a way that allowed us to just set our custom changes, It was very perfect!

For example we would enter the following values on dynamic.php.ini.tpl
Code: [Select]
$mr-generic = array(
"display_startup_errors" => "Off",
"error_log" => "custom_name"
);
$mr-php-53 = array(
"track_errors" => "On",
"expose_php" => "mr-clr"
);
And after run 'sh /script/fixphp' by user, compiler will apply these changes on php.ini files:

> In (### MR -- generic) section:
- Change 'display_startup_errors = On' to 'display_startup_errors = Off'
- Add 'error_log = custom_name'

> In (### MR -- specific for php 5.3+) section:
- Change 'track_errors = Off' to 'track_errors = On'
- Remove 'expose_php = On'
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Kloxo-MR template-based config
« Reply #2 on: 2013-02-21, 23:13:54 »
For content of php.ini, I just using 'default' configs.

If you want modified, use Kloxo-MR 'rule' where "All files inside 'conf/globals/', 'etc/' and 'tpl/' can be customize with copy this file(s) to file(s) with 'custom.' prefix name and than modified this 'custom.' file".

So, copy php.ini.tpl to custom.php.ini.tpl. Kloxo-MR will be use 'custom.' file when you run 'sh /script/fixphp'.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Kloxo-MR template-based config
« Reply #3 on: 2013-03-13, 23:23:24 »
How Can I filter some domains from custom.php.ini.tpl changes after 'sh /script/fixphp' or kloxo-mr update?
(related to enable/disable secondary php)
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Kloxo-MR template-based config
« Reply #4 on: 2013-03-14, 10:35:02 »
Quote from: "WISTFUL"
How Can I filter some domains from custom.php.ini.tpl changes after 'sh /script/fixphp' or kloxo-mr update?
(related to enable/disable secondary php)
;) I found its solution:

1. Edit /home/phpini/tpl/custom.htaccess.tpl and replace '#AddHandler x-httpd-php52 .php' line with below codes:
Code: [Select]
<?php
$blacklist 
= array("user1""user2""user3");
if (
in_array($user$blacklist)) {
?>

#AddHandler x-httpd-php52 .php
<?php
} else {
?>

AddHandler x-httpd-php52 .php
<?php
}
?>
2. Replace user1, user2 and user3 with users that dont need secondary-php

3. Run below:
Code: [Select]
# sh /script/fixphp
# service php-fpm restart
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline zeeshan030

  • Junior Member
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Kloxo-MR template-based config
« Reply #5 on: 2015-04-14, 13:25:30 »
Issue 2: i've some forwarding for a couple of account, so when i send an email to one account that has forwarding enabled, the email isn't found there. It gets forwarded to correct address, but is there a way to keep email on the account itself as well?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Kloxo-MR template-based config
« Reply #6 on: 2015-04-14, 13:35:34 »
Issue 2: i've some forwarding for a couple of account, so when i send an email to one account that has forwarding enabled, the email isn't found there. It gets forwarded to correct address, but is there a way to keep email on the account itself as well?

Better create thread instead hijack old/different thread.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine

Page created in 0.045 seconds with 20 queries.

web stats analysis