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. 任务十七:零基础JavaScript编码(五)

    任务目的 在上一任务基础上继续JavaScript的体验 接触更加复杂的表单对象 实现页面上的一个完整交互功能 用DOM实现一个柱状图图表 任务描述 参考以下示例代码,原始数据包含几个城市的空气质量指 ...

  2. Java通过jna调用c++动态库

    1 环境准备 操作系统:windows 10,x64 jna,jna-4.4.0.jar c++开发环境,vc2013 java开发环境,eclipse,jdk8 2 dll开发 通过vc2013创建 ...

  3. PHP and laravel知识点小小积累

    function () use ($x, &$y){} 自从PHP5.3开始有了closure/匿名函数的概念,在这里的use关键词的作用是允许匿名函数capture到父函数scope 内存在 ...

  4. bootstrap colorscheme以及theme自动生成

    http://paintstrap.com/ 是一个根据adobe kuler color scheme自动生成theme 的工具,比较直观好用,对于调整前端theme有一定参考意义

  5. redis复制+Sentinel搭建

    1:实验环境 测试环境两台: master:172.16.16.34 slave:172.16.16.35 redis版本:redis3.2 要搭建的环境是,redis简单主从复制 2:安装redis ...

  6. POI读取xls和xlsx

    import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import  ...

  7. compositionstart事件与compositionend事件

    https://blog.csdn.net/u013096088/article/details/52873562

  8. linux 用户切换 标签: linux 2016-07-30 13:57 144人阅读 评论(0) 收藏

    一.指令修改 1.普通用户切换到root用户: su root 需要输入密码 2.root用户切换到普通用户: su 用户名 不需要输入密码 二.直接注销,再用新用户登录 注:1.两种方式存在差别,用 ...

  9. 我的第一个Python随笔

    自学Python也很长时间了,注册博客园写了第一篇随笔.之前想过很多次,但是始终不知道该怎么开始,内容如何,现在想想,随笔嘛,是自己的想法,也自己的实践,又是自己的锻炼.话不多说,开始今天的正式内容. ...

  10. 039条件变量同步(Condition)

    也是锁,这个锁多加了wait(),notify()唤醒一个进程,notifyall()唤醒全部进程方法,创建的时候默认是Rlock类型的锁,可以设置为lock类型的,默认就ok from random ...