【发布时间】:2014-02-27 14:03:43
【问题描述】:
我正在使用 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 ###
【问题讨论】:
-
您找到解决方案了吗?我也有类似的问题。
-
也有兴趣听到解决方案 - 仅在主页有同样的问题。
标签: php apache drupal-7 load-balancing drupal-boost