Bashed

Well-Known Member
Dec 18, 2013
143
4
68
cPanel Access Level
Root Administrator
Enabled mod_pagespeed in EA4 (on CloudLinux)

Rapid logging in apache logs like the below, what's the fix?

Code:
Failed to make directory /var/mod_pagespeed/cache/rname: Permission denied
 

opt2bout

Well-Known Member
Nov 10, 2006
69
1
158
Just an FYI, in the latest CURRENT (64) build, mod_pagespeed will install and operate after you make a few post-installation changes:

chgrp nobody /var/mod_pagespeed/
chmod g+w /var/mod_pagespeed/

EA4 creates the pagespeed cache directory, but assigns ownership to root (which doesn't work for our configuration with apache running as nobody).

As noted on Github, the pagespeed.conf file is located in /etc/apache2/conf.modules.d/456_pagespeed.conf

We are running Apache, HTTP2, MPM Event, and PHP-FPM/FastCGI from the EA4 install and things are working.

BTW build 33 updates the apache vhost templates to correct for the .user.ini directory traversal so no longer need to create .local overrides
 
  • Like
Reactions: Rodrigo Gomes

splaquet

Well-Known Member
Sep 24, 2008
53
3
58
W. Hartford, CT
cPanel Access Level
Root Administrator
Twitter
opt2bout, i had a quick question about your post. all of a sudden i started seeing a few server issues and noticed that pagespeed was throwing some errors. i found that the permissions had changed on the dirs, so i updated them as above.

(BTW, I have my files located in /var/cache/mod_pagespeed/, but i'm referencing your location above)

1) is it chgrp or chown?
chgrp nobody /var/mod_pagespeed/
or
chown nobody:nobody /var/mod_pagespeed/

2) since it's a previous install, should it also be -R to recursively hit all of the current files/folders?

3) does this method have to be run manually every time there's an upgrade applied or is there a way to slide it into the config or cron, where it'd run the commands every time that the pagespeed.conf is loaded?

thank you in advance!
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Hello,

Keep in mind that mod_pagespeed will not work properly with per-user MPMs (e.g. MPM ITK). This is something we'll document (and likely create a package conflict for during the install process) once Mod_Pagespeed is no longer in the experimental phase.

Thank you.
 

opt2bout

Well-Known Member
Nov 10, 2006
69
1
158
opt2bout, i had a quick question about your post. all of a sudden i started seeing a few server issues and noticed that pagespeed was throwing some errors. i found that the permissions had changed on the dirs, so i updated them as above.

(BTW, I have my files located in /var/cache/mod_pagespeed/, but i'm referencing your location above)

1) is it chgrp or chown?
chgrp nobody /var/mod_pagespeed/
or
chown nobody:nobody /var/mod_pagespeed/

2) since it's a previous install, should it also be -R to recursively hit all of the current files/folders?

3) does this method have to be run manually every time there's an upgrade applied or is there a way to slide it into the config or cron, where it'd run the commands every time that the pagespeed.conf is loaded?

thank you in advance!
The commands are verbatim of what I did to get pagespeed to work in my configuration after the EA4 installation script ran.

With servers that I experimented with before pagespeed was an option in EA4 my cache directory wasn't in the same location as where EA4's install script created it--so I didn't have anything pre-existing (because once EA4 installed mod_pagespeed, the directory structure didn't have the rights to do anything there until I made the changes documented).

If you are migrating to EA4 installation of mod_pagespeed, I would assume your pagespeed cache folder would also be empty until you assigned the appropriate rights for apache to write to it ???

As far as updates go, all of my systems have been updated several times since. A few of them running the new 66 build, and I've not gone back to make any changes since. I have not tested removing pagespeed and reinstalling it via EA4 with 66 though.