2014-02-27 62 views
1

我使用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(&緩存文件不是再生)Drupal boost緩存每次覆蓋

如果高速緩存文件夾具有所有者apache和集團apache 775權限,當用戶訪問頁面,沒有權限問題。但是,當用戶訪問頁面時,緩存會重新生成。

此問題是否由於服務器權限而發生?或者由於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 ### 
+0

您是否曾經找到過解決方案?我有類似的問題。 – Hawkee

+0

也有興趣聽到這個解決方案 - 只有主頁有相同的問題。 – freethebees

回答

0

這裏有一些猜測,因爲你din't剩多少信息:

  1. 您的Web服務器的用戶不叫「阿帕奇」或集團是錯誤的?
  2. 你忘了啓用mod_rewrite?或忘記允許AllowOverride爲您的.htaccess?
  3. 搞砸了.htaccess文件,並在錯誤的地方粘貼了增強設置? (發生在我身上一次...)
  4. 你以某種方式安裝了類似於/ var/www/mysite/SUBPATH /的子路徑中的drupal,但將url指向了「mysite」路徑? (我想這可能會搞砸重寫規則)
  5. 您是否嘗試將該目錄添加爲「apache」-user?像:runuser -l apache -c'mkdir/your/drupal/dir/newdir'? - >如果這不起作用,你知道這是一個許可問題。
  6. 我用盡了想法......