Welcome! Log In Create A New Profile

Advanced

Apache2, php-fpm, FastCGI

Posted by info 
info
Apache2, php-fpm, FastCGI
February 06, 2011 04:16PM
Hello,

i try to run my Apache2 with php-fpm on a Freebsd Server. I has
search in Internet for a howto but the most are with Nginx. So i has
use one of them to try running my Webserver with PHP.

Website Howto: http://forum.nginx.org/read.php?3,131665,144226#msg-144226

I use the follow configurations:

php-fpm.conf (only the Changes)
include=/usr/local/etc/php/fpm/*.conf
pid = /var/run/php-fpm.pid
error_log = /var/log/apache/php-fpm.log
www
listen = 127.0.0.1:9000
listen.backlog = -1
listen.owner = www
listen.group = www
user = www
group = www
pm = dynamic
pm.max_children = 60
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 10

/usr/local/etc/php/fpm/silviosiefke.conf
[silviosiefke]
listen = 127.0.0.1:9000
listen.backlog = -1
listen.owner = www
listen.group = www
#listen.mode = 0750
user = silviosiefke
group = silviosiefke
pm = dynamic
pm.max_children = 60
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 10

/usr/local/etc/apache22/httpd.conf
LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so
Include etc/apache22/extra/httpd-fastcgi.conf

/usr/local/etc/apache22/extra/httpd-fastcgi.conf
<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
FastCgiConfig -autoUpdate -singleThreshold 100 -killInterval 300 -idle-
timeout 240 -maxClassProcesses 1 -pass-header HTTP_AUTHORIZATION
FastCgiWrapper /usr/local/sbin/suexec

<FilesMatch \.php$>
SetHandler php5-fcgi
</FilesMatch>

<Location "/fcgi-bin">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</Location>

Action php5-fcgi /fcgi-bin
</IfModule>

/usr/local/etc/apache22/extra/httpd-vhost.conf
<IfModule mod_fastcgi.c>
FastCgiExternalServer /usr/local/www/post_silviosiefke_de -host
127.0.0.1:9000 -user silviosiefke -group silviosiefke
Alias /fcgi-bin 127.0.0.1:9000
</IfModule>


I has use with sockets before, but then i have ever a error in log
that the path not correct. So i use with listen host. But want not
running.

[Sun Feb 06 19:10:03 2011] [error] [client ] File does not exist: /usr/
local/127.0.0.1:9000,

Has someone idea what i must correct use as config.


Thank you. Regards
Silvio
FabD [ML]
Re: Apache2, php-fpm, FastCGI
February 06, 2011 06:00PM
2011/2/6 info <siefkesilvio@googlemail.com>:
> Hello,
>
> i try to run my Apache2 with php-fpm on a Freebsd Server. I has
> search  in Internet for a howto but the most are with Nginx. So i has
> use one of them to try running my Webserver with PHP.
>

Hi,

You can take a look at my tutorial here :

http://blog.myprod.net/2010/08/14/apache2-suexec-fastcgi-php-5-3-3-fpm-cache-opcode-apc/

Hope it can help you.

Fabien

> Website Howto: http://forum.nginx.org/read.php?3,131665,144226#msg-144226
>
> I use the follow configurations:
>
> php-fpm.conf (only the Changes)
> include=/usr/local/etc/php/fpm/*.conf
> pid = /var/run/php-fpm.pid
> error_log = /var/log/apache/php-fpm.log
> www
> listen = 127.0.0.1:9000
> listen.backlog = -1
> listen.owner = www
> listen.group = www
> user = www
> group = www
> pm = dynamic
> pm.max_children = 60
> pm.start_servers = 1
> pm.min_spare_servers = 1
> pm.max_spare_servers = 10
>
> /usr/local/etc/php/fpm/silviosiefke.conf
> [silviosiefke]
> listen = 127.0.0.1:9000
> listen.backlog = -1
> listen.owner = www
> listen.group = www
> #listen.mode = 0750
> user = silviosiefke
> group = silviosiefke
> pm = dynamic
> pm.max_children = 60
> pm.start_servers = 1
> pm.min_spare_servers = 1
> pm.max_spare_servers = 10
>
> /usr/local/etc/apache22/httpd.conf
> LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so
> Include etc/apache22/extra/httpd-fastcgi.conf
>
> /usr/local/etc/apache22/extra/httpd-fastcgi.conf
> <IfModule mod_fastcgi.c>
> FastCgiIpcDir /tmp/fcgi_ipc/
> FastCgiConfig -autoUpdate -singleThreshold 100 -killInterval 300 -idle-
> timeout 240 -maxClassProcesses 1 -pass-header HTTP_AUTHORIZATION
> FastCgiWrapper /usr/local/sbin/suexec
>
> <FilesMatch \.php$>
> SetHandler php5-fcgi
> </FilesMatch>
>
> <Location "/fcgi-bin">
> Order Deny,Allow
> Deny from All
> Allow from env=REDIRECT_STATUS
> </Location>
>
> Action php5-fcgi /fcgi-bin
> </IfModule>
>
> /usr/local/etc/apache22/extra/httpd-vhost.conf
> <IfModule mod_fastcgi.c>
> FastCgiExternalServer /usr/local/www/post_silviosiefke_de -host
> 127.0.0.1:9000 -user silviosiefke -group silviosiefke
> Alias /fcgi-bin 127.0.0.1:9000
> </IfModule>
>
>
> I has use with sockets before, but then i have ever a error in log
> that the path not correct. So i use with listen host. But want not
> running.
>
> [Sun Feb 06 19:10:03 2011] [error] [client ] File does not exist: /usr/
> local/127.0.0.1:9000,
>
> Has someone idea what i must correct use as config.
>
>
> Thank you. Regards
> Silvio
Rainer Duffner
Re: Apache2, php-fpm, FastCGI
February 06, 2011 06:16PM
Am 06.02.2011 um 23:56 schrieb FabD [ML]:

> 2011/2/6 info <siefkesilvio@googlemail.com>:
>> Hello,
>>
>> i try to run my Apache2 with php-fpm on a Freebsd Server. I has
>> search in Internet for a howto but the most are with Nginx. So i has
>> use one of them to try running my Webserver with PHP.
>>
>
> Hi,
>
> You can take a look at my tutorial here :
>
> http://blog.myprod.net/2010/08/14/apache2-suexec-fastcgi-php-5-3-3-fpm-cache-opcode-apc/
>
> Hope it can help you.



Yes,

php-fpm needs to run in conjunction with FastCGIExternalServer.

The tutorial is good.

And it'll teach you some French, in addition ;-)


Rainer
FabD [ML]
Re: Apache2, php-fpm, FastCGI
February 13, 2011 01:46PM
2011/2/7 Rainer Duffner <rainer@ultra-secure.de>:
>
> Am 06.02.2011 um 23:56 schrieb FabD [ML]:
>
>> 2011/2/6 info <siefkesilvio@googlemail.com>:
>>>
>>> Hello,
>>>
>>> i try to run my Apache2 with php-fpm on a Freebsd Server. I has
>>> search  in Internet for a howto but the most are with Nginx. So i has
>>> use one of them to try running my Webserver with PHP.
>>>
>>
>> Hi,
>>
>> You can take a look at my tutorial here  :
>>
>>
>> http://blog.myprod.net/2010/08/14/apache2-suexec-fastcgi-php-5-3-3-fpm-cache-opcode-apc/
>>
>> Hope it can help you.
>
>
>
> Yes,
>
> php-fpm needs to run in conjunction with FastCGIExternalServer.
>
> The tutorial is good.

Thank you ;-)

>
> And it'll teach you some French, in addition ;-)
>
>
> Rainer
>
Silvio siefke
Re: Apache2, php-fpm, FastCGI
February 15, 2011 03:32PM
Hello,

> >
>
> Hi,
>
> You can take a look at my tutorial here :
>
>
> http://blog.myprod.net/2010/08/14/apache2-suexec-fastcgi-php-5-3-3-fpm-cache-opcode-apc/
>
> Hope it can help you.
> >


I have read now the Howto, want use for Virtuell Hosting. When i go on site
i have Forbidden, Error in Log 403.

What do i wrong.

The FPM config for user:
[cms_siefke]
listen = /usr/local/www/vhost/cms.silviosiefke.de/.socks/cms_siefke.sock
listen.owner = cms_siefke
listen.group = cms_siefke
listen.mode = 0777
user = cms_siefke
group = cms_siefke
pm = dynamic
pm.max_children = 20
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
slowlog = /usr/local/www/vhost/cms.silviosiefke.de/logs/php5-fpm.log.slow
php_admin_value[open_basedir]=/usr/local/www/vhost/cms.silviosiefke.de/data
php_admin_value[session.save_path]=/usr/local/www/vhost/
cms.silviosiefke.de/tmp
php_admin_value[upload_tmp_dir]=/usr/local/www/vhost/cms.silviosiefke.de/tmp

Apache Config -httpd.conf-
LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so
AddHandler php5-fastcgi .php
FastCGIExternalServer /usr/local/www/apache22/data -host 127.0.0.1:9000
AddType application/x-httpd-fastphp .php

Apache Config -fastcgi.conf-
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /cgi-bin/php5.external
<Location "/cgi-bin/php5.external">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</Location>
</IfModule>

Virtuell Hosting:
<VirtualHost *:80>
ServerName cms.silviosiefke.de
ServerAdmin siefke@email.de
DocumentRoot /usr/local/www/vhost/cms.silviosiefke.de/data
Options None

# Fast CGI + FPM
FastCgiExternalServer /usr/local/www/vhost/
cms.silviosiefke.de/cgi-bin/php5.external -socket /usr/local/www/vhost/
cms.silviosiefke.de/.socks/cms_siefke.sock
Alias /cgi-bin/ /usr/local/www/vhost/cms.silviosiefke.de/cgi-bin

<Directory /home/www/firstweb/public_html>
Options SymLinksIfOwnerMatch +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>

# Log
ErrorLog /usr/local/www/vhost/cms.silviosiefke.de/logs/error.log
LogLevel warn
CustomLog /usr/local/www/vhost/cms.silviosiefke.de/logs/access.log combined
</VirtualHost>

Has someone a idea?


Silvio
Silvio siefke
Re: Apache2, php-fpm, FastCGI
February 15, 2011 03:32PM
Hello,


thanks for answer. The System is running now.

But i have problem. When i go on www.site.com i have the Error 404. When i
use www.site.com/index.php
all is good. The DirectoryIndex is not at use. Give there something to fix
this?


Thanks
Silvio

2011/2/13 FabD [ML] <flylm.ml@gmail.com>

> 2011/2/7 Rainer Duffner <rainer@ultra-secure.de>:
> >
> > Am 06.02.2011 um 23:56 schrieb FabD [ML]:
> >
> >> 2011/2/6 info <siefkesilvio@googlemail.com>:
> >>>
> >>> Hello,
> >>>
> >>> i try to run my Apache2 with php-fpm on a Freebsd Server. I has
> >>> search in Internet for a howto but the most are with Nginx. So i has
> >>> use one of them to try running my Webserver with PHP.
> >>>
> >>
> >> Hi,
> >>
> >> You can take a look at my tutorial here :
> >>
> >>
> >>
> http://blog.myprod.net/2010/08/14/apache2-suexec-fastcgi-php-5-3-3-fpm-cache-opcode-apc/
> >>
> >> Hope it can help you.
> >
> >
> >
> > Yes,
> >
> > php-fpm needs to run in conjunction with FastCGIExternalServer.
> >
> > The tutorial is good.
>
> Thank you ;-)
>
> >
> > And it'll teach you some French, in addition ;-)
> >
> >
> > Rainer
> >
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 69
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready