我正在使用 drupal 7 boost 模块生成 html 缓存。我正在使用负载均衡器服务器,html缓存文件位于节点1、节点2和节点3中。如果此缓存文件夹具有775权限,所有者为“root”,组为“root”,当用户访问页面时,有drupal 日志中的权限问题为The file permissions could not be set on cache/normal/IP_ADDRESS/PATH_TO_FILE/NAME_OF_THE_FILE.html
(& 缓存文件未重新生成)
如果这个缓存文件夹有 775 权限,所有者为apache
,组为apache
,当用户访问页面时,没有权限问题。但是每次用户访问页面时都会重新生成缓存。
此问题是否由于服务器权限而发生?或由于drupal boost配置。
以下是 .htacces 增强设置。
### BOOST START ###
# Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
RewriteRule .* - [E=boostpath:normal]
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/vc/vacanze-in-montagna/(admin|cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password| register))$) [OR]
RewriteCond %{HTTPS} on [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=3]
# GZIP
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule .* - [S=1]
RewriteCond %{DOCUMENT_ROOT}/vc/vacanze-in-montagna/cache/%{ENV:boostpath}/LOAD_BALANCER_IP%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
RewriteRule .* cache/%{ENV:boostpath}/LOAD_BALANCER_IP%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html,E=no-gzip:1]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/vc/vacanze-in-montagna/cache/%{ENV:boostpath}/LOAD_BALANCER_IP%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/%{ENV:boostpath}/LOAD_BALANCER_IP%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
### BOOST END ###