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

/ nginx / 没有评论 / 1365浏览

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在服务器上安装的版本号

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