📚 开源资源分享——颜佐光的个人书架
✉️ 联系站长
书架 / nginx / 安装

nginx文件夹的目录和主配制文件nginx.conf的位置

2021-06-11 17:44 · 约 808 字 · 浏览 2,097 次安装

nginx文件夹的目录和主配制文件nginx.conf的位置

查看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
← 返回《nginx》目录书架 →