Find nginx version?

前端 未结 6 1267
生来不讨喜
生来不讨喜 2021-02-01 11:50

I have installed nginx on Debian 7 with the following steps

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nginx
sudo service nginx start
<         


        
6条回答
  •  有刺的猬
    2021-02-01 12:40

    Try running command 'whereis nginx'. It will give you the correct path of the nginx installation, in my case nginx is installed in '/usr/local/sbin', so I need to check if this path exists in output of command 'echo $PATH'. If you don't find the path in the output of this command, then you can add this.

    Suppose the output of my 'echo $PATH' command is this:

      ~$ echo $PATH
    /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/nginx/sbin
    

    Then I can append the path '/usr/local/sbin' in $PATH by following command:

    ~$ echo 'export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/nginx/sbin"' >> $HOME/.bashrc
    

    Please check your nginx installation path may differ from mine, but the steps for adding them are same.

提交回复
热议问题