apache / incubator-pagespeed-mod

Apache module for rewriting web pages to reduce latency and bandwidth.
http://modpagespeed.com
Apache License 2.0
696 stars 159 forks source link

Doc configuration differences for Cpanel installs #770

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I am trying to restrict mod_pagespeed in cpanel for one of my subdomain name. 

What i am actually doing is creating a virtual host as per guide here 
(https://developers.google.com/speed/pagespeed/module/configuration)

I have a main domain for (desktop site) and subdomain for (Mobile Site)

eg:

domain name.com (Desktop Site)
m.domainname.com (Mobile Site)

So to restrict mobile site to use mod_pagespeed i am following below steps:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /home/username/public_html/m
ServerName m.domainname.com
ModPagespeed Off
</VirtualHost>

When I restarted apache i got this error

VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost 
address is not supported, proceeding with undefined results

[warn] NameVirtualHost *:80 has no VirtualHosts

--------------------------------------------------------------------------------
-----

Now i looked inside httpd.conf file how cpanel has setup this and found it to 
define ip address in "NameVirtualHost" and "VirtualHost" 
(/usr/local/apache/conf/httpd.conf). So i changed this config to:

NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xx:80>
DocumentRoot /home/username/public_html/m
ServerName m.domainname.com
ModPagespeed Off
</VirtualHost>

xxx.xxx.xxx.xxx is the ip address defined inside httpd.conf for the domain 
m.domainname.com, "namevirtualhost" and "virtualhost" has same ip address.

Again i restarted apache and got this error:

[warn] NameVirtualHost xxx.xxx.xxx.xxx:80 has no VirtualHosts

Now the mobile site (m.domainname.com) started giving 503 error

Can anyone suggest whats the issue?

mod_pagespspeed version: 1.4

Os: Centos

Apache: 2.2

Control Panel: cpanel

Original issue reported on code.google.com by brijendr...@gmail.com on 27 Aug 2013 at 1:08

GoogleCodeExporter commented 9 years ago
This doesn't sound like a mod_pagespeed issue. It sounds like a general Apache 
configuration issue. Does this still fail without mod_pagespeed?

Original comment by sligocki@google.com on 27 Aug 2013 at 6:27

GoogleCodeExporter commented 9 years ago
No it doent fail without mod_pagespeed configuration. There must be some tweak 
in pagespeed.conf file to do so

Original comment by brijendr...@gmail.com on 27 Aug 2013 at 11:49

GoogleCodeExporter commented 9 years ago
Please check all your configuration files for any /other/ instances of
NameVirtualHost and VirtualHost, in particular any like this:
NameVirtualHost *
<VirtualHost *>

If these exist then any more specific directives will be ignored. See
http://wiki.apache.org/httpd/VirtualHostsMixingPorts

Original comment by matterb...@google.com on 28 Aug 2013 at 12:57

GoogleCodeExporter commented 9 years ago
Well i have set everything perfectly but it didnt work with cpanel. I believe 
you should do some testing to overcome with the issue.

I was given an alternative here : https://github.com/pagespeed/cpanel/issues/7

which fixed my problem for now. Ty

Original comment by brijendr...@gmail.com on 28 Aug 2013 at 2:29

GoogleCodeExporter commented 9 years ago
Per Ilya's comment the issue was caused by the hand edits to the core apache 
config file that CPanel overwrites, so I don't see what testing we can do or 
how we can overcome the issue - it is *CPanel* messing with things not 
mod_pagespeed.

Original comment by matterb...@google.com on 28 Aug 2013 at 2:38

GoogleCodeExporter commented 9 years ago
Well i am not editing apache file, instead of that i was adding that 
virtualhost in  pagespeed.conf file. Cpanel will not overwrite pagespeed.conf 
file in any way.

Original comment by brijendr...@gmail.com on 28 Aug 2013 at 3:00

GoogleCodeExporter commented 9 years ago
Just to clarify this is the same issue as 
https://github.com/pagespeed/cpanel/issues/7 and the same issue that you 
emailed us about on mod-pagespeed-discuss? And it has been resolved?

Original comment by sligocki@google.com on 28 Aug 2013 at 3:13

GoogleCodeExporter commented 9 years ago
yes but i was adding those thing in pagespeed.conf file as mentioned in your 
documentation 
(https://developers.google.com/speed/pagespeed/module/configuration). But it 
didnt work and  igrigorik provided me alternative of that to include 
modpagespeed off in htaccess file.

Original comment by brijendr...@gmail.com on 28 Aug 2013 at 3:20

GoogleCodeExporter commented 9 years ago
Oh, I understand now. Thanks for reporting this.

We should update the documentation to describe how best to configure for Cpanel 
installs.

Original comment by sligocki@google.com on 28 Aug 2013 at 3:22

GoogleCodeExporter commented 9 years ago
ty for understanding. I think i didnt mentioned that i was adding virtualhost 
config in pagespeed.conf file and that was confusing for you

Original comment by brijendr...@gmail.com on 28 Aug 2013 at 3:35