Mod_pagespeed is enabled. FileCachePath must not be empty:

1.6k views Asked by At

I've tried to restrain myself from asking too many questions on Stack Overflow, but I have been trying to get mod_pagespeed enabled on my Apache2 server for a couple days now, and am ready to start pulling out my hair hah. I installed mod_pagespeed, and mod_pagespeed_ap24, although I only need mod_pagespeed_ap24 for my version of Apache2. I edited Apache's configuration in /apache2/conf/httpd.conf loading the module in

LoadModule pagespeed_module  modules/mod_pagespeed_ap24.so

I restarted the server successfully, but get a 502 bad gateway, and this error

[mod_pagespeed 1.12.34.2-0 @27107] mod_pagespeed is enabled. FileCachePath must not be empty: define_name=(null) defne_line_number=0 server_hostname=web551.webfaction.com port=0

I tried multiple times to edit mod_pagespeed's config file in linux, but nothing worked. So instead I created a symbolic link to a static/php/cgi on Webfaction to serve my media through an Apache server instead of their nginix server, so I could use an .htaccess file to configure my Apache server. I am still getting the issue however.

.htaccess file

Options +FollowSymLinks
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"

</IfModule>



#Begin gzip and deflate
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css application/x-javascript text/plain text/xml image/x-icon
</IfModule>

<IfModule mod_pagespeed_ap24.c>
    ModPagespeed on
    ModPagespeedFileCachePath "/home/doc4design/var/cache/mod_pagespeed"
    ModPagespeedEnableFilters rewrite_css,combine_css
    ModPagespeedEnableFilters recompress_images
    ModPagespeedEnableFilters convert_png_to_jpeg,convert_jpeg_to_webp
    ModPagespeedEnableFilters collapse_whitespace,remove_comments
</IfModule> 

Apache httpd.conf

ServerRoot "/home/doc4design/webapps/django_2016/apache2"

LoadModule authz_core_module modules/mod_authz_core.so
LoadModule dir_module        modules/mod_dir.so
LoadModule env_module        modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module       modules/mod_mime.so
LoadModule rewrite_module    modules/mod_rewrite.so
LoadModule setenvif_module   modules/mod_setenvif.so
LoadModule wsgi_module       modules/mod_wsgi.so
LoadModule unixd_module      modules/mod_unixd.so
LoadModule pagespeed_module  modules/mod_pagespeed_ap24.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/doc4design/logs/user/access_django_2016.log combined
ErrorLog /home/doc4design/logs/user/error_django_2016.log

Listen 30651
KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
ServerLimit 1
StartServers 1
MaxRequestWorkers 5
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 5

WSGIDaemonProcess django_2016 processes=2 threads=12 maximum-requests=100 python-path=/home/doc4design/webapps/django_2016:/home/doc4design/webapps/django_2016/doc4_2016:/home/doc4design/webapps/django_2$
WSGIProcessGroup django_2016
WSGIRestrictEmbedded On
WSGILazyInitialization On
WSGIScriptAlias / /home/doc4design/webapps/django_2016/doc4_2016/webapp/wsgi.py
1

There are 1 answers

1
Fraser On BEST ANSWER

Are you sure the path /home/doc4design/var/cache/mod_pagespeed exists? If so can Apache access the path?

Confirm the path exists and grant permissions to www-data on it, or which ever user apache is running under.