Announcement

Collapse
No announcement yet.

CageFS and FCGI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CageFS and FCGI

    Hi guys,
    Im one CloudLinux happy customer but this night for the first time i met a really big problem who i CANT solve by myself.

    I decided to go with FCGI as a wrapper but when i do i somehow loose the cagefs. I will give you an example:

    With the following php code:

    Code:
    <?php echo shell_exec(cat /etc/passwd); ?>
    i can see all the username when im with fcgi. In the next moment im changing to suphp and this problem is gone.

    There is my php.conf

    Code:
    # Fastcgi configuration for PHP5
    
    LoadModule fcgid_module modules/mod_fcgid.so
    
    MaxRequestsPerProcess 500
    
    AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
    
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
    
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
    
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
    
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
    
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
    
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml
    This is my php5 cgi-sys/php5 file:

    Code:
    #!/bin/bash
    
    [[ -f ~/php/php.ini ]] && exec /usr/bin/php -c ~/php/php.ini
    
    exec /usr/bin/php
    What could cause such problem ? I tried to recompile it with easyapache several times but with no success

  • #2
    Hello Peter!

    Please ensure that suexec is turned On.

    Also, please verify that suexec binary includes our patch:
    strings /path/to/suexec | grep lve
    This command should show:
    liblve.so.0
    lve_jail_uid

    If you use cpanel, you can rebuild suexec by executing
    /usr/sbin/cpanel-compile-suexec.sh

    Comment


    • #3
      Thank you for the answer Anton !

      If the suexec path is /usr/local/apache/bin/suexec then no result is returned:

      Code:
      root@hostname [~]# strings /usr/local/apache/bin/suexec | grep lve
      
      root@hostname [~]#
      I recompiled it with the /usr/sbin/cpanel-compile-suexec.sh and now it shows the patch:

      Code:
      root@hostname [~]# strings /usr/local/apache/bin/suexec | grep lve
      
      liblve.so.0
      
      lve_jail_uid
      
      root@hostname [~]#
      When i switch to suPHP it worked even without the patch. I will try it later with fcgi because im afraid i could broke something now so i will test it im some late hour and i will post the result.

      Comment

      Working...
      X