SuExec Usage with LSAPI and dynamic command line Parameter

Discussion in 'Install/Configuration' started by benoit.georgelin, Jan 22, 2014.

  1. benoit.georgelin

    benoit.georgelin Active Member

    Hi Guys !

    I'm currently testing ListSpeed (Trial version)
    I run several Vhost from apache configuration (Loading Apache Config)
    I use SuExec

    Here is what I'm using with Apache2.2

    FCGIWrapper "/opt/wrapper/php ${PHP_VERSION} ${DOMAINE_NAME}"

    In any vhost , there is this line , for example with :

    FCGIWrapper "/var/tmp/wrapper php53"

    This is explicitly written in the vhost file
    When is reach , Fastcgi is used to call /var/tmp/wrapper and send the command line parameter 1 (php53) et 2 (

    The wrapper file execute php-cgi or lsphp binary with a specific PHPRC variable value and/or explicitly give de php.ini file to use for this php version and this domain.

    I'm trying to find a work around to do that with LietSpeed when loading configuration from apache is enable.

    The solution without using the configuration from apache it to create all vhost into LiteSpeed, for each vhost create a External Application with the specific command line parameter. This is working like a charm.

    But I the case I wanna use the apache configuration I have no idea how to manage that.
    The only luck that I could have is passing $VH_NAME to the environment variable of the common external application used in dynamic configuration file from apache but this is not working (see my other post there: )
    If at least I can have the domain name used in the request, I'll be able to manage to know the PHP_VERSION required bye the domaine.

    Thanks for you help :)
    Last edited: Jan 22, 2014
  2. NiteWave

    NiteWave Administrator

  3. benoit.georgelin

    benoit.georgelin Active Member

  4. NiteWave

    NiteWave Administrator

    how about PHPIniDir ?
    I think each subdomain can have its own php.ini with it.
  5. benoit.georgelin

    benoit.georgelin Active Member

    I need to be able to use different php.ini for domain and SUBdomain for same user.

    My understanding with PHPIniDir is that only works by system user.
    So if one user have 2 domains or 1 domain and 1 subdomain, they have to use the same PHPIniDir .

    Am I right ?
  6. NiteWave

    NiteWave Administrator

    looks you're right. in wiki's note:
    "PHPIniDir directive is effective ONLY IF placed in the 1st (or main domain) vhost OF THE ACCOUNT (USER). The one placed in subdomain vhost will be ignored even though it is just for that vhost."

    there is a new environment variable "PP_CUSTOM_PHP_INI" which not mention in wiki yet, you can try it, but I think it may not meet your requirement either.
    I think its usage is same as PHPIniDir

    maybe there is a way in current lsws just fit your case, but I'm not clear at the time being, since this is not frequently asked questions.(I think our other staff will answer it here if it's already there)

    current lsws's php configuration is already powerful enough. to my understanding,
    1)you can use multiple php versions in a vhost/subdomain, in directory level:
    2)echo vhost can have its own php.ini, as we've discussed already:
    3)following apache directives
    works with lsws

    just FYI, to help you resolve the issue in the end.
  7. benoit.georgelin

    benoit.georgelin Active Member

    Thanks for your help.
    I'm gonna do some testing.

    I was just looking to use our existing Apache configuration with LiteSpeed without doing any modification on our existing files :)

    I'm agree with you sws's php configuration is already powerful enough.
    The Suexec part is not working out of the box with Apache existing configuration

    LiteSpeed is capable to do what I want, it's just not possible from Apache loaded configuration.

    Here is what I'm doing from Litespeed configuration :

          [B]<path>/opt/wrapper/php php53</path>[/B]
    In that specific case, I cannot run LiteSpeed with Apache configuration without modify the existing configuration.

    This is very specific option to our configuration maybe and I understand ;)

  8. mistwang

    mistwang LiteSpeed Staff

    Your existing Apache configuration wont work with LiteSpeed.
    LiteSpeed only assign one group of PHP process per account to limit the resource usage. So, the php.ini setting has to be per account.
  9. benoit.georgelin

    benoit.georgelin Active Member

    Thanks for you answer.

    I'm now working with the LiteSpeed configuration.
    Here is what I'm doing, can you tell me what you think about it :

    1 Listener for every vhost
    1 Virtual Vhost configuration file by domain or sub domain
    1 External Apps declaration by Virtual Host with a unique name
    System Users are identical for domain and sub domain
    PHP Suexec is used and the External Apps call the app with specific parameters.

    With this configuration I'm able to run multiple vhosts with same user and php.ini different .
  10. NiteWave

    NiteWave Administrator

    this should work.

    however, how many domains + sub-domains are there ?
    if there are hundreds of them ...
  11. benoit.georgelin

    benoit.georgelin Active Member

    About 8.000

    Is there any concern doing that ?
  12. mistwang

    mistwang LiteSpeed Staff

    Create a external app for each vhost, you can do whatever you want. but a user with a lot of subdomain is able to start a lot more PHP processes. It might become a problem.
    But, if want per subdomain php.ini, there is no other way around it.
  13. benoit.georgelin

    benoit.georgelin Active Member

    Ok, thank you :)

Share This Page