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
本文由 创作,采用 知识共享署名4.0 国际许可协议进行许可。本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为: 2021/06/11 09:44