![PHP FastCGI 仍然在 www-data 用户下运行](https://linux22.com/image/715993/PHP%20FastCGI%20%E4%BB%8D%E7%84%B6%E5%9C%A8%20www-data%20%E7%94%A8%E6%88%B7%E4%B8%8B%E8%BF%90%E8%A1%8C.png)
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
。有什么想法吗?提前致谢。