Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Since today: bash: nginx: command not found

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Chris8087
Posts: 17
Joined: 2014-11-13 10:35

Since today: bash: nginx: command not found

#1 Post by Chris8087 »

Hello,

I've setup a fresh Debian 10 VPS with a LEMP and installed a first domain/vhost with Nginx.
Yesterday nginx -t as root worked well and I was able to test the vhost / server blocks files.

Today I get:
nginx -t
bash: nginx: command not found

locate nginx
bash: locate: command not found

systemctl reload nginx
that is working without any issues.
The websites are working fine as well.

What could that be?

Chrisdb
Posts: 279
Joined: 2018-04-10 07:16

Re: Since today: bash: nginx: command not found

#2 Post by Chrisdb »

you have to run nginx as 'sudo'

why did you configure nginx as root?

Chris8087
Posts: 17
Joined: 2014-11-13 10:35

Re: Since today: bash: nginx: command not found

#3 Post by Chris8087 »

I haven't installed sudo so far .. only used the VPS as root for the config stuff and then as a normal user for uploading websites etc.

Still .. the question remains, why did it work yesterday and not today?

Chrisdb
Posts: 279
Joined: 2018-04-10 07:16

Re: Since today: bash: nginx: command not found

#4 Post by Chrisdb »

Not clear how you're running the 'nginx' command. As normal user or root?

EDIT: what's the output of:

Code: Select all

aptitude search 'nginx ~i'

Chris8087
Posts: 17
Joined: 2014-11-13 10:35

Re: Since today: bash: nginx: command not found

#5 Post by Chris8087 »

As either user, I get the same result (not found).
But usually as root (login via SSH as normal user, su into root account, nginx -t)

Code: Select all

aptitude search 'nginx ~i'
bash: aptitude: command not found

apt list --installed "*nginx*"
Listing... Done
libnginx-mod-http-auth-pam/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-http-dav-ext/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-http-echo/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-http-geoip/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-http-image-filter/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-http-subs-filter/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-http-upstream-fair/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-http-xslt-filter/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-mail/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
libnginx-mod-stream/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
nginx-common/stable,stable,now 1.14.2-2+deb10u1 all [installed,automatic]
nginx-full/stable,stable,now 1.14.2-2+deb10u1 amd64 [installed,automatic]
nginx/stable,stable,now 1.14.2-2+deb10u1 all [installed]

systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-02-13 08:18:58 CET; 2h 34min ago
     Docs: man:nginx(8)
  Process: 707 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 708 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 1321 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; -s reload (code=exited, status=0/SUCCESS)
 Main PID: 709 (nginx)
    Tasks: 5 (limit: 4915)
   Memory: 19.1M
   CGroup: /system.slice/nginx.service
           ├─ 709 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ├─1322 nginx: worker process
           ├─1323 nginx: worker process
           ├─1324 nginx: worker process
           └─1325 nginx: worker process

Feb 13 10:02:44 examplesrv.net systemd[1]: Reloading A high performance web server and a reverse proxy server.
Feb 13 10:02:44 examplesrv.net systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Feb 13 10:08:09 examplesrv.net systemd[1]: Reloading A high performance web server and a reverse proxy server.
Feb 13 10:08:09 examplesrv.net systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Feb 13 10:31:36 examplesrv.net systemd[1]: Reloading A high performance web server and a reverse proxy server.
Feb 13 10:31:36 examplesrv.net systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Feb 13 10:32:58 examplesrv.net systemd[1]: Reloading A high performance web server and a reverse proxy server.
Feb 13 10:32:58 examplesrv.net systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Feb 13 10:44:18 examplesrv.net systemd[1]: Reloading A high performance web server and a reverse proxy server.
Feb 13 10:44:18 examplesrv.net systemd[1]: Reloaded A high performance web server and a reverse proxy server.


Chrisdb
Posts: 279
Joined: 2018-04-10 07:16

Re: Since today: bash: nginx: command not found

#6 Post by Chrisdb »

what about

Code: Select all

echo $PATH
which nginx

Chris8087
Posts: 17
Joined: 2014-11-13 10:35

Re: Since today: bash: nginx: command not found

#7 Post by Chris8087 »

Code: Select all

echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

which nginx
root@server:/#

# find -name nginx
./var/lib/nginx
./var/log/nginx
./etc/ufw/applications.d/nginx
./etc/logrotate.d/nginx
./etc/nginx
./etc/init.d/nginx
./etc/default/nginx
./usr/share/nginx
./usr/share/doc/nginx
./usr/lib/nginx
./usr/sbin/nginx
So it seems that /usr/sbin has been removed from the path? How (new VPS, just installed LEMP and created two vhosts/server blocks)?
Would have been my first time that this happens.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Since today: bash: nginx: command not found

#8 Post by sunrat »

“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Chris8087
Posts: 17
Joined: 2014-11-13 10:35

Re: Since today: bash: nginx: command not found

#9 Post by Chris8087 »

Perfect, thanks.

Post Reply