Nginx目录介绍

2021/10/19 7:11:46

本文主要是介绍Nginx目录介绍,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

#安装目录由--prefix=/usr/local/nginx
[root@node1 ~]# cd /usr/local/nginx/
[root@node1 nginx]# ll
总用量 0
drwxr-xr-x 2 root root 333 8月  27 15:37 conf
drwxr-xr-x 2 root root  40 8月  27 15:37 html
drwxr-xr-x 2 root root   6 8月  27 15:37 logs
drwxr-xr-x 2 root root  19 8月  27 15:37 sbin

1 conf目录

Nginx所有配置文件的目录,极其重要。在该目录中包含一个nginx.conf配置文件。

[root@node1 nginx]# ll conf/
总用量 68
-rw-r--r-- 1 root root 1077 8月  27 15:37 fastcgi.conf
-rw-r--r-- 1 root root 1077 8月  27 15:37 fastcgi.conf.default
-rw-r--r-- 1 root root 1007 8月  27 15:37 fastcgi_params
-rw-r--r-- 1 root root 1007 8月  27 15:37 fastcgi_params.default
-rw-r--r-- 1 root root 2837 8月  27 15:37 koi-utf
-rw-r--r-- 1 root root 2223 8月  27 15:37 koi-win
-rw-r--r-- 1 root root 5231 8月  27 15:37 mime.types
-rw-r--r-- 1 root root 5231 8月  27 15:37 mime.types.default
-rw-r--r-- 1 root root 2656 8月  27 15:37 nginx.conf
-rw-r--r-- 1 root root 2656 8月  27 15:37 nginx.conf.default
-rw-r--r-- 1 root root  636 8月  27 15:37 scgi_params
-rw-r--r-- 1 root root  636 8月  27 15:37 scgi_params.default
-rw-r--r-- 1 root root  664 8月  27 15:37 uwsgi_params
-rw-r--r-- 1 root root  664 8月  27 15:37 uwsgi_params.default
-rw-r--r-- 1 root root 3610 8月  27 15:37 win-utf

2 html目录

Nginx的默认站点目录。

[root@node1 nginx]# ll html/
总用量 8
-rw-r--r-- 1 root root 494 8月  27 15:37 50x.html #错误提示页面
-rw-r--r-- 1 root root 612 8月  27 15:37 index.html #访问nginx时的首页

3 logs目录

存放Nginx的日志文件。 access.log error.log

#刚安装完nginx,从未启动过的话logs目录下什么都没有,只有启动nginx后,才会出现以下三个文件
[root@node1 nginx]# ll logs/
总用量 4
-rw-r--r-- 1 root root 0 8月  27 16:29 access.log #记录正常访问的日志
-rw-r--r-- 1 root root 0 8月  27 16:29 error.log #错误日志
-rw-r--r-- 1 root root 6 8月  27 16:29 nginx.pid #nginx进程id
[root@node1 nginx]# cat logs/nginx.pid 
24514 #当前启动nginx的master进程的id

4 sbin目录

Nginx命令的目录,如Nginx的启动命令。

[root@node1 nginx]# ll sbin/
总用量 5884
-rwxr-xr-x 1 root root 6023208 8月  27 15:37 nginx #启动关闭等操作的脚本
[root@node1 nginx]# ./sbin/nginx #启动nginx
[root@node1 nginx]# ps aux|grep nginx #查看nginx的进程
root      24514  0.0  0.1  45996  1136 ?        Ss   16:29   0:00 nginx: master process ./sbin/nginx
nobody    24515  0.0  0.1  46444  1876 ?        S    16:29   0:00 nginx: worker process


这篇关于Nginx目录介绍的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程