MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Development => Topic started by: chrisf on 2014-08-04, 04:11:41

Title: [REQUEST] custom config for kloxo-hiawatha and lxphp
Post by: chrisf on 2014-08-04, 04:11:41
Mustafa,

Please add a check for custom configuration files for php5{x}s and for kloxo-hiawatha.  This makes sense for numerous reasons.

Allowing the setting of timezone for lxphp.  Turning display errors off in production servers.  Etc.

Kloxo-Hiawatha I would like to tweak for our servers, I have become very familiar with it and want to change standard settings.

It makes no sense to have to do this every update.  Please add this.

Thank you
Title: Re: [REQUEST] custom config for kloxo-hiawatha and lxphp
Post by: MRatWork on 2014-08-04, 19:45:04
Open '/etc/rc.d/init.d/kloxo' and '/usr/local/lxlabs/kloxo/init/kloxo.init'. You can modified:
Code: [Select]
phpcgi_ini="/opt/${php_active}/custom/${php_active}.ini"to
Code: [Select]
if [ -f /opt/${php_active}/custom/custom.${php_active}.ini ] ; then
phpcgi_ini="/opt/${php_active}/custom/custom.${php_active}.ini"
else
phpcgi_ini="/opt/${php_active}/custom/${php_active}.ini"
fi
Title: Re: [REQUEST] custom config for kloxo-hiawatha and lxphp
Post by: chrisf on 2014-08-05, 03:33:01
Done :)  please add that to the repo so it doesn't get overwritten.  Now lxphp set for my timezone ;)

Can you do something similar for kloxo-hiawatha?
Title: Re: [REQUEST] custom config for kloxo-hiawatha and lxphp
Post by: chrisf on 2014-08-05, 07:37:33
Mustafa,

After testing I realized your fix doesn't work completely.  The reason is lphp.exe and lxphp.exe are linked to php5{x}s-cli.sh and the starting of lxphp for kloxoMR uses php5{x}s-fpm.sh.  php_rc is hardcoded in these files to php5{x}s.ini

After much investigation found easy way to implement the custom.php5{x}s.ini

PLEASE ADD THIS TO THE REPO/RPM as it is simple, and works perfectly.

File: fixlxphpexe

Find
Code: [Select]
cp -rf ${INIT_DIR}/${base_name}/*.ini /opt/${base_name}/etc

ADD THIS after that line:
Code: [Select]
if [ -f /opt/${base_name}/custom/custom.${base_name}.ini ] ; then
cp -f /opt/${base_name}/custom/custom.${base_name}.ini /opt/${base_name}/custom/${base_name}.ini
fi


VERY simple, yet works perfect.  If custom file exist, we just copy it overtop php5{x}s.ini so lxphp.exe lphp.exe and kloxo-cgi ALL use custom config.

Please confirm adding to repo.  THANK YOU.
Title: Re: [REQUEST] custom config for kloxo-hiawatha and lxphp
Post by: chrisf on 2014-09-06, 17:17:39
Mustafa, please add my code to fixlxphpexe as it works perfectly, and is best solution to make sure all php for kloxoMR uses custom file if exist.
Title: Re: [REQUEST] custom config for kloxo-hiawatha and lxphp
Post by: MRatWork on 2014-09-07, 04:30:09
Custom php.ini already use by kloxo.init if exists.
Title: Re: [REQUEST] custom config for kloxo-hiawatha and lxphp
Post by: chrisf on 2014-09-07, 04:57:25
Yes, however it only works for the panel.  I saw in kloxo.init, but lxphp.exe does not.  Any command line use of lxphp ot lphp exe does not use the custom file.

My solution is tested and works perfectly, just like all of your webserver configs, if custom file found, overwrite the conf file.  Please add my solution, it is only a few lines and works on ALL lxphp, lphp, anf kloxo cgi as well.

Thank you