我有apache-mpm-itk + php_module设置,用户的文件夹/文件属于他们。但是我想将几个帐户迁移到nginx + php-fpm。
如果我想将nginx / php-fpm与属于不同用户的虚拟主机一起使用,对文件夹/文件的正确权限应该是什么?
例如,用户的家:
/var/www/user/data/www/domain.com
权限为user:user
这是来自主机的nginx conf的代码:
server {
listen 8080;
server_name domain.com;
root /var/www/user/data/www/domain.com/;
index index.php index.html index.htm;
location / {
# First attempt to serve request as file
try_files $uri $uri/index.php;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm/domain.com.socket;
fastcgi_index index.php;
include fastcgi_params;
}
}
这是来自php-fpm的池配置:
[domain.com]
listen = /var/run/php5-fpm/domain.com.socket
listen.backlog = -1
listen.owner = user
listen.group = user
listen.mode=0660
; Unix user/group of processes
user = user
group = user
; Choose how the process manager will control the number of child processes.
pm = dynamic
pm.max_children = 75
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 500
; Pass environment variables
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /var/www/user/data/tmp
env[TMPDIR] = /var/www/user/data/tmp
env[TEMP] = /var/www/user/data/tmp
; host-specific php ini settings here
; php_admin_value[open_basedir] = /var/www/user/data:/tmp
php_admin_value[error_log] = /var/user/data/logs/fpm-php.log
php_admin_value[realpath_cache_size] = 4096K