Ubuntu 16.04.1
Apache/2.4.18
PHP 5.6.32
我正在尝试为每个虚拟主机创建一个单独的池。因此我创建site1.config
了/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 = /
当我重启FastCGI
服务器时,我看到正在创建的进程。到目前为止一切顺利!然后我创建/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>
重新启动后,Apache
我可以访问虚拟主机,site1.com
但在环境部分,phpinfo
我看到用户仍然是www-data
。有什么想法吗?提前致谢。