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----

最新文章

  1. QGis、Qt对话框上的OK、Open、Cancel、Help等英文翻译
  2. 让shell脚本在后台飞
  3. velocity模板引擎学习(4)-在standalone的java application中使用velocity及velocity-tools
  4. 拷贝构造函数和const成员函数
  5. Centos 7 安装mysql后出现 ERROR 2002 (HY000)解决方案
  6. 阿里云pai项目使用说明
  7. [模拟赛] T1 无线通讯网
  8. 对抗明文口令泄露 —— Web 前端慢 Hash
  9. LabVIEW(六):创建VI
  10. MYSQL 文件类型
  11. websocket学习和群聊实现
  12. 使用 PHP_CodeSniffer 检查 代码 是否 符合 编码规范
  13. Windows平台下使用CodeBlocks+GCC编译器生成动态dll,C#调用报错
  14. [py]str list切片-去除字符串首尾空格-递归思想
  15. Spring Boot + MyBatis + Druid + Redis + Thymeleaf 整合小结
  16. QT 正则表达式无效
  17. Selenium 入门到精通系列:六
  18. 解析Linux系统的平均负载概念
  19. 支付宝app支付java后台流程、原理分析(含nei wang chuan tou)
  20. 亲测安装nginx1.8.1 日期2016年3月16日

热门文章

  1. 13_Redis安全
  2. JavaScript中的XMLHttpRequest与WebAPI
  3. IE的兼容性设置 X-UA-Compatible
  4. SQL Server ->> PARSE函数
  5. .net正在终止线程异常
  6. Python学习---线程基础学习
  7. htm5 手机自适应问题 文本框被激活(获取焦点)时,页面会放大至原来尺寸。
  8. 双十一问题:kafka消费能力低下原因思考
  9. webConfig详细跳转配置.[转]
  10. 异常:Neither BindingResult nor plain target object for bean name 'command' available as request attribute