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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM