6

I originally installed nginx via apt-get install. It works just fine. Now, I want to install some 3rd party modules and I have to recompile nginx. So I tried to recompile. It went through the motions and then I realized that my original version was still the one that was being used.

Do I need to uninstall my original copy of nginx first in order for the other to install properly?

my flags for the install: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --with-ipv6 --add-module=/usr/src/gnosek-nginx-upstream-fair-5f6a3b7 --add-module=/usr/src/mod_strip

1 Answer 1

1

You shouldn't need to uninstall the apt-get version first, but it's a good idea so that you don't inadvertantly walk over your custom recompile with an 'apt-get update' or similar system update in the future.

There are a few reasons your recompile may not have worked. Does the installer have the correct permissions to overwrite the existing file? Is .configure placing the compiled binary in the same place as apt-get? (--sbin-path=/where-you-want-it-installed on .configure, if not /sbin/nginx) Was nginx running when you recompiled? The installer may not be able to overwrite an open file. (You have restarted nginx, right?) Maybe something else, but that's where I'd start looking.

Sign up to request clarification or add additional context in comments.

4 Comments

i definitely was running nginx at the time. i have since restarted it several times. I'm actually not sure what the sbin-path was for apt-get, how can i check that? How can i grant permissions to the installer?
You can use 'whereis nginx' to find where the current binary is living (but likely /sbin/nginx unless something has changed). Permissions for the installer depends on which user was running the build and who owns the installed binary. If both are the same, it shouldn't matter. In most cases using sudo should be enough.
ah, it is indeed located in /usr/sbin/nginx. also i am root.
(Right, sorry. /usr/sbin/nginx - Small omission on my part. That should still be the default path.) Check the initscript in /etc/init.d/nginx and make sure the DAEMON and/or PATH aren't using some weird alternate path or filename. Unless the build or install is quietly failing, not too many other things make sense to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.