Enable directory listing on Nginx Web Server
2024-08-27 16:16:10
1:Test environment
[root@linux-node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@linux-node1 ~]# uname -r
3.10.0-862.el7.x86_64
[root@linux-node1 ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
[root@linux-node1 ~]# hostname -I
192.168.99.24
2: Nginx Installation
[root@linux-node1 ~]# yum -y install nginx
[root@linux-node1 ~]# systemctl start nginx.service
[root@linux-node1 ~]# systemctl enable nginx.service
3:Configuration
[root@linux-node1 ~]# cp /etc/nginx/nginx.conf{,.bck}
[root@linux-node1 ~]# egrep -v "#|^$" /etc/nginx/nginx.conf.bck > /etc/nginx/nginx.conf [root@linux-node1 ~]# cat -n /etc/nginx/nginx.conf
28 location / {
29 autoindex on;
30 autoindex_exact_size off;
31 autoindex_localtime on;
32 }
[root@linux-node1 ~]# cd /usr/share/nginx/html/
[root@linux-node1 html]# ls
404.html 50x.html index.html nginx-logo.png poweredby.png
[root@linux-node1 html]# rm -rf *
[root@linux-node1 html]# ls
Anti-Fire Trainning CCTV News Daily Documents
4: http://192.168.99.24
autoindex on;
autoindex_exact_size off;
默认为on,显示出文件的确切大小,单位是bytes。
改为off后,显示出文件的大概大小,单位是kB或者MB或者GB
autoindex_localtime on;
默认为off,显示的文件时间为GMT时间。
改为on后,显示的文件时间为文件的服务器时间
-----
[root@linux-node1 ~]# htpasswd --help
Usage:
htpasswd [-cimBdpsDv] [-C cost] passwordfile username
htpasswd -b[cmBdpsDv] [-C cost] passwordfile username password htpasswd -n[imBdps] [-C cost] username
htpasswd -nb[mBdps] [-C cost] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-b Use the password from the command line rather than prompting for it.
-i Read password from stdin without verification (for script usage).
-m Force MD5 encryption of the password (default).
-B Force bcrypt encryption of the password (very secure).
-C Set the computing time used for the bcrypt algorithm
(higher is more secure but slower, default: 5, valid: 4 to 31).
-d Force CRYPT encryption of the password (8 chars max, insecure).
-s Force SHA encryption of the password (insecure).
-p Do not encrypt the password (plaintext, insecure).
-D Delete the specified user.
-v Verify password for the specified user.
On other systems than Windows and NetWare the '-p' flag will probably not work.
The SHA algorithm does not use a salt and is less secure than the MD5 algorithm.
----xilong_devops@163.com----
最新文章
- QGis、Qt对话框上的OK、Open、Cancel、Help等英文翻译
- 让shell脚本在后台飞
- velocity模板引擎学习(4)-在standalone的java application中使用velocity及velocity-tools
- 拷贝构造函数和const成员函数
- Centos 7 安装mysql后出现 ERROR 2002 (HY000)解决方案
- 阿里云pai项目使用说明
- [模拟赛] T1 无线通讯网
- 对抗明文口令泄露 —— Web 前端慢 Hash
- LabVIEW(六):创建VI
- MYSQL 文件类型
- websocket学习和群聊实现
- 使用 PHP_CodeSniffer 检查 代码 是否 符合 编码规范
- Windows平台下使用CodeBlocks+GCC编译器生成动态dll,C#调用报错
- [py]str list切片-去除字符串首尾空格-递归思想
- Spring Boot + MyBatis + Druid + Redis + Thymeleaf 整合小结
- QT 正则表达式无效
- Selenium 入门到精通系列:六
- 解析Linux系统的平均负载概念
- 支付宝app支付java后台流程、原理分析(含nei wang chuan tou)
- 亲测安装nginx1.8.1 日期2016年3月16日
热门文章
- 13_Redis安全
- JavaScript中的XMLHttpRequest与WebAPI
- IE的兼容性设置 X-UA-Compatible
- SQL Server ->;>; PARSE函数
- .net正在终止线程异常
- Python学习---线程基础学习
- htm5 手机自适应问题 文本框被激活(获取焦点)时,页面会放大至原来尺寸。
- 双十一问题:kafka消费能力低下原因思考
- webConfig详细跳转配置.[转]
- 异常:Neither BindingResult nor plain target object for bean name 'command' available as request attribute