mod_pagespeed 1.9.32.2-4321 Permission denied opening temp file

649 views
Skip to first unread message

apacher

unread,
Oct 30, 2014, 1:22:45 AM10/30/14
to mod-pagesp...@googlegroups.com
Hello,

I have updated to mod_pagespeed 1.9.32.2-4321 beta release and some images doesn't appeare on my webpage.

I am getting error messages like this

Opening temp file: Permission denied

[Thu Oct 30 00:29:02 2014] [error] [mod_pagespeed 1.9.32.2-4321 @12xxx] /var/cache/mod_pagespeed/rname/ic_BZ3prteTLgXCEiu38qzB/http,3A/,2Fewww.mydomain/some_image.jpg,42d,40tps_,.tempuTVeQO:0: opening temp file: Permission denied


Joomla! 3 website using varnish cache debian wheezy 32bit
I switched back to the stable version and it looks like error messages are gone, images loaded on my pages again. Everything is ok.


(I just reported it. I do not know if it happens only with my configuration.)



Joshua Marantz

unread,
Oct 30, 2014, 1:51:13 PM10/30/14
to mod-pagespeed-discuss
Can you check the ownership of directory /var/cache/mod_pagespeed, and make sure it's the same as the processes running Apache?

I'm guessing the owner of both should be 'www-data'.

-Josh

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/1689424a-fbfa-45df-90fd-7c6f655a5a96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

apacher

unread,
Oct 30, 2014, 5:34:33 PM10/30/14
to mod-pagesp...@googlegroups.com
Note: Currently I am using the latest stable version. mod_pagespeed 1.8.31.5-4307
(Should I switch back to beta channel and  check the ownership again? )
ls -l

-rw-------  1 myusername    myusername       13 Oct 30 20:35 !clean!time!
drwxr-xr-x  3 myusername    myusername     4096 Jun  4 10:43 "mydomain .com"
drwxr-xr-x  3 www-data www-data  4096 Sep 25 07:40 localhost
drwxrwxrwx  3 www-data www-data  4096 May 31 05:35 prop_page
drwxr-xr-x 45 myusername    myusername    12288 Oct 30 20:35 rname
drwxr-xr-x  3 myusername    myusername     4096 Oct 25 12:43 www."server ip address"



2014. október 30., csütörtök 18:51:13 UTC+1 időpontban jmarantz a következőt írta:
Can you check the ownership of directory /var/cache/mod_pagespeed, and make sure it's the same as the processes running Apache?

I'm guessing the owner of both should be 'www-data'.

-Josh
On Thu, Oct 30, 2014 at 1:22 AM, apacher <timea....@gmail.com> wrote:
Hello,

I have updated to mod_pagespeed 1.9.32.2-4321 beta release and some images doesn't appeare on my webpage.

I am getting error messages like this

Opening temp file: Permission denied

[Thu Oct 30 00:29:02 2014] [error] [mod_pagespeed 1.9.32.2-4321 @12xxx] /var/cache/mod_pagespeed/rname/ic_BZ3prteTLgXCEiu38qzB/http,3A/,2Fewww.mydomain/some_image.jpg,42d,40tps_,.tempuTVeQO:0: opening temp file: Permission denied


Joomla! 3 website using varnish cache debian wheezy 32bit
I switched back to the stable version and it looks like error messages are gone, images loaded on my pages again. Everything is ok.


(I just reported it. I do not know if it happens only with my configuration.)



--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Joshua Marantz

unread,
Oct 30, 2014, 6:48:48 PM10/30/14
to mod-pagespeed-discuss
You might as well.  We'll mark the newly patched beta stable if all goes well for a few weeks, so we might as well sort this out now.  Do you get these error messages if you just do something like:

sudo chown -R www-data /var/cache/mod_pagespeed

It'd be great to understand how it comes to pass that 'myusername' is the owner of these files.  Are you dabbling with an Apache MPM that uses suexec or something so that each vhost runs under its own user ID?

-Josh

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/9081b323-c2b6-4c83-a52a-99b02b36dbc1%40googlegroups.com.

apacher

unread,
Nov 1, 2014, 12:22:01 AM11/1/14
to mod-pagesp...@googlegroups.com
So what I did.

Reinstalled mod_pagespeed 1.9.32.2-4321 (removed stable 1.8.31.5-4307)

I deleted the cache using - touch /var/cache/mod_pagespeed/cache.flush

(I am using Varnish cache 3.x so I also restarted varnish to recache the webpages.)


Then I checked the error logs  tail -10 /var/log/apache2/error.log

and error messages appeared immediately
opening temp file: Permission denied


 /var/cache/mod_pagespeed/rname/ic_ebumligxxxxx9pofEmeI/http,3A/,2Fsome_thing.com/images/home.png,40x,40v_,.temptLom5I:0: opening temp file: Permission denied

I checked the ownership in folder

ls -l /var/cache/mod_pagespeed/


-rw-r--r--  1 root     root         0 Nov  1 03:54 cache.flush
-rw-------  1 myusername    myusername       13 Nov  1 03:11 !clean!time!
drwxr-xr-x  3 myusername    myusername     4096 Jun  4 10:43 some_thing.com
drwxr-xr-x  3 www-data www-data  4096 Sep 25 07:40 localhost
drwxrwxrwx  3 www-data www-data  4096 May 31 05:35 prop_page
drwxr-xr-x 52 myusername    myusername    12288 Nov  1 03:54 rname
drwxr-xr-x  3 myusername    myusername     4096 Oct 25 12:43 www.64.1XX.XXX.XXX


About your last question: This is a normal default debian 32 bit installation. No Apache MPM afaik.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Joshua Marantz

unread,
Nov 1, 2014, 7:11:20 AM11/1/14
to mod-pagespeed-discuss
I see that a few months ago you had the exact same problem with MPS 1.8, from this thread:


Did those chmod commands work?

Also -- is there any chance you are running SELinux?  Please see this bug from a couple of years ago:


-Josh

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/bb78fb3e-5aa2-4502-ac81-0c2b46c8931a%40googlegroups.com.

apacher

unread,
Nov 1, 2014, 5:25:04 PM11/1/14
to mod-pagesp...@googlegroups.com
(You are right, I completely forgot that the same issue has already happend. I only remembered that I had issues on stats_log_global permissions.)

I gave a+w write permission on all files under /var/cache/mod_pagespeed recursively
and it looks like permission errors are gone, both stable and beta channel was tested.

Sorry for the trouble and thank you for your time!

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Joshua Marantz

unread,
Nov 2, 2014, 8:44:17 AM11/2/14
to mod-pagespeed-discuss
It is curious that you are again having this problem and I wonder if there's something that you are doing in your flow that causes folders to be created under your own username.  it is probably not a great idea to run, long-term, with your cache directory set as world-writeable.  You definitely would need to trust everyone that can ever gain any kind of access into your machine.  I would look for a way to try to ensure that all the writers of your file-cache are the same user (usually www-data).  Make sure the file-cache directories are owned by www-data and investigate why anyone else needs to read or write.

-Josh

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/9c9ece5f-fb92-4604-8991-fa1d93142ada%40googlegroups.com.

Andy Gee

unread,
Jul 13, 2016, 12:32:25 PM7/13/16
to mod-pagespeed-discuss
I'm having the same problem but I think it's because I'm using mpm_itk_module which changes the user based on the vhost.
Is there any way to change the cache directory for mod_pagespeed on a per vhost basis?

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Andy Gee

unread,
Jul 13, 2016, 2:48:18 PM7/13/16
to mod-pagespeed-discuss
Sorry, my inexperience showing here.

I was of course able to set the cache directory from within the vhost

pagespeed.conf
<IfModule pagespeed_module>
    ModPagespeed off
    ...
    ...
    ModPagespeedLogDir "/var/log/pagespeed"
    ...
    ...
</IfModule>


vhost file
    <IfModule mpm_itk_module>
        AssignUserId ********* users
   
</IfModule>
   
   
<IfModule pagespeed_module>
        ModPagespeed on
        ModPagespeedFileCachePath "/var/cache/mod_pagespeed/
*********/"
   
</IfModule>

Where
********* is the username
Reply all
Reply to author
Forward
0 new messages