Question

Google Pagespeed on existent Nginx

I’m not an experienced Linux user, and I was trying to get google pagespeed working with an existent nginx sever.

I know I must recompile nginx with the module, but I couldn’t get it working, all I had at the moment is a production server, so after some hours trying I’ve had to give up and get the server live again with a simple nginx install.

I had this page as a guide.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

When you install it via the instructions on the Google site, all the files end up in /usr/local/nginx/ So, the nginx command is /usr/local/nginx/sbin/nginx and the configuration files are in /usr/local/nginx/conf/

If you want to install it to the location that the packaged version is normally installed to, you can add a number of extra arguments to ./configure

--prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf \ 
--sbin-path=/usr/sbin --error-log-path=/var/log/nginx/error.log

Though, I suggest you take a look at the post Alexandre linked to. Especially if you’re doing this on your live production server, it probably makes sense to build Debian packages that will cleanly replace the ones you have installed.

Hi astarr,

I could recompile w/o errors, but it didnt replace the running nginx, I’ve tried uninstall the nginx and recompile/install, but it didn’t install, I wasn’t able to start/stop etc.

Do I need add args on this line?

./configure --add-module=$HOME/ngx_pagespeed-release-${NPS_VERSION}-beta

I got the args from the running one and add to it.

Thanks for the reply, ;)

Hey Erick!

If you could share the actual problems that you’re running into, we’d probably be better able to help. Were there errors when you were trying to compile it? Are you have problems with configuration? Let us know!