HOWTO Install ngx_pagespeed (Google PageSpeed) Topic is solved

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
web-seo-consulting
Posts: 35
Joined: Sat Jun 25, 2016 6:56 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby web-seo-consulting » Tue Jul 05, 2016 5:49 pm

That's what I've done but no improvement.

Will try it again today evening.

web-seo-consulting
Posts: 35
Joined: Sat Jun 25, 2016 6:56 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby web-seo-consulting » Fri Jul 08, 2016 10:13 pm

So I have now tried it again and had the same mistake again.

As delebash I have the option debian / extra / nj-1c50334fbea6 / nginx / config let out now.

Everything went as far as I could see right through and also the make and make install went well.

I then adjusted the default.tpl and default.stpl and run a rebuield with v-rebuild-web-domains user

How can I really find the page speed rotate. Under / var I've created a folder where the modules will store its data.

I could not see an improvement

SS88
Posts: 298
Joined: Thu Nov 19, 2015 12:40 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby SS88 » Sat Jul 09, 2016 6:31 am

web-seo-consulting wrote:So I have now tried it again and had the same mistake again.

As delebash I have the option debian / extra / nj-1c50334fbea6 / nginx / config let out now.

Everything went as far as I could see right through and also the make and make install went well.

I then adjusted the default.tpl and default.stpl and run a rebuield with v-rebuild-web-domains user

How can I really find the page speed rotate. Under / var I've created a folder where the modules will store its data.

I could not see an improvement


The actual source code of the website will have changed.

You can check and see if the pagespeed module is installed by issuing this command:

Code: Select all

nginx -V


The output will show the ngx_pagespeed module. If you don't see it - nginx has not been complied with pagespeed support. If it's in there then make sure the configuration for pagespeed is in nginx config.

Code: Select all

pagespeed On;
pagespeed RewriteLevel CoreFilters;

# HTTPS Support
pagespeed FetchHttps enable,allow_self_signed;

pagespeed EnableFilters lazyload_images,collapse_whitespace,insert_dns_prefetch,dedup_inlined_images,defer_javascript,pedantic,trim_urls,sprite_images,extend_cache_pdfs,remove_comments,resize_mobile_images,inline_preview_images,insert_image_dimensions,convert_to_webp_lossless,local_storage_cache,inline_google_font_css,prioritize_critical_css,rewrite_style_attributes,move_css_to_head,move_css_above_scripts,outline_javascript,outline_css,combine_heads;

pagespeed FileCachePath /var/ngx_pagespeed_cache;

location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }

web-seo-consulting
Posts: 35
Joined: Sat Jun 25, 2016 6:56 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby web-seo-consulting » Sat Jul 09, 2016 1:11 pm

ok thanks for the hint. My output now looks like this:

Code: Select all

nginx -V
nginx version: nginx/1.10.1
built by gcc 4.9.2 (Debian 4.9.2-10)
built with OpenSSL 1.0.1t  3 May 2016
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/prsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realdav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-httpst_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --with-thrth-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_v2_module --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-secur --add-module=/root/nginx-pagespeed/ngx_pagespeed-1.11.33.2-beta


So he now seems to load the module.

I'm trying to find the best filter, etc. What can you recommend that. My TPL now looks like

Code: Select all

   # Pagespeedanweisungen
   pagespeed on;
   pagespeed FileCachePath /var/ngx_pagespeed_cache/%domain_idn%;
   pagespeed RewriteLevel PassThrough;
   pagespeed EnableFilters collapse_whitespace;
   pagespeed EnableFilters combine_css;
   pagespeed EnableFilters combine_javascript;
   pagespeed EnableFilters combine_heads;
   pagespeed EnableFilters convert_jpeg_to_progressive;
   pagespeed EnableFilters convert_png_to_jpeg;
   pagespeed EnableFilters convert_meta_tags;
   pagespeed EnableFilters dedup_inlined_images;
   pagespeed EnableFilters extend_cache;
   pagespeed EnableFilters extend_cache_pdfs;
   pagespeed EnableFilters fallback_rewrite_css_urls;
   pagespeed EnableFilters inline_import_to_link;
   pagespeed EnableFilters local_storage_cache;
   pagespeed EnableFilters outline_css;
   pagespeed EnableFilters outline_javascript;
   pagespeed EnableFilters recompress_images;
    pagespeed EnableFilters recompress_jpeg;
   pagespeed EnableFilters remove_comments;
   pagespeed EnableFilters remove_quotes;
   pagespeed EnableFilters rewrite_css;
   pagespeed EnableFilters rewrite_images;
   pagespeed EnableFilters rewrite_javascript;
   pagespeed EnableFilters rewrite_javascript_inline;
   pagespeed EnableFilters rewrite_javascript_external;
   pagespeed EnableFilters rewrite_style_attributes;
   pagespeed EnableFilters rewrite_style_attributes_with_url;
   pagespeed EnableFilters trim_urls;
        pagespeed UseExperimentalJsMinifier on;
        pagespeed JpegRecompressionQuality 85;
        pagespeed ImageRecompressionQuality 85;
   pagespeed Domain https://fonts.googleapis.com;


Makes sense to combine that with Page Speed or would that twice we therefore too much there?
For this you need but the gzip module which is indeed activated by default at Vesta?

Code: Select all

   # Gzipkonfiguration
   gzip on;
   gzip_comp_level 6;
   gzip_min_length 500;
   gzip_buffers 16 8k;
   gzip_proxied any;
   gzip_types  text/plain text/css image/png image/gif image/jpeg application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
   gzip_vary off;


Thanks for help and think it will also help some others.

PS: Was that debian/extra/nj-1c50334fbea6/nginx/ not so important or why you could let it out so?

indteam
Posts: 13
Joined: Fri Jul 01, 2016 8:21 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby indteam » Mon Jul 18, 2016 10:30 am

Hi

what file name add this code ?

Code: Select all

listen      %ip%:%proxy_ssl_port% spdy;


Code: Select all

--with-http_v2_module
same or not with

Code: Select all

--with-http_spdy_module


nginx version: nginx/1.10.1

SS88
Posts: 298
Joined: Thu Nov 19, 2015 12:40 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby SS88 » Mon Jul 18, 2016 10:36 am

indteam wrote:Hi

what file name add this code ?

Code: Select all

listen      %ip%:%proxy_ssl_port% spdy;


Code: Select all

--with-http_v2_module
same or not with

Code: Select all

--with-http_spdy_module


nginx version: nginx/1.10.1



spdy should be added to:

Code: Select all

/usr/local/vesta/data/templates/web/nginx/default.stpl
/usr/local/vesta/data/templates/web/nginx/hosting.stpl
/usr/local/vesta/data/templates/web/nginx/caching.stpl


But if you have http_v2_module then it's this code:

Code: Select all

listen      %ip%:%proxy_ssl_port% ssl http2;

huloza
Posts: 22
Joined: Thu Jul 28, 2016 5:15 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby huloza » Thu Jul 28, 2016 8:26 am

delebash wrote:Sytem Info
Clean ubuntu 14.04 Digital Ocean droplet
Vesta nginx only option for install

Ran script to compile nginx from source with openssl for alpn support and pagespeed mod

I am getting an error on ./configure with the nginx flags

Code: Select all

configuring additional dynamic modules
adding module in debian/extra/njs-1c50334fbea6/nginx
./configure: error: no debian/extra/njs-1c50334fbea6/nginx/config was found
make: *** No rule to make target `build', needed by `default'.  Stop.
sudo: unable to resolve host vestacp
make: *** No rule to make target `install'.  Stop.


...

I am not sure what this is debian/extra/njs-1c50334fbea6/nginx/config


web-seo-consulting wrote:I once tried to install page speed today
but I get this error

configuring additional modules
adding module in /root/ngx_pagespeed-1.11.33.2-beta
mod_pagespeed_dir=/root/ngx_pagespeed-1.11.33.2-beta/psol/include
build_from_source=false
checking for psol ... found
List of modules (in reverse order of applicability): ngx_http_write_filter_module ngx_http_header_filter_module ngx_http_chunked_filter_module ngx_http_v2_fi ngx_http_gzip_filter_module ngx_pagespeed ngx_http_postpone_filter_module ngx_http_ssi_filter_module ngx_http_charset_filter_module ngx_http_sub_filter_modu_userid_filter_module ngx_http_headers_filter_module
checking for psol-compiler-compat ... found
+ ngx_pagespeed was configured
configuring additional dynamic modules
adding module in debian/extra/njs-1c50334fbea6/nginx
./configure: error: no debian/extra/njs-1c50334fbea6/nginx/config was found


Who can help me. Find anything suitable that could help me just


I was having the same problem, after research:

njs is nginScript, you need to download the same file from the website: http://hg.nginx.org/njs/archive/1c50334fbea6.zip and put in the --add-dynamic-module= parameter.

Took me two days to realize this.

hope it helps to others.

Regards!

huloza
Posts: 22
Joined: Thu Jul 28, 2016 5:15 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby huloza » Thu Jul 28, 2016 8:40 am

The other dependences are:

Code: Select all

yum install libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel

Regards!

jim4499
Posts: 1
Joined: Fri Aug 05, 2016 2:34 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby jim4499 » Fri Aug 05, 2016 3:07 am

Many thanks to huloza for this link: http://hg.nginx.org/njs/archive/1c50334fbea6.zip.

I was stuck on the same error while adding ngx_txid to nginx: https://makandracards.com/konjoot/38441-ubuntu-nginx-with-txid-module.

However, my configure fix differed:
1) used neither --add-dynamic-module nor --add-module
2) placed the contents of the zip file in the same subdirectory as in the error message

However, make eventually failed because ngx_txid is expecting a 64bit world. It'll be easier to upgrade my server than my C skills.

###

xorro
Posts: 11
Joined: Sun Nov 13, 2016 3:11 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby xorro » Sat Nov 19, 2016 4:59 am

i have been trying to install ngx_pagespeed with vestacp since last 2 days tried every method available but in the end my nginx stop working every time i don't know what i have done wrong but i have tried multiple time to install it.

Is there anyone who can install this for me please?

Edit:- i am using CentOS 7.2

Modules/Configuration loading with nginx

Code: Select all

--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-file-aio --with-threads --with-ipv6 --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic'


Return to “Web Server”



Who is online

Users browsing this forum: No registered users and 9 guests