Use the available Release binaries? [Y/n] y
./configure: 158: /usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-stable/config: [[: not found
./configure: 158: /usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-stable/config: y: not found
mod_pagespeed_dir=/usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-stable/psol/include
build_from_source=false
....
/usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-stable/src/ngx_pagespeed.cc
/usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-stable/src/ngx_pagespeed.cc: In function ‘ngx_int_t net_instaweb::{anonymous}: pss_preaccess_handler(ngx_http_request_t*)’:
/usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-stable/src/ngx_pagespeed.cc:3011:31: error: ‘ngx_http_core_try_files_phase’ was not declared in this scope
while (ph[i + 1].checker != ngx_http_core_try_files_phase &&
^
objs/Makefile:2029: recipe for target 'objs/addon/src/ngx_pagespeed.o' failed
make[1]: *** [objs/addon/src/ngx_pagespeed.o] Error 1
make[1]: Leaving directory '/root/addons/nginx/nginx-1.13.4'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
nginx -V
No, it is not "normal". After a successfull compilation, finished with "make install", the compiled nginx should have been replaced with your "old" one and you can certainly see the compiling options with the "nginx -V" command.Is it normal that the other 4 modules ngx_cache_purge-2.3, ngx_coolkit-0.2, and more are also not visible by command?Code:nginx -V
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --user=nginx --group=nginx --with-debug --with-file-aio --with-google_perftools_module --with-ipv6 --with-mail --with-mail_ssl_module --with-threads --with-select_module --with-stream --with-stream_ssl_module --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_stub_status_module --with-http_sub_module --with-http_ssl_module --with-openssl=/usr/src/openssl-1.0.2l --with-http_v2_module --with-http_xslt_module --with-poll_module --add-module=/usr/share/passenger/ngx_http_passenger_module --add-module=/usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-stable --add-module=/usr/share/nginx/modules/ngx_brotli --add-module=/usr/share/nginx/modules/ngx_cache_purge-2.3 --add-module=/usr/share/nginx/modules/ngx_slowfs_cache-1.10 --add-module=/usr/share/nginx/modules/ngx_coolkit-0.2 --add-module=/usr/share/nginx/modules/ngx_headers-more-0.32
root@server:~/addons/nginx/nginx-1.13.2# nginx -V
nginx version: nginx/1.13.2
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
built with OpenSSL 1.0.2l 25 May 2017
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --user=nginx --group=nginx --with-debug --with-file-aio --with-google_perftools_module --with-ipv6 --with-mail --with-mail_ssl_module --with-threads --with-select_module --with-stream --with-stream_ssl_module --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_stub_status_module --with-http_sub_module --with-http_ssl_module --with-openssl=/usr/src/openssl-1.0.2l --with-http_v2_module --with-http_xslt_module --with-poll_module --add-module=/usr/share/passenger/ngx_http_passenger_module --add-module=/usr/share/nginx/modules/ngx_pagespeed-1.12.34.2-stable --add-module=/usr/share/nginx/modules/ngx_brotli --add-module=/usr/share/nginx/modules/ngx_cache_purge-2.3 --add-module=/usr/share/nginx/modules/ngx_slowfs_cache-1.10 --add-module=/usr/share/nginx/modules/ngx_coolkit-0.2 --add-module=/usr/share/nginx/modules/ngx_headers-more-0.32
In Apache PageSpeed is enabled automatically when you install the module while in Nginx you need to add several lines to your nginx.conf. In every server block where PageSpeed is enabled add:
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
#user nginx;
worker_processes 1;
#error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
#pid /var/run/nginx.pid;
include /etc/nginx/modules.conf.d/*.conf;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#tcp_nodelay on;
#gzip on;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
server_tokens off;
include /etc/nginx/conf.d/*.conf;
# BEGIN Google brotli - definitions, tuned by UFHH01
brotli on;
brotli_static on;
brotli_types text/html text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/vnd.microsoft.icon image/bmp image/svg+xml;
brotli_comp_level 8;
# END Google brotli - definitions, tuned by UFHH01
# BEGIN gzip - Definitions, tuned by UFHH01
gzip_static on;
gzip on;
gzip_proxied any;
gzip_http_version 1.1;
gzip_min_length 100;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types audio/wav audio/ogg font/opentype text/css text/javascript text/plain text/richtext text/x-component text/x-js text/xml text/xsd text/xsl font/opentypeapplication/font-woff application/atom+xml application/font-woff2 application/javascript application/java application/json application/msword application/pdf application/xhtml+xml application/xml application/xml+rss image/bmp image/tiff image/svg+xml image/webp image/x-icon application/vnd.ms-access application/vnd.ms-excel application/vnd.ms-fontobject application/vnd.ms-opentype application/vnd.ms-powerpoint application/vnd.ms-project application/vnd.ms-write application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text application/x-font-ttf application/x-font-opentype application/x-font-otf application/x-javascript application/x-msdownload application/x-shockwave-flash application/x-web-app-manifest+json;
# Disable gzip for certain browsers.
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# END gzip - Definitions, tuned by UFHH01
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
}
# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;
# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
pagespeed on;
pagespeed FileCachePath /YOUR-LOCATION/TO/THE/FOLDER/ngx_pagespeed_cache;
pagespeed EnableFilters combine_css,combine_javascript;
chown nginx:nginx /var/ngx_pagespeed_cache;
Code:http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #tcp_nodelay on; #gzip on; #gzip_disable "MSIE [1-6]\.(?!.*SV1)"; server_tokens off; include /etc/nginx/conf.d/*.conf; # BEGIN Google brotli - definitions, tuned by UFHH01 brotli on; brotli_static on; brotli_types text/html text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/vnd.microsoft.icon image/bmp image/svg+xml; brotli_comp_level 8; # END Google brotli - definitions, tuned by UFHH01 # BEGIN gzip - Definitions, tuned by UFHH01 gzip_static on; gzip on; gzip_proxied any; gzip_http_version 1.1; gzip_min_length 100; gzip_vary on; gzip_comp_level 6; gzip_buffers 16 8k; gzip_types audio/wav audio/ogg font/opentype text/css text/javascript text/plain text/richtext text/x-component text/x-js text/xml text/xsd text/xsl font/opentypeapplication/font-woff application/atom+xml application/font-woff2 application/javascript application/java application/json application/msword application/pdf application/xhtml+xml application/xml application/xml+rss image/bmp image/tiff image/svg+xml image/webp image/x-icon application/vnd.ms-access application/vnd.ms-excel application/vnd.ms-fontobject application/vnd.ms-opentype application/vnd.ms-powerpoint application/vnd.ms-project application/vnd.ms-write application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text application/x-font-ttf application/x-font-opentype application/x-font-otf application/x-javascript application/x-msdownload application/x-shockwave-flash application/x-web-app-manifest+json; # Disable gzip for certain browsers. gzip_disable "MSIE [1-6]\.(?!.*SV1)"; # END gzip - Definitions, tuned by UFHH01 pagespeed on; # Needs to exist and be writable by nginx. Use tmpfs for best performance. pagespeed FileCachePath /var/ngx_pagespeed_cache; } # override global parameters e.g. worker_rlimit_nofile include /etc/nginx/*global_params;
The rest of code in vhost template under additional nginx directives? I haven't done this step, I wanted to wait what do you recommend?
Am I right or totally wrong?Code:# Ensure requests for pagespeed optimized resources go to the pagespeed handler # and no extraneous headers get set. location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; } location ~ "^/pagespeed_static/" { } location ~ "^/ngx_pagespeed_beacon$" { }
Can you please help me these steps.
Perhaps also with the vary and cache control headers.
It seems to configure only a few, but important things.
For the tmpfs recommendation I found an interesting solution by @IgorG written his year. Usually I do not change my filesystem, except one thing by installing whole OS with Plesk I expand /var/ by 750 GB. This is necessary on 1and1 servers by default-images.
Perhaps I can do this tmpfs on RAM later, after a period of time, hope it is not strictly necessary.
All the other interesting things like statistics and pagespeed console are a nice present.
But I only want to run pagespeed in basic configuration and see how and if it works.
Thanks and lots of greets
cd /usr/share/nginx/modules/
git clone https://github.com/google/ngx_brotli.git
cd ngx_brotli
git submodule update --init --recursive
--add-module=/usr/share/nginx/modules/ngx_brotli
Sorry, this is a wrong / false statement.Then to be able to use brotli, you have to remove all gzip settings. If Gzip is enabled, brotli will not work.
UFHH01 Thank youI updated my contribution today and added as well "Google brotli" now.
Enjoy the new speed!
I would have a question to this part. Since I installed 1.1.0f-2~ubuntu16.04.1+deb.sury.org+1 last night, I would like to use this version. How can I do this?Here is a NEW part ( implemented "OpenSSL 1.1.1-dev" support, so that TLSv1.3 ciphers can be used
there is no "upgrade"/"update", if you compiled your onw NGINX - version.or is there a way to upgrade nginx ?
ssl_ecdh_curve X25519:P-521:P-384:P-256;