HOWTO Install ngx_pagespeed (Google PageSpeed) Topic is solved

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
delebash
Posts: 22
Joined: Mon Aug 24, 2015 5:28 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby delebash » Tue Dec 06, 2016 4:32 am

I also had a problem with nginx not starting after build
I am on ubuntu 16.04 so I am not sure if the commands are different

Test nginx after build

Code: Select all

sudo nginx -t


I get this error
NOTE: If you get error nginx: [emerg] mkdir() "/var/cache/nginx/client_temp" failed (2: No such file or directory)

Fix by creating temp directories

Code: Select all

sudo mkdir /var/cache/nginx
sudo touch /var/cache/nginx/client_temp


Re-run nginx test

Code: Select all

 sudo nginx -t


Start nginx if no more errors

Aidan101
Posts: 1
Joined: Mon Jan 16, 2017 3:48 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby Aidan101 » Mon Jan 16, 2017 3:58 pm

BeKindRewind wrote:Hi. Getting ready to paris car service try this, but confused on your last line. How do you "rebuild web command" in the Vesta Control Panel? Did you mean restart web?

Hello,
Yes it is surely retart web!
If not then how?

arnada21
Posts: 7
Joined: Thu Jan 08, 2015 10:42 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby arnada21 » Fri Feb 03, 2017 11:53 am

Thank you for a great tutorial, just installed it on the latest version of VestaCP with the latest version of PageSpeed on Ubuntu 14.04.

Some notes from my installation

1. When you copying the output of nginx -V make sure the format is good, I had to spend a couple of hours to find that -fPIC was merged together with -D_FORTIFY_SOURCE=2-fPIC. This cost me a couple of hours =)

2. If you want to use the latest version of PageSpeed, go to:
https://github.com/pagespeed/ngx_pagespeed/releases and copy the .zip link

3. The link structure of the psol link is also new, if you want to run the lateset version of PageSpeed the link is altered with -x64, example: https://dl.google.com/dl/page-speed/pso ... x64.tar.gz

4. After Make install command, run nginx -t to verify that the installation was successful

5. When you got everything working, reboot your server and make sure everything is still working =)

soldx
Posts: 7
Joined: Tue Apr 11, 2017 9:55 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby soldx » Sun May 21, 2017 11:17 pm

Hello,
I followed the steps and the ngx_pagespeed was successfully installed.

But when I run

Code: Select all

nginx -t && nginx -s reload

I am getting some errors with unknown directives.
Example:

Code: Select all

nginx: [emerg] unknown directive "gzip" in /etc/nginx/nginx.conf:59
nginx: configuration file /etc/nginx/nginx.conf test failed


This is the output from my nginx -vV

Code: Select all

nginx version: nginx/1.10.3                                                                                             
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)                                                                     
built with OpenSSL 1.0.1e-fips 11 Feb 2013                                                                               
TLS SNI support enabled                                                                                                 
configure arguments: --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 --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --add-module=/root/ngx_pagespeed-release-1.9.32.10-beta               


I am guessing if maybe there is an error during the process, or maybe some directives are duplicated in any other places.

I appreciate any help.

Kind regards.

noogen
Posts: 41
Joined: Thu Jan 05, 2017 9:20 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby noogen » Fri Jun 09, 2017 3:05 am

@soldx see issue here: https://github.com/pagespeed/ngx_pagespeed/issues/1180

There was a bug in 1.9.x so the last message on that thread and I quote, "ngx_pagespeed 1.9.x is no longer supported, and has unpatched security vulnerabilities. Please use the latest version (1.11)."

mariad
Posts: 28
Joined: Fri Feb 17, 2017 5:34 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby mariad » Fri Jun 16, 2017 11:54 am

What is the authentic tool to check the pagespeed? The one mentioned from github or some others as well.

juslintek
Posts: 9
Joined: Mon Jun 20, 2016 5:55 pm

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby juslintek » Sat Sep 23, 2017 10:14 pm

Found this alternative:
https://medium.com/@karljohnson/nginx-m ... 28a44d1854

remove nginx then install nginx-more and copy over http://c.vestacp.com/0.9.8/rhel/7/nginx/nginx.conf (change url of config to your distro specific). And finally tweak to your liking.

P.S. nginx-more provides prebuilt nginx.conf and conf.d with example configs of ngx_pagespeed and other. They do no overwrite anything just rename old and place new instead. So you can place back old configs.

pramathesh
Posts: 9
Joined: Mon May 01, 2017 8:38 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby pramathesh » Thu Oct 26, 2017 5:02 am

I'm getting this error

make: *** No rule to make target 'install'. Stop.

Any resolutions for this?

mehargags
Moderators
Posts: 788
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby mehargags » Thu Oct 26, 2017 7:09 am

pramathesh wrote:I'm getting this error
make: *** No rule to make target 'install'. Stop.
Any resolutions for this?


Give us some more info, What OS & version are you on ?
Do you have build-essentials pkg installed ? are you running make as sudo ? does ./configure give you some dependency errors ?

StopSpazzing
Posts: 7
Joined: Sun Nov 12, 2017 6:18 am

Re: HOWTO Install ngx_pagespeed (Google PageSpeed)

Postby StopSpazzing » Mon Nov 13, 2017 2:50 am

I found it much easier to do it the Google Pagespeed suggested way:

Code: Select all

bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
     --nginx-version latest -a "--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/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-compat --with-file-aio --with-threads --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_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'" -d


This code above is a -d(ry) run code; anyone could run it shows you what it WOULD do.

Get your config info and add it to:

Code: Select all

bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
     --nginx-version latest -a "add config here"
you can always add a -d to do a dry run so you can see what will happen. I rather have latest nginx and pagespeed personally, so this worked out find for me. More info here: https://www.modpagespeed.com/doc/build_ ... rom_source

Let it do all the heavy lifting.


Return to “Web Server”



Who is online

Users browsing this forum: No registered users and 9 guests

cron