This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Multi Php config module and apache vhost manager
#1
Multi Php config module and apache vhost manager
Hi all,

Just incase anyone is interested I have just started working on a module that allows a client/user to have multiple php configs

And also another that allows admins to manage the vhost files directly from the panel.

Elijah
Reply
Thanks given by:
#2
RE: Multi Php config module and apache vhost manager
Would that break the openbasedir locks? Usually this feature is enabled with SU apache module that would execute each use under each own space. We rely here on suhosin... Not sure that security will be ok.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by:
#3
RE: Multi Php config module and apache vhost manager
Multiple php.ini setups is good as long as it doesn't break security as Me.B stated, but being able to edit the vhosts file from the panel I would think is a big no-no. If you put one wrong entry or simple typo, your server is down until you can SSH in and fix it. Not a good idea there Wink

Don't forget to post in the proper forum sections: Moved to Module section.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#4
RE: Multi Php config module and apache vhost manager
Great point, I am looking into this but I believe you should be able to reference the custom php.ini
in the vhost files but also should allow you to still user php_values to set openbasedirs.

Sounds easy but nothing is ever that easy, I shall have a play around and see what sort of results i get.

@TGates... Yeah thats it one typo would kill it but ideally I would separate zpanel to its own file and include the other vhostfile in that(or something along those lines)

When saving the updated vhost either in php or bash check the vhost is valid as much as possible then update and reload check that the output of reload was a success otherwise revert back to previous vhost file.

And my bad on the forum selections Big Grin

edit.. Or do something similar to webmin's vhost changer and use a form to set the vhost options with limited direct text changes available.
Reply
Thanks given by:
#5
RE: Multi Php config module and apache vhost manager
Well, that is what the custom vhosts entries are for Wink
There has to be a way to multi php.iini with one main one that controls the security...(like that other panel with a c does)
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#6
RE: Multi Php config module and apache vhost manager
Okay some very basic results.

Copied the php.ini into /var/zpanel/hostdata/zadmin/config/php/php.ini
Changed the settings to have aspstyle tags on instead of off
added in vhost
Code:
PHPINIDir /var/zpanel/hostdata/zadmin/config/php
Restarted apache
Success phpinfo() shows custom .ini loaded and settings but also shows the correct openbasedir!
But this will still need to be tested further
Reply
Thanks given by:
#7
RE: Multi Php config module and apache vhost manager
Okay so I have made my module the code in theory should work but I am having some issue when running code as a module.

I was using following code

Code:
//At this point custom.ini doesnt exist
//This should attempt to create
$tempStr = 'all lines from file';
$iniFile = fopen($customINI,'w');
fwrite($iniFile,$tempStr);
fclose($iniFile);

Using that code in a clean php page from zpanel/sentora directory works but in module no go. I have tried a heap of different combinations in module like fs_filehandler::CreateFile, fs_filehandler::UpdateFile

weirdly I have no problems reading the files though.

I have been trying to use the logging structure but as soon as a reference the global for it the php process stop get a white page on function run.

Any help would be appreciated Smile
Reply
Thanks given by:
#8
RE: Multi Php config module and apache vhost manager
This is again bad for security. AS if any hacker able to access php.ini he will be able to change it a then unlock openbase DIR!

Custom php.ini like in cpanel rely on another lock down using for each user locking to home directory while zpanel/sentora use ONE apache user for ALL WEBSITES.

It won't be secure unless you change ALL the way how apache is implemented and permission unless you want to feel the bite.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by:
#9
RE: Multi Php config module and apache vhost manager
(08-21-2014, 09:41 AM)Me.B Wrote: This is again bad for security. AS if any hacker able to access php.ini he will be able to change it a then unlock openbase DIR!

Custom php.ini like in cpanel rely on another lock down using for each user locking to home directory while zpanel/sentora use ONE apache user for ALL WEBSITES.

It won't be secure unless you change ALL the way how apache is implemented and permission unless you want to feel the bite.

M B

@me.b

From the test run setting the php.ini in the vhost and also setting the php_values the values trumpted the .ini.

Unless I am doing something wrong...(more than possible!!!) then I believe that the openbasedirs would still be set by the vhost entries not the php.ini

If I am wrong and security is compromised by this well then as you said I shall have to have go from ground up and fiddle with apache.
Reply
Thanks given by:
#10
RE: Multi Php config module and apache vhost manager
@[me.b]

I have looked into it further tried setting the openbase dir in the custom.ini but the php_values set in the vhost trumpt the .ini file.

But in saying that this method is not effective enough, take alot of screwing around as you can only set one custom.ini in the vhost regardless of vhost formating, I think there is a way to do it in the .htaccess fiel but yuck..

So I believe next step is trying to cofigure php as FastCGI
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
[Request] BoxBilling api module. cyber1995 4 13 ,389 10-23-2021, 05:29 AM
Last Post: sparkrack
Module Repo Beta Chris L 3 7 ,235 08-13-2021, 02:32 AM
Last Post: Chris L
Cloud module repo spoonman 0 2 ,548 02-28-2021, 01:34 AM
Last Post: spoonman

Forum Jump:


Users browsing this thread: 3 Guest(s)