Parece que de alguna manera tengo dos instalaciones de Nginx en un servidor, Nginx Amplify informa dos instalaciones (ver captura de pantalla), una de ellas no envía actualizaciones, por supuesto, y ocasionalmente, al reiniciar Nginx, falla quejándose de que los puertos 80 y 443 ya están en uso, lo cual Supongo que la otra instalación comienza a ejecutarse de alguna manera; en este punto, la única forma que sé de resolverlo es reiniciando el servidor, luego la instalación principal se ejecuta nuevamente.
El servidor ejecuta Ubuntu 18.04.6, realmente no sé cómo confirmar las dos instalaciones, miré dentro rc2.d
pero solo veo una entrada de Nginx:
$ ls -l /etc/rc2.d
total 4
-rw-r--r-- 1 root root 677 Feb 5 2016 README
lrwxrwxrwx 1 root root 23 Jun 30 2020 S01amplify-agent -> ../init.d/amplify-agent
lrwxrwxrwx 1 root root 17 Oct 9 2018 S01mongodb -> ../init.d/mongodb
lrwxrwxrwx 1 root root 17 Oct 8 2018 S01rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 29 Jan 2 2019 S01unattended-upgrades -> ../init.d/unattended-upgrades
lrwxrwxrwx 1 root root 15 Oct 8 2018 S01uuidd -> ../init.d/uuidd
lrwxrwxrwx 1 root root 13 Oct 8 2018 S02atd -> ../init.d/atd
lrwxrwxrwx 1 root root 14 Nov 25 2020 S02atop -> ../init.d/atop
lrwxrwxrwx 1 root root 18 Jan 17 2020 S02collectd -> ../init.d/collectd
lrwxrwxrwx 1 root root 14 Oct 8 2018 S02cron -> ../init.d/cron
lrwxrwxrwx 1 root root 14 Oct 8 2018 S02dbus -> ../init.d/dbus
lrwxrwxrwx 1 root root 17 Oct 8 2018 S02ipmievd -> ../init.d/ipmievd
lrwxrwxrwx 1 root root 20 Oct 8 2018 S02irqbalance -> ../init.d/irqbalance
lrwxrwxrwx 1 root root 15 Oct 8 2018 S02mdadm -> ../init.d/mdadm
lrwxrwxrwx 1 root root 15 Oct 9 2018 S02nginx -> ../init.d/nginx
lrwxrwxrwx 1 root root 13 Mar 2 2020 S02ntp -> ../init.d/ntp
lrwxrwxrwx 1 root root 18 Oct 8 2018 S02openipmi -> ../init.d/openipmi
lrwxrwxrwx 1 root root 17 Jul 7 2020 S02postfix -> ../init.d/postfix
lrwxrwxrwx 1 root root 22 Sep 28 2020 S02redis-server -> ../init.d/redis-server
lrwxrwxrwx 1 root root 15 Oct 8 2018 S02rsync -> ../init.d/rsync
lrwxrwxrwx 1 root root 13 Oct 8 2018 S02ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 17 Oct 8 2018 S02sysstat -> ../init.d/sysstat
lrwxrwxrwx 1 root root 16 Jan 17 2020 S02xinetd -> ../init.d/xinetd
lrwxrwxrwx 1 root root 21 Oct 8 2018 S03grub-common -> ../init.d/grub-common
lrwxrwxrwx 1 root root 18 Oct 8 2018 S03ondemand -> ../init.d/ondemand
lrwxrwxrwx 1 root root 18 Oct 8 2018 S03plymouth -> ../init.d/plymouth
lrwxrwxrwx 1 root root 18 Oct 8 2018 S03rc.local -> ../init.d/rc.local
Más información:
$ which nginx
/usr/sbin/nginx
¿Cómo puedo solucionar este problema y eliminar la segunda instalación sin estropear la principal?
Tenga en cuenta que esto en un servidor de producción, por lo que no puedo simplemente hacer una limpieza completa de los paquetes de Nginx y reinstalarlo nuevamente.
Editar
Desinstalé nginx-extras
(1.18) e instalé nginx
(1.21) y por un tiempo mostró las dos instalaciones anteriores de 1.18 más la nueva 1.21. Hoy lo revisé y solo muestra un 1.18 y un 1.21.
Para ver más detalles dentro de Amplify, aquí está la información sobre las dos instancias:
Nginx object
GENERAL
Version: nginx 1.18.0
Status: down
PROCESSES
Running master process: /usr/sbin/nginx
Master process started: 2 days 1 hr ago
Master process id: 2266
Packages:
CONFIGURATION
Running configuration: /etc/nginx/nginx.conf
Stub status URL: http://127.0.0.1:80/nginx_status
CONFIGURE ARGS
--with-http_realip_module=true
--with-stream_ssl_module=true
--with-http_v2_module=true
--with-http_sub_module=true
--with-http_auth_request_module=true
--with-http_slice_module=true
--with-pcre-jit=true
--prefix=/usr/share/nginx
--with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2'
--pid-path=/run/nginx.pid
--with-http_ssl_module=true
--http-log-path=/var/log/nginx/access.log
--with-http_gzip_static_module=true
--with-http_image_filter_module=true
--with-http_addition_module=true
--with-http_geoip_module=true
--with-http_dav_module=true
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi
--with-http_perl_module=true
--http-proxy-temp-path=/var/lib/nginx/proxy
--with-http_gunzip_module=true
--with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC'
--conf-path=/etc/nginx/nginx.conf
--add-module=/build/nginx-1.18.0/debian/modules/headers-more-nginx-module
--add-module=/build/nginx-1.18.0/debian/modules/nginx-auth-pam
--add-module=/build/nginx-1.18.0/debian/modules/nginx-cache-purge
--add-module=/build/nginx-1.18.0/debian/modules/nginx-dav-ext-module
--add-module=/build/nginx-1.18.0/debian/modules/nginx-development-kit
--add-module=/build/nginx-1.18.0/debian/modules/nginx-echo
--add-module=/build/nginx-1.18.0/debian/modules/ngx-fancyindex
--add-module=/build/nginx-1.18.0/debian/modules/nchan
--add-module=/build/nginx-1.18.0/debian/modules/nginx-lua
--add-module=/build/nginx-1.18.0/debian/modules/nginx-upload-progress
--add-module=/build/nginx-1.18.0/debian/modules/nginx-upstream-fair
--add-module=/build/nginx-1.18.0/debian/modules/ngx_http_substitutions_filter_module
--add-module=/build/nginx-1.18.0/debian/modules/passenger/src/nginx_module
--with-http_stub_status_module=true
--with-http_secure_link_module=true
--with-http_flv_module=true
--with-threads=true
--error-log-path=/var/log/nginx/error.log
--lock-path=/var/lock/nginx.lock
--with-http_mp4_module=true
--with-debug=true
--with-mail_ssl_module=true
--with-compat=true
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi
--with-stream=true
--with-http_xslt_module=true
--with-mail=true
--http-scgi-temp-path=/var/lib/nginx/scgi
--http-client-body-temp-path=/var/lib/nginx/body
--with-http_random_index_module=true
AGENT
Account id: 36413
Object type: nginx
Object id: 88921
Api key: 2c55b5b4e8f5187780843bfc8bef1903
Agent version: 1.7.0-1
Parent id: 88920
Nginx object
GENERAL
Version: nginx 1.21.0
Status: up
PROCESSES
Running master process: /usr/sbin/nginx
Master process started: 13 hrs ago
Master process id: 15937
Packages: nginx: 1.21.0-1~xenial
CONFIGURATION
Running configuration: /etc/nginx/nginx.conf
Stub status URL: http://127.0.0.1:80/nginx_status
CONFIGURE ARGS
--with-http_realip_module=true
--lock-path=/var/run/nginx.lock
--with-http_v2_module=true
--with-http_sub_module=true
--with-http_auth_request_module=true
--with-http_slice_module=true
--with-file-aio=true
--prefix=/etc/nginx
--pid-path=/var/run/nginx.pid
--with-http_ssl_module=true
--http-log-path=/var/log/nginx/access.log
--with-http_gzip_static_module=true
--with-http_addition_module=true
--with-http_dav_module=true
--group=nginx
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--with-stream_ssl_module=true
--modules-path=/usr/lib/nginx/modules
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--with-stream_ssl_preread_module=true
--sbin-path=/usr/sbin/nginx
--with-http_gunzip_module=true
--with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
--conf-path=/etc/nginx/nginx.conf
--with-http_stub_status_module=true
--with-http_secure_link_module=true
--with-http_flv_module=true
--with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC'
--error-log-path=/var/log/nginx/error.log
--user=nginx
--with-http_mp4_module=true
--with-threads=true
--with-mail_ssl_module=true
--with-compat=true
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--with-stream=true
--with-mail=true
--http-scgi-temp-path=/var/cache/nginx/scgi_temp
--http-client-body-temp-path=/var/cache/nginx/client_temp
--with-http_random_index_module=true
--with-stream_realip_module=true
AGENT
Account id: 36413
Object type: nginx
Object id: 115575
Api key: 2c55b5b4e8f5187780843bfc8bef1903
Agent version: 1.7.0-1
Parent id: 88920
El mismo proceso maestro, el mismo archivo de configuración, pero la versión 1.18 no tiene información del paquete, así que supongo que tal vez se instaló desde la fuente. ¿Cómo me deshago de él?