1

I'm generating html cache using drupal 7 boost module. I'm using a load balancer server and html cache files are in node 1, node 2 and node 3. If this cache folder has 775 permission with owner as "root" and Group as "root", When user access page, there is permission issue in the drupal logs as The file permissions could not be set on cache/normal/IP_ADDRESS/PATH_TO_FILE/NAME_OF_THE_FILE.html(& cache files are not regenerating)

If this cache folder has 775 permission with owner as apache and Group as apache, When user access page, there is no permission issue. But cache is regenerate ever time when user access the page.

Is this issue occurred due to server permission? or due to drupal boost configuration.

Following are the .htacces boost settings.

### 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 ###
snollygolly
  • 1,858
  • 2
  • 17
  • 31
wsinghe
  • 11
  • 1

1 Answers1

0

Here are a few guesses since you din't left much information:

  1. Your webserver user isn't called "apache" or the group is wrong?
  2. You forgot to enable mod_rewrite? Or forgot the allow AllowOverride for your .htaccess?
  3. You messed up the .htaccess file and pasted the boost settings at the wrong place? (happend to me once...)
  4. You somehow installed drupal in a subpath like /var/www/mysite/SUBPATH/ but pointed the url to "mysite" path? (I guess that could mess up the rewrite rules)
  5. Have you tried to add that directory as the "apache"-user? Like : runuser -l apache -c 'mkdir /your/ drupal/dir/newdir'? -> if that doesn't work you know it's a permission problem.
  6. I'm running out of ideas....
Chris
  • 116
  • 1
  • 6