incubator-pagespeed-mod icon indicating copy to clipboard operation
incubator-pagespeed-mod copied to clipboard

How to access admin console?

Open Ezyweb-uk opened this issue 7 years ago • 3 comments

I've installed and enabled mod_pagespeed in Easyapache in WHM/Cpanel, but the following urls are not found: http://mydomain.com/pagespeed_global_admin http://mydomain.com/pagespeed_admin/console http://mydomain.com/pagespeed_admin/ Also tried with .htaccess disabled.

Does the admin section need to be enabled by a configuration setting, if so which file would it be in and where please?

Ezyweb-uk avatar Feb 08 '18 16:02 Ezyweb-uk

Not sure if you solved this but personally for me I had to access from root url as I installed it under root user so for example https://servername.domainname.com/pagespeed_global_admin/ basically server hostname.

It seems to install under the default apache doc root rather than the ones based in homedir for user accounts

AWOL-TECH avatar Jul 25 '18 13:07 AWOL-TECH

You may also need to add something like this to your pagespeed conf file

# disable fallback for below
ModPagespeedStatisticsDomains Disallow *
ModPagespeedGlobalStatisticsDomains Disallow *
ModPagespeedMessagesDomains Disallow *
ModPagespeedConsoleDomains Disallow *
ModPagespeedAdminDomains Disallow *
ModPagespeedGlobalAdminDomains Disallow *
# Restrict access to only hostname.domain.com
ModPagespeedStatisticsDomains Allow hostname.domain.com
ModPagespeedGlobalStatisticsDomains Allow hostname.domain.com
ModPagespeedMessagesDomains Allow hostname.domain.com
ModPagespeedConsoleDomains Allow hostname.domain.com
ModPagespeedAdminDomains Allow hostname.domain.com
ModPagespeedGlobalAdminDomains Allow hostname.domain.com

and then further down the file too


 <Location /mod_pagespeed_statistics>
      Order allow,deny
      # You may insert other "Allow from" lines to add hosts you want to
      # allow to look at generated statistics.  Another possibility is
      # to comment out the "Order" and "Allow" options from the config
      # file, to allow any client that can reach your server to examine
      # statistics.  This might be appropriate in an experimental setup or
      # if the Apache server is protected by a reverse proxy that will
      # filter URLs in some fashion.
      Allow from localhost
      SetHandler mod_pagespeed_statistics
  </Location>

<Location /pagespeed_admin>
   <IfModule mod_rewrite.c>
      RewriteEngine Off
   </IfModule>
   Order allow,deny
   Allow from localhost
   SetHandler pagespeed_admin
</Location>
<Location /pagespeed_global_admin>
   <IfModule mod_rewrite.c>
      RewriteEngine Off
   </IfModule>
   Order allow,deny
   Allow from all
   SetHandler pagespeed_global_admin
</Location>

(Please note I disabled all external access to everything but /pagespeed_global_admin/ if you want access to all of these change it from allow from localhost to allow from all

AWOL-TECH avatar Jul 26 '18 15:07 AWOL-TECH

@timeassistant

In your posted configuration, the line: "RewriteEngine Off" is a misconfiguration, and adding it to your system will not change any system behavior. Why "RewriteEngine Off" is allowed by Apache is that, if you include multiple "RewriteRule" parameters in your configuration, then instead of commenting them all, you can explicitly using “RewriteEngine Off” to disable all "RewriteRule".

More importantly, the default value of “RewriteEngine" is already an "off", so adding “RewriteEngine Off" is quite unnecessary and it may cause confusion to users.

Since herein there is no "RewriteRule", deleting “RewriteEngine Off” would be ideal.

Related Apache source code snippet:

run_rewritemap_programs(server_rec *s , apr_pool_t *p){
if (conf->state == ENGINE_DISABLED) { // usage of "RewriteEngine"
  return APR_SUCCESS; // early return
rewritemap_program(...); // usage of "RewriteRule" 
}

JialuZhang avatar Feb 24 '21 17:02 JialuZhang