2

I installed nginx on a server of mine using apt-get. I now need to add some features to it, such as the pagespeed module, and have read the only way to do this is by compiling the module into the nginx source directly. Does this mean I must uninstall nginx and re-install from the source? What other differences are there between using apt-get and the source?

1
  • 2
    Installing from source makes you responsible for updates, which is probably the most significant concern. The main distros are a lot better at patching security holes quickly than individuals. Commented Jun 4, 2015 at 17:16

3 Answers 3

2

A sad, yet unequivocal yes to your question of having to build from source.

As Google states in the main doc page of pagespeed:

"If you're using Nginx you need to build from source. These packages are Apache-only."

This is very unfortunate because for a lot of modules, nginx can be installed using apt with the desired options added to the method.

I'm afraid this is a case in which you'll have to choose whether you want the convenience (and some may say the reassurance for security purposes) of installing nginx using apt or the performance boost which pagespeed may give your site.

0

Compiling modules into applications like nginx can help with performance under high load, however, if you compile from source, you can no longer upgrade using apt. You will have to manage security updates on your own.

If you are unsure - may as well just use apt if you can. It is easier to manage in the long run.

There are versions of Linux that can manage source installations, but it can be complicated for some people.

EDIT: If the only way to get pagespeed to work is to compile it, then you don't have a choice.... But I would try and see if an apt port is available somewhere. Yes. it would be a good idea to uninstall nginx before compiling the source. You can install to different directories, but your port 80s will conflict.

0

Indeed, nginx does not have runtime modules. However in ubuntu you have several versions of nginx, with modules compiled into for you by the ubuntu maintainers

  • nginx-light has the minimal feature set
  • nginx-extras contains some extra modules
  • nginx-full contains complete collections of the most common and supported modules

You can check out which modules are included here: https://wiki.debian.org/Nginx

If your module is not listed there, you need to build nginx yourself.

However if you use deb-src packages from the maintainers, it is going to be almost trivial task.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.