Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recompiling nginx after using apt-get install nginx

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

like image 836
Kristian Avatar asked Mar 02 '12 17:03

Kristian


1 Answers

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.

like image 136
cydonian.monk Avatar answered Oct 04 '22 18:10

cydonian.monk