setting up virtual hosts for domains on cpanel vps


Well-Known Member
Nov 23, 2005

I am wondering if someone can help me.

I am running mod_pagespeed module on two cpanel vps's, and it is working well.

I am now looking at further customising the installation, however I need some advise regading setting up Virtual Hosts in cpanel servers?

1. Using PageSpeed With Virtual Hosts -

I have the pagespeed.conf at the location: usr/local/apache/conf/pagespeed.conf

Can you assist where I set up / create Virtual Hosts on a cpanel vps (running centos)?

I asked over at Google groups:!topic/mod-pagespeed-discuss/3E1AL88WUTg

and they said:

"IF I understand Apache correctly there must be a VirtualHost in the conf files somewhere for that domain to work.
cPanel probably automatically creates it for you in one of its config files.
I think the quickest solution would be to find it (presumably under /var/cpanel or wherever it's installed) and edit that file.
The problem there is that I'd imagine if you reconfigure the domain using cPanel it'll lose that change.
Perhaps a Q to the cPanel forum will come up with a proper solution?"
Can I ask how I would set up Virtual Hosts for my example domain: so that I can add the following code for mod_pagespeed for that domain:

ModPagespeed On
ModPagespeedInheritVHostConfig on
# Direct Apache to send all HTML output to the mod_pagespeed
# output handler.
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
NameVirtualHost *:80
<VirtualHost *:80>
  DocumentRoot /www/
  ModPagespeedEnableFilters combine_css
Thanks for any help.

Kind regards,