0

Ubuntu 16.04.1 Apache/2.4.18 PHP 5.6.32

I am trying to make a separate pool for each virtual host. So I created site1.config in /etc/php/5.6/fpm/pool.d:

[site1]
user = site1
group = site1
listen = /var/run/php/php5.6-fpm-site1.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

When I restart the FastCGI server, I see the processes being created. So far, so good! Then I create /etc/apache2/sites-available/site1.config:

<VirtualHost *:80>
    ServerName site1.com
    ServerAlias www.site1.com

    ServerAdmin webmaster@localhost
    DocumentRoot /data/site1/html
    <Directory /data/site1/html>
            AllowOverride All
            Options -MultiViews
            Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <IfModule mod_fastcgi.c>
        AddType application/x-httpd-fastphp5 .php
        Action application/x-httpd-fastphp5 /php5-fcgi
        Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi-site1
        FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi-site -socket /var/run/php/php5.6-fpm-site1.sock -pass-header Authorization
    </IfModule>
</VirtualHost>

After restarting Apache I can access the virtual host at site1.com but in the environment section of phpinfo I see that the user is still www-data. Any ideas? Thanks in advance.

Martin Dimitrov
  • 113
  • 1
  • 8

0 Answers0