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

Enable directory listing on Nginx Web Server的更多相关文章

  1. NGINX Web Server Nginx web server

    原文地址:http://nginx.com/resources/admin-guide/web-server/ NGINX Web Server Nginx web server This secti ...

  2. Install the high performance Nginx web server on Ubuntu

    Look out Apache, there's a web server – Nginx (pronounced Engine X) – that means to dismantle you as ...

  3. CentOS 5.5 下安装Countly Web Server过程记录

    CentOS 5.5 下安装Countly Web Server过程记录 1. 系统更新与中文语言包安装 2. 基本环境配置: 2.1. NodeJS安装 依赖项安装 yum -y install g ...

  4. nginx: [emerg] BIO_new_file("/etc/nginx/ssl_key/server.crt") failed (SSL: error:02001002:syste

    Centos 7.5 nginx+web集群配置https报错 报错信息: [root@lb01 conf.d]# nginx -tnginx: [emerg] BIO_new_file(" ...

  5. Setting up Django and your web server with uWSGI and nginx

    https://uwsgi.readthedocs.io/en/latest/tutorials/Django_and_nginx.html Setting up Django and your we ...

  6. [r]Setting up Django and your web server with uWSGI and nginx

    Setting up Django and your web server with uWSGI and nginx This tutorial is aimed at the Django user ...

  7. add web server(nginx+apache)

    #!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...

  8. add web server(nginx)

    #!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...

  9. The Web server is configured to not list the contents of this directory.

    部署一个ASP.NET MVC网站至一个全新的服务器Windows Server 2008 R2, 数据为MS SQL Server 2014 64bit Expression版本. 运行时,它第一次 ...

随机推荐

  1. java 从网上下载文件的几种方式

    package com.github.pandafang.tool; import java.io.BufferedOutputStream; import java.io.File; import ...

  2. centos aws 修改使用密码ssh登录

    因为使用pem登录有很多局限性,在此修改为用密码但不是root登录 1.关闭selinux(要重启) vi /etc/selinux/config SELINUX=disabled 2.重置root密 ...

  3. 浏览器环境下的javascript DOM对象继承模型

    这张图是我直接在现代浏览器中通过prototype原型溯源绘制的一张浏览器宿主环境下的javascript DOM对象模型,对于有效学习和使用javascript DOM编程起到高屋建瓴的指导作用, ...

  4. Python学习---重点模块之logging

    日志级别 日志级别  critical > error > warning > info > debug, 默认是从warning开始打印 import logging # 日 ...

  5. Google Colab 免费的谷歌GPU for deep learning

    Who wants to use a free GPU for deep learning?Google Colab is a free cloud service and now it suppor ...

  6. 小程序——使用Easy Mock

    使用Easy Mock 一.什么是Easy Mock    Easy Mock 是一个可视化的能快速生成模拟数据的持久化服务.在实际开发中常见的Mock方式一般是将模拟数据直接写在代码里,利用Java ...

  7. Clean WRH$_ACTIVE_SESSION_HISTORY in SYSAUX

    Tablespace SYSAUX grows quickly. Run Oracle script awrinfo.sql to find what is using the space. One ...

  8. 「C语言」数据类型及混合运算与类型转换

    深入学习C语言时,有必要先了解一下数据类型的概念,以及它们之间的混合运算与类型转换. 本篇文章便是根据<C语言程序设计教程>和在线翻阅资料后整理而出.(练习题将逐步更新) 目录:     ...

  9. Mysql数据库,表中有中文时,select出来好多问号(?)的解决方法

    在QQ群里问了一些高手,同时参考了这篇文章:http://huangyunbin.iteye.com/blog/1113983,终于把这个问题搞定了. 首先,我用的是zip包的Mysql,直接解压使用 ...

  10. 上下文(context):相关的内容

    简单的理解,就是相关的内容 模式是在某种特定的场景(context)下某个不断重复出现的问题的解决方案. 环境:上下文:来龙去脉 上下文:语境:环境 网络背景:情境:脉络 context其实说白了,和 ...