1

I read this article to set up virtual host with mod_fastcgi, but I don't quite understand the following configuration:

FastCgiExternalServer /var/www/php5.external -host 127.0.0.1:9000
AddHandler php5-fcgi .php
Action php5-fcgi /usr/lib/cgi-bin/php5.external
Alias /usr/lib/cgi-bin/ /var/www/

Can someone explain this?

Edit: What confused me is that why alias is used here. Why not use /var/www/php5.external in Action?

xuhdev
  • 800
  • 2
  • 6
  • 19
  • this is old article, you better install nginx, or upgrade to apache 2.4 and use mod_proxy_fcgi – ADM Jun 21 '15 at 08:50

1 Answers1

0
    http://httpd.apache.org/docs/2.2/handler.html
    http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html


<VirtualHost 1.2.3.4:80>
     ServerName domain.tld
     ServerAlias www.domain.tld

     <IfModule mod_fastcgi.c>
        ## http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html#FastCgiExternalServer
        FastCgiExternalServer /tmp/fpm-domain -idle-timeout 7200  -host 127.0.0.1:9000
        ## http://httpd.apache.org/docs/2.2/mod/mod_alias.html#alias
        Alias /tmp/fpm-engine /tmp/fpm-domain

        ## http://httpd.apache.org/docs/2.2/mod/core.html#filesmatch
     <FilesMatch \.php$>
        ## http://httpd.apache.org/docs/2.2/mod/core.html#sethandler
        SetHandler php-fpm
     </FilesMatch>
        ## http://httpd.apache.org/docs/2.2/mod/mod_actions.html#action
        Action php-fpm /tmp/fpm-engine
     </IfModule>

      DocumentRoot /var/www/domain/web

      <Directory /var/www/domain/web>
         ## http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride
         AllowOverride All
      </Directory>

</VirtualHost>
ADM
  • 1,353
  • 12
  • 16