-2

I have to compile nginx in order to get pagespeed module. But it appears that nginx is installed on /usr/local/nginx which I can't just use service nginx restart or try nginx -V

Is there a way to make so that it is easier to start / stop the service and be able to check the version of nginx? I've read this doc and I can do without it, or just edit my bashsrc to make things simpler. However, the most important part is to be able to verify that the compiled version of nginx I have has pagespeed included.

1
  • What is your Linux distribution? Please edit the question to add this info.
    – kubanczyk
    Mar 18, 2016 at 14:33

2 Answers 2

0

You have to specify the deploy location when you build nginx. Have a look at my tutorial that includes building nginx from source. The most important part is

./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 --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-http_ssl_module --with-http_realip_module --with-http_gunzip_module --with-http_gzip_static_module --with-threads --with-file-aio --with-ipv6 --with-http_v2_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=native' --add-module=../ngx_cache_purge-2.3 --add-module=../headers-more-nginx-module-0.29 --with-http_realip_module --add-module=../ngx_pagespeed-release-1.9.32.10-beta
1
  • Packages installed from source belong in /usr/local to avoid conflicts with packages installed by a package manager, and to aid in tracking down all the files in case you need to uninstall what was installed from source.
    – kasperd
    Mar 17, 2016 at 17:27
0

You certainly can still run nginx -V its not in your $PATH and you would need to specify the full path.

The init or startup script is also up to you when building from source. For example, a systemd service on Linux. I suggest looking at any nginx package from your operating system as an example.

I suggest you stick to pre built packages until you determine how to do it yourself.

Not the answer you're looking for? Browse other questions tagged .