4

NGINX was built from source using the latest stable build on a debian 9 server. sudo nginx command cannot be found. The NGINX install is located in /usr/local/nginx. How can I configure my server to follow the standard sudo nginx [command] rules? I have tried adding PATH=/usr/sbin/:$PATH which did not work since NGINX is not located in sbin. Thanks

Rhys
  • 91
  • 1
  • 2
  • 7

1 Answers1

20

Run echo $PATH Does it contain /usr/local/sbin?

If not then add PATH=/usr/sbin/:$PATH to your .profile file.

Also, check that nginx is installed in /usr/local/sbin, by going into this directory.

If not then install it by using following commands:

sudo apt update
sudo apt install nginx
Monarth Sarvaiya
  • 1,041
  • 8
  • 20
  • 2
    This question really belongs on SuperUser, so I've added the following fully descriptive answer on a pre-existing question there - https://superuser.com/questions/662306/nginx-v-command-not-found/1509120#1509120 – Chris Halcrow Dec 11 '19 at 05:01