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. 01_Mac下安装homebrew

    参考:https://jingyan.baidu.com/album/fec7a1e5ec30341190b4e7e5.html?picindex=3 1.在打开的命令行工具中输入如下语句: ruby ...

  2. OpenfileDialog选择照片的简单应用

    OpenFileDialog openFileDlg = new OpenFileDialog(); openFileDlg.Title = "选择文件"; openFileDlg ...

  3. 139.00.006 Git学习-标签管理Tag

    @(139 - Environment Settings | 环境配置) 一.Why 发布一个版本时,我们通常先在版本库中打一个标签(tag),这样,就唯一确定了打标签时刻的版本.将来无论什么时候,取 ...

  4. 第9课 备忘便签-TinyDB

    编写一只个性化的App便签小程序,TinyDB可能会帮上你.   1.组件设计 1)TextBox1输入需要记录存储的信息记录 2)四只button分别作为“添加 编辑 删除清空”信息记录 3)Lli ...

  5. 精通Groovy

    https://www.ibm.com/developerworks/cn/education/java/j-groovy/j-groovy.html https://juejin.im/entry/ ...

  6. Android中的this、Activity、Context等

    Android中的this.Activity.Context.Application等虽然有相似之处,但是不能乱用,每一个都有自己的特点.用的时候不能太随意了. 避免context相关的内存泄露,注意 ...

  7. Thread调用SaveFileDialog

    public void ThreadSaveFileDialog(string sourceFileName) { Thread importThread = new Thread(new Param ...

  8. AWK入门指南

    一. AWK入门指南 Awk是一种便于使用且表达能力强的程序设计语言,可应用于各种计算和数据处理任务.本章是个入门指南,让你能够尽快地开始编写你自己的程序.第二章将描述整个语言,而剩下的章节将向你展示 ...

  9. EOJ-3300 奇数统计(高维前缀和)

    题目链接: https://acm.ecnu.edu.cn/problem/3300/ 题目大意: 给n个数,求在n个数中选两个数(可重复),使得这两个数的组合数是奇数,求总共有多少种取法. 解题思路 ...

  10. MQ--API总结

    研究MQ很长时间了, 每个类,方法,都查了很长时间,在此总结一下! Java编写访问MQ的程序 1.MQQueueManager―――队列管理器访问类  常用方法: public MQQueueMan ...