Standing up a development server - We-Amp/mod_pagespeed GitHub Wiki
One of the most useful tools for debugging PageSpeed is just to start a server, manually send queries to it, and see what happens.
Starting the server
Apache
cd mod_pagespeed/devel/
make apache_install_conf && make apache_debug_restart
Nginx
cd ngx_pagespeed/
scripts/rebuild.sh
RUN_TESTS=false test/run_tests.sh
Sending queries
Our testing configurations have a "primary server" that doesn't care about host headers, and a "secondary server" that gets you different virtual hosts for different supplied host headers.
Primary server
Apache
curl localhost:8080/mod_pagespeed_example/
Nginx
curl localhost:8050/mod_pagespeed_example/
Secondary server
To see a list of secondary servers, look for the blocks in ngx_pagespeed/test/pagespeed_test.conf.template or mod_pagespeed/install/debug.conf.template that have @@SECONDARY_PORT@@.
Apache
http_proxy=localhost:8083 curl pagespeed-on.example.com/mod_pagespeed_example/
Nginx
http_proxy=localhost:8051 curl pagespeed-on.example.com/mod_pagespeed_example/
Logs
Looking at server logs can be useful in understanding why the server did what it did.
- Apache uses
~/apache2/logs/error_log, shared between all mod_pagespeed checkouts on the same machine - Nginx uses
ngx_pagespeed/test/tmp/error.log, which is just for that ngx_pagespeed checkout