my466879168

查看nginx是否安装

linux中查看nginx的安装位置
在命令行输入ps -ef | grep nginx

root       973     1  0 19:14 ?        00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx      975   973  0 19:14 ?        00:00:00 nginx: worker process
root     15720 15656  0 20:56 pts/2    00:00:00 grep --color=auto nginx

master process后面的就是nginx的安装位置

查看nginx在服务器上安装的版本号

  • -v 显示 nginx 的版本
  • -V显示 nginx 的版本,编译器版本和配置参数
    nginx version: nginx/1.19.1

nginx的一些操作

获取到目录后,一般都是先配置conf文件:

vim /etc/nginx/nginx.conf

配置完后一般都是先检测下文件是是否合法根目录下执行一下命令:
/usr/sbin/nginx -t
显示下面两行则是显示成功:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

分类:

技术点:

相关文章:

  • 2022-01-07
  • 2021-12-04
  • 2022-01-06
  • 2021-06-01
猜你喜欢
  • 2021-06-17
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-05-26
  • 2021-12-27
相关资源
相似解决方案