CB 2.0 with fastcgi

Thanks for the advice Martynas,

I updated CB2 to Version: 2.0.0-RC5.

Updated DA to last pre-release:
Compiled on 'CentOS 6.0 64-Bit'
Compile time: Jun 23 2013 at 01:17:14
Compiled with IPv6,

Changed php 5.4 and 5.3 to fastcgi mode, build apache, build php and rewrite_confs...

everything perfect for now, no timeout problems.


It is a pity that they have abandoned the php-fpm project.

Thank you for your work and help

so now work fine without recompile apache with mod_proxy_fcgi.c fix right?
 
PHP-FPM seems to work fine with attached templates (put them in /usr/local/directadmin/data/templates/custom) and latest version of CustomBuild 2.0 (RC5) (do "./build php n" after update). These templates should be soon included with the latest pre-release of DA.
 

Attachments

  • custom.tar.gz
    2 KB · Views: 234
Last edited:
Hi,

I tried with these new templates but the php scripts are not interpreted, not sure but I also think that this line might be wrong:

virtual_host2.conf, line 41
Code:
FastCgiExternalServer |DOCROOT|/|PHP1_RELEASE|-fpm -idle-timeout 300 -socket /usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock -pass-header Authorization
is correct, or is it:
Code:
FastCgiExternalServer |DOCROOT|/[U][B]php[/B][/U]|PHP1_RELEASE|-fpm -idle-timeout 300 -socket /usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock -pass-header Authorization

??

Thank.


EDIT:

In the current pre-release templates files "virtual_host2*" I think I found other errors:

Code:
|*if HAVE_PHP2_FPM="1"|        RewriteOptions InheritBefore
        RewriteCond %{REQUEST_FILENAME} -f        
        RewriteCond %{REQUEST_FILENAME} \.php[COLOR=#ff0000][B]|PHP2_ RELEASE|[/B][/COLOR]$
        RewriteRule ^/?(.*\.php|PHP2_RELEASE|(/.*)?)$ fcgi://socket=\%2fusr\%2flocal\%2fphp|PHP2_RELEASE|\%2fsockets\%2f|USER|.sock|DOCROOT|/$1 [B][COLOR=#ff0000][P,E=HTTP_AUTHORIZATION:% [P,E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L][/COLOR][/B]
|*endif|

Code:
|*if HAVE_PHP2_FPM="1"|        RewriteOptions InheritBefore
        RewriteCond %{REQUEST_FILENAME} -f        
        RewriteCond %{REQUEST_FILENAME} \.php[COLOR=#008000][B]|PHP2_RELEASE|[/B][/COLOR]$
        RewriteRule ^/?(.*\.php|PHP2_RELEASE|(/.*)?)$ fcgi://socket=\%2fusr\%2flocal\%2fphp|PHP2_RELEASE|\%2fsockets\%2f|USER|.sock|DOCROOT|/$1 [COLOR=#008000][B][P,E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L][/B][/COLOR]
|*endif|

P.D. I finally had to go back PHP-FPM 5.4/5.3, i need custom php_admin_value (php-fpm54/3.conf) per user and with PHP fastcgi not found a way to make it work.
 
Last edited:
and fastcgi ?

php1_release=5.3
php1_mode=fastcgi

i have try update directadmin

# /usr/local/directadmin/directadmin o
Compiled on 'CentOS 6.0 64-Bit'
Compile time: Jun 24 2013 at 04:59:40
Compiled with IPv6

./build apache
./build php n
./build rewrite_confs

but i continue to have

[Tue Jun 25 09:36:45.623565 2013] [fcgid:warn] [pid 21051:tid 139678554777344] (32)Broken pipe: [client xx.xxx.xxx.xxx:49584] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.xxxxx.xxx

any idea?
 
Last edited:
Hi,

I tried with these new templates but the php scripts are not interpreted, not sure but I also think that this line might be wrong:

virtual_host2.conf, line 41
Code:
FastCgiExternalServer |DOCROOT|/|PHP1_RELEASE|-fpm -idle-timeout 300 -socket /usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock -pass-header Authorization
is correct, or is it:
Code:
FastCgiExternalServer |DOCROOT|/[U][B]php[/B][/U]|PHP1_RELEASE|-fpm -idle-timeout 300 -socket /usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock -pass-header Authorization

??

Thank.

This is already fixed in attached templates.

EDIT:

In the current pre-release templates files "virtual_host2*" I think I found other errors:

Code:
|*if HAVE_PHP2_FPM="1"|        RewriteOptions InheritBefore
        RewriteCond %{REQUEST_FILENAME} -f        
        RewriteCond %{REQUEST_FILENAME} \.php[COLOR=#ff0000][B]|PHP2_ RELEASE|[/B][/COLOR]$
        RewriteRule ^/?(.*\.php|PHP2_RELEASE|(/.*)?)$ fcgi://socket=\%2fusr\%2flocal\%2fphp|PHP2_RELEASE|\%2fsockets\%2f|USER|.sock|DOCROOT|/$1 [B][COLOR=#ff0000][P,E=HTTP_AUTHORIZATION:% [P,E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L][/COLOR][/B]
|*endif|

Code:
|*if HAVE_PHP2_FPM="1"|        RewriteOptions InheritBefore
        RewriteCond %{REQUEST_FILENAME} -f        
        RewriteCond %{REQUEST_FILENAME} \.php[COLOR=#008000][B]|PHP2_RELEASE|[/B][/COLOR]$
        RewriteRule ^/?(.*\.php|PHP2_RELEASE|(/.*)?)$ fcgi://socket=\%2fusr\%2flocal\%2fphp|PHP2_RELEASE|\%2fsockets\%2f|USER|.sock|DOCROOT|/$1 [COLOR=#008000][B][P,E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L][/B][/COLOR]
|*endif|

This code is not from the attached templates (that templates will be used in future versions of DA).
 
This code is not from the attached templates (that templates will be used in future versions of DA).

No, no... I was not referring to the new custom that you attached in the previous message, this code is from current DA pre-release:

Compiled on 'CentOS 6.0 64-Bit'
Compile time: Jun 23 2013 at 01:17:14
Compiled with IPv6

By using PHP1 5.4 FPM and PHP2 5.3 FPM, Apache can not start and displays various errors in every user http.conf:

Code:
Starting httpd: AH00526: Syntax error on line 63 of /usr/local/directadmin/data/users/admin/httpd.conf:
RewriteCond: bad flag delimiters

Starting httpd: AH00526: Syntax error on line 123 of /usr/local/directadmin/data/users/admin/httpd.conf:
RewriteRule: bad flag delimiters

I solved by editing the files:
/usr/local/directadmin/data/templates/virtual_host2.conf
/usr/local/directadmin/data/templates/virtual_host2_secure.conf
/usr/local/directadmin/data/templates/virtual_host2_secure_sub.conf
/usr/local/directadmin/data/templates/virtual_host2_sub.conf
as I have specified in the previous message.

Simply warned to help, although I know that soon will change for the new templates you've created. :)

P.D. Ups! Sorry we have appropriated this thread with other unrelated problems, should a moderator separate unrelated posts (14,15,16,17,18,19,20,21,22,24,25) and move them to a new thread for PHP-FPM in CB2 subforum.

:(
 
Last edited:
We increased some timeout values in httpd-fcgid.conf. Please set your downloadserver to files1 in the options.conf and run:
Code:
./build update
./build rewrite_confs

Please let us know the if you experience the same problem again. Thank you.

Still I have the same error and I cannot run specific php scripts/installations. This after the update you mention above.

[Wed Sep 04 22:44:11.881565 2013] [proxy_fcgi:error] [pid 14166:tid 140658169845504] (70007)The timeout specified has expired: [client xxx.xxx.xxx.xxx:50516] AH01075: Error dispatching request to :, referer: http://website.net/dev/folder/installation/index.php
 
Hello..

I'm getting some errors like this one:

[fcgid:warn] [pid 203965:tid 140548534941440] (104)Connection reset by peer: [client XXX.XXX.XXX.XXX:26695] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

Running latest DA (cb2) with php 5.3 an php 5.5 on Cloudlinux. This is my "/etc/httpd/conf/extra/httpd-fcgid.conf":

<IfModule mod_fcgid.c>
FcgidIPCDir /var/run/fcgidsock
SharememPath /var/run/fcgid_shm
FcgidMinProcessesPerClass 1
FcgidMaxProcessesPerClass 15
FcgidMaxProcesses 150
FcgidProcessLifeTime 150
FcgidIdleScanInterval 30
FcgidIdleTimeout 90
FcgidBusyTimeout 3600
FcgidIOTimeout 2000
FcgidMaxRequestLen 1073741824
FcgidPassHeader Authorization
FcgidFixPathinfo 1
AddHandler fcgid-script .fcgi
FcgidMaxRequestsPerProcess 100000
</IfModule>

Site seems running fine, but error is not happening at every request.

No other errors appear on same log file.
 
Replying in case this helps someone else.


After a long time getting the

mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

messages randomly on some heavy sites, I've managed to get rid of them.


Using Apache/2.4.7, php 5.3 and php 5.5 with mod_fcgid
- PHP 5.5 has Zend, ioncube and opcache enabled
- PHP 5.3 has Zend, ioncube and APC enabled

Problems were from php 5.5 and Zend actually.

To get rid of them I had to:

1. Set "zend.enable_gc = Off" for php55.
2. Allow zero fcgid processes to hang around after starting. I had FcgidMinProcessesPerClass 1 and did this 0.
 
Back
Top