how to configure OLS for pagespeed vs non-pagespeed tests of same vhost

172 views
Skip to first unread message

George Liu

unread,
Apr 11, 2015, 6:53:48 AM4/11/15
to openlitespee...@googlegroups.com
Okay need some help configuring OLS 1.4.7 for pagespeed vs non-pagespeed tests of the same vhost via different ports

I concurrently have it modpagespeed module installed on server host level with pagespeed off and then added a 2nd set of listeners (8108 for http and 8109 for https) which have the modpagespeed module installed and with pagespeed on but not seeing any pagespeed headers set when accessing via 8108 or 8109 ports.

My OLS configuration is posted at https://bitbucket.org/snippets/eva2000/eK8L

This is how I want it to work

OpenLiteSpeed 1.4.7 http 8098 = http://h2ohttp2.centminmod.com:8098/flags.html
OpenLiteSpeed 1.4.7 HTTP/2 8099 = https://h2ohttp2.centminmod.com:8099/flags.html
OpenLiteSpeed 1.4.7 + modpagespeed http 8108 = http://h2ohttp2.centminmod.com:8108/flags.html
OpenLiteSpeed 1.4.7 + modpagespeed HTTP/2 8109 = https://h2ohttp2.centminmod.com:8109/flags.html

this is the correct way to configure OLS for modpagespeed with different ports to the same vhost - at the listener level right ?

David

unread,
Apr 13, 2015, 10:48:21 AM4/13/15
to openlitespee...@googlegroups.com
OK, it is simple.
For me, I made such a testing just copy a 8089 from 8088 Example, and all configuration of the modpagespeed was put in server level.
And add the below to 8089
module modpagespeed {
    enabled                 0
  }

to disable 8089 modpagespeed, you needn't to put param to a not enabled module.
The below are the 8088 and 8089 config.

listener Default {
  address                 *:8088
  secure                  1
  keyFile                 $SERVER_ROOT/admin/conf/webadmin.key
  certFile                $SERVER_ROOT/admin/conf/webadmin.crt
  map                     Example *
}

listener Default2 {
  address                 *:8089
  secure                  1
  keyFile                 $SERVER_ROOT/admin/conf/webadmin.key
  certFile                $SERVER_ROOT/admin/conf/webadmin.crt
  module modpagespeed {
    enabled                 0
  }

  map                     Example *
}


Thanks.
David
--
You received this message because you are subscribed to the Google Groups "OpenLiteSpeed Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlitespeed-deve...@googlegroups.com.
To post to this group, send email to openlitespee...@googlegroups.com.
Visit this group at http://groups.google.com/group/openlitespeed-development.
For more options, visit https://groups.google.com/d/optout.

George Liu

unread,
Apr 13, 2015, 11:11:25 AM4/13/15
to openlitespee...@googlegroups.com
so basically modpagespeed needs to be enabled at server level and then turn it off at listener or vhost level for non-modpagespeed vhosts ?

George Liu

unread,
Apr 13, 2015, 11:18:34 AM4/13/15
to openlitespee...@googlegroups.com
also what is correct pagespeed syntax ? on http://open.litespeedtech.com/mediawiki/index.php/Help:Modules:PageSpeed you list nginx pagespeed like syntax for

pagespeed off

but above you have

enabled 0 ?

David

unread,
Apr 13, 2015, 11:21:14 AM4/13/15
to openlitespee...@googlegroups.com
Not really, either way.
For your case, to use one vhost and make it different in listener level, right? If yes, we should not set enable or disable in vhost level.
You can enable in server level and disable in one listener level; or disable in server level and enable in one listener level.
Just need to understand our modules settings inheriting order is like the following
                =====>  Listener
Server --+
                =====>Vhost ====> Context

Thanks.
David
--

David

unread,
Apr 13, 2015, 11:29:11 AM4/13/15
to openlitespee...@googlegroups.com
OK, I will try to explain these.
All of our modules can be disabled by "enable 0" in different levels, if you set to "Enable Hooks" to no in webAdmin, you will see it in the .conf file.
Pagespeed module has its' own setting to on/off/unplug so that it can be tuned in this way, but even you set "pagespeed off", this module still will be loaded into memory and run all hooks, just it will return in each functions, and in this way, it still using a lot resources.
Let me know if you still have any questions.
Thanks.
David

George Liu

unread,
Apr 13, 2015, 11:29:54 AM4/13/15
to openlitespee...@googlegroups.com
Thanks David so change config to this one https://bitbucket.org/snippets/eva2000/eK8L/revisions/388cfda68dd23d28e9ea37100fe90646d1715a13 so that modpagespeed enabled and settings at server level and only thing i did was disable hook = enable 0 for non-modpagespeed at listener level for port 8098 and 8099. So that port 8109 and 8108 inherit server level modpagespeed.

However, I do not see any modpagespeed in play for 

OpenLiteSpeed 1.4.7 + modpagespeed http 8108 = http://h2ohttp2.centminmod.com:8108/flags.html
OpenLiteSpeed 1.4.7 + modpagespeed HTTP/2 8109 = https://h2ohttp2.centminmod.com:8109/flags.html

HTTP/1.1 200 OK
cache-control: max-age=0, no-cache, public, max-age=900
expires: Mon, 13 Apr 2015 15:36:17 GMT
content-type: text/html; charset=utf-8
date: Mon, 13 Apr 2015 15:21:17 GMT
server: LiteSpeed
cache-control: public, must-revalidate, proxy-revalidate

HTTP/1.1 200 OK
cache-control: max-age=0, no-cache, public, max-age=900
expires: Mon, 13 Apr 2015 15:41:56 GMT
content-type: text/html; charset=utf-8
date: Mon, 13 Apr 2015 15:26:56 GMT
server: LiteSpeed
cache-control: public, must-revalidate, proxy-revalidate

for instance i have pagespeed XHeaderValue "OLS pagespeed" set at server level modpagespeed so question is am i meant to use nginx syntax or apache syntax ?

nginx

pagespeed XHeaderValue "OLS pagespeed"

apache

ModPagespeedXHeaderValue "OLS pagespeed"

basically there's no indication on port 8108 and 8109 that modpagespeed for OpenLiteSpeed is working at all

George Liu

unread,
Apr 13, 2015, 11:52:25 AM4/13/15
to openlitespee...@googlegroups.com
looks like modpagespeed works with 8108 non-https but not with 8109 https with latest config at https://bitbucket.org/snippets/eva2000/eK8L/revisions/719ba140a212f19ae548cd4fa19c631244885e0c

George Liu

unread,
Apr 13, 2015, 11:54:42 AM4/13/15
to openlitespee...@googlegroups.com
also speed modpagespeed mistaken enables on port 8098 non-https too even with web hook for modpagespeed set to no https://bitbucket.org/snippets/eva2000/eK8L/revisions/719ba140a212f19ae548cd4fa19c631244885e0c

David

unread,
Apr 13, 2015, 2:20:56 PM4/13/15
to openlitespee...@googlegroups.com
Your 8108 http site is working with modpagespeed, you can see it combined the css and put the small images to inline-img of the html.
But the https (8109) does not work. This is because you need to set the mapping of the https to a http or or local directory, such as
(in my case)
pagespeed LoadFromFile "http://192.168.0.227:8088" "/home/user/ls147/Example/html/"

in your case, I think you need to add
pagespeed LoadFromFile "http://h2ohttp2.centminmod.com:8109" "/home/nginx/domains/h2ohttp2.centminmod.com/public"
even you have
pagespeed LoadFromFile "https://h2ohttp2.centminmod.com:8109" "/home/nginx/domains/h2ohttp2.centminmod.com/public"
But I think maybe this does not work.

Please have a try and let me know the result.
Thanks.
David

George Liu

unread,
Apr 13, 2015, 6:08:00 PM4/13/15
to openlitespee...@googlegroups.com
hi david if you see i already have loadfromfile mapping at https://bitbucket.org/snippets/eva2000/eK8L/revisions/719ba140a212f19ae548cd4fa19c631244885e0c


pagespeed on
pagespeed FileCachePath /tmp/lshttpd/pagespeed
pagespeed RewriteLevel CoreFilters
pagespeed XHeaderValue "OLS pagespeed"
pagespeed LoadFromFile "http://h2ohttp2.centminmod.com:8108" "/home/nginx/domains/h2ohttp2.centminmod.com/public"
pagespeed LoadFromFile "https://h2ohttp2.centminmod.com:8109" "/home/nginx/domains/h2ohttp2.centminmod.com/public"
RewriteDeadlinePerFlushMs 100
pagespeed MemcachedThreads 1
pagespeed MemcachedServers "localhost:11211"
pagespeed MemcachedTimeoutUs 100000
pagespeed InPlaceResourceOptimization off
pagespeed JpegRecompressionQualityForSmallScreens 60
pagespeed WebpRecompressionQualityForSmallScreens 60
pagespeed PreserveUrlRelativity on
pagespeed MaxCombinedCssBytes -1
pagespeed ImageResolutionLimitBytes 16777216
pagespeed AvoidRenamingIntrospectiveJavascript on
pagespeed ImageInlineMaxBytes 3072
pagespeed CssImageInlineMaxBytes 0
pagespeed MaxInlinedPreviewImagesIndex -1
pagespeed MinImageSizeLowResolutionBytes 3072
pagespeed EnableFilters collapse_whitespace,remove_comments
pagespeed EnableFilters prioritize_critical_css
pagespeed EnableFilters move_css_to_head
pagespeed EnableFilters move_css_above_scripts
pagespeed EnableFilters combine_css
pagespeed EnableFilters combine_javascript
pagespeed MaxCombinedJsBytes 122900
pagespeed EnableFilters rewrite_css
pagespeed EnableFilters rewrite_javascript
pagespeed EnableFilters inline_preview_images
pagespeed EnableFilters lazyload_images
pagespeed EnableFilters rewrite_images
pagespeed DisableFilters recompress_images
pagespeed DisableFilters extend_cache_images
pagespeed EnableFilters convert_png_to_jpeg
pagespeed EnableFilters convert_jpeg_to_webp
pagespeed EnableFilters convert_to_webp_lossless

George Liu

unread,
Apr 13, 2015, 6:13:12 PM4/13/15
to openlitespee...@googlegroups.com
seems that worked latest config https://bitbucket.org/snippets/eva2000/eK8L/revisions/dcc705600dbadb5a8e5e33c812520ccc3744366b however it also enables modpagespeed on unintended 8098 version too


On Tuesday, April 14, 2015 at 4:20:56 AM UTC+10, David wrote:

David

unread,
Apr 14, 2015, 9:46:02 AM4/14/15
to openlitespee...@googlegroups.com
Hi George,

I think in your case, maybe we use this way should be much better and clear.
You sets up two Vhosts,  for now, you just make a copy of the Example, and name it to ExampleNoPS, in this new one, you add
module modpagespeed {
    enabled                 0
  }

And then in you http and Https listeners' setting, you remove the "module modpagespeed  ....", so that, listener only concerns SSL or not, and Vhost takes care of modpagespeed or not.

In my testing case, I updated to this
virtualhost Example {
  vhRoot                  $SERVER_ROOT/Example/
  configFile              $SERVER_ROOT/conf/vhosts/Example/vhconf.conf
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              0
 
  module modpagespeed {
    enabled                 1
  }
}


virtualhost ExampleNoPS {
  vhRoot                  $SERVER_ROOT/Example/
  configFile              $SERVER_ROOT/conf/vhosts/Example/vhconf.conf
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              0
 
  module modpagespeed {
    enabled                 0

  }
}

listener Default {
  address                 *:8088
  secure                  1
  keyFile                 $SERVER_ROOT/admin/conf/webadmin.key
  certFile                $SERVER_ROOT/admin/conf/webadmin.crt
  map                     Example *
}

listener Default2 {
  address                 *:8089
  secure                  1
  keyFile                 $SERVER_ROOT/admin/conf/webadmin.key
  certFile                $SERVER_ROOT/admin/conf/webadmin.crt
  map                     ExampleNoPS *
}

Thanks.
David

David

unread,
Apr 14, 2015, 3:41:12 PM4/14/15
to openlitespee...@googlegroups.com
Hi George,

As my previous email mentioned that the firefox may have problem to access the http2+pagespeed page, and based on my debugging, I found pagespeed module would crash the server when get a FATAL ERROR if it is built in DEBUG mode . Unfortunately the Makefile in src/module/pagespeed/ will create the modpagespeed.so in DEBUG mode.
So just now, I push a change to github and re-tag the v1.4.7 and v1.3.10, when you get a chance, you maybe want to re-dowbload the right version and re-compile openlitepseed and modpagespeed.so.
Also the performance should be better then.

Thanks.
David

George Liu

unread,
Apr 14, 2015, 4:18:14 PM4/14/15
to openlitespee...@googlegroups.com
fyi, seems ./dlpsol.sh is broken it doesn't download anything anymore when run ? just goes back to prompt

also using 2 vhosts with same settings seems to have broken the sites as i get

Request Page Not Found

This is a customized error page for missing pages.

also manually adding the 2nd vhost seems to have broken the ability to add modpagespeed via adminconsole so had to add them directory into httpd_config.conf

  vhRoot                  /home/nginx/domains/$VH_NAME/
  configFile              $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
  note                    Instantiated from template PHP_SuEXEC
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              2

  module modpagespeed {
    enabled                 1
  }
}

virtualhost h2ohttp2.centminmod.com_nops {
  vhRoot                  /home/nginx/domains/$VH_NAME/
  configFile              $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
  note                    Instantiated from template PHP_SuEXEC
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              2

  module modpagespeed {
    enabled                 0
  }
}

George Liu

unread,
Apr 14, 2015, 4:22:34 PM4/14/15
to openlitespee...@googlegroups.com
Request Page Not Found
This is a customized error page for missing pages.

George Liu

unread,
Apr 14, 2015, 4:41:15 PM4/14/15
to openlitespee...@googlegroups.com
okay seems like i finally got it needed duplicate vhost.conf too https://bitbucket.org/snippets/eva2000/eK8L/revisions/ad5ff4417e862b542888d2ce4b4688aa6ed3e20a

is there no way to do his without duplicate vhost.conf/directories and duplicate web roots ?

/usr/local/lsws/conf/vhosts/h2ohttp2.centminmod.com/vhconf.conf   
/usr/local/lsws/conf/vhosts/h2ohttp2.centminmod.com-nops/vhconf.conf   

Document Root $VH_ROOT/public/

George Liu

unread,
Apr 14, 2015, 4:47:58 PM4/14/15
to openlitespee...@googlegroups.com
okay working configs now https://bitbucket.org/snippets/eva2000/eK8L/revisions/50e0a0c642937b19951df7dbf6c71870caa8f136 :)

changed vhRoot on 2nd copy so can use same public web root while still having seprate vhconf.conf

ideally there should be an easier to way to do this if folks want to replicate such a setup ! ;)

  vhRoot                  /home/nginx/domains/$VH_NAME/
  configFile              $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
  note                    Instantiated from template PHP_SuEXEC
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              2
}

virtualhost h2ohttp2.centminmod.com-nops {
  vhRoot                  /home/nginx/domains/h2ohttp2.centminmod.com/
  configFile              $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
  note                    Instantiated from template PHP_SuEXEC
  allowSymbolLink         1
  enableScript            1
  restrained              1
  setUIDMode              2

David

unread,
Apr 14, 2015, 4:50:58 PM4/14/15
to openlitespee...@googlegroups.com
Actually you don't have to do that.
In my case (The below blue font parts), I just copy the text in the .conf file and did not make a copy of the directory at all.
You can see the configFile  is the same.

Thanks.
David
Reply all
Reply to author
Forward
0 new messages