search
Homephp教程php手册深入apache配置文件httpd.conf的部分参数说明

深入apache配置文件httpd.conf的部分参数说明

Jun 13, 2016 am 11:44 AM
apachedirectoryparametergo deepofillustratepartConfiguration file

... -- 设定指定目录的访问权限
... -- 设置应用于指定文件的指令
示例:拒绝访问以‘-ht'开头的文件

Order allow,deny
Deny from all

... -- 设置应用于特定URL的指令,容器包含只应用于特定URL的指令
... -- 虚拟主机的配置

设置根目录的访问权限

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

Options选项
All -- 用户可以在该目录中做任何操作
ExecCGI -- 允许用户在目录中执行CGI程序
FollowSymLinks -- 服务器可以使用符号链接指向的文件或者目录
Indexes -- 服务器可生成此目录的文件列表
None -- 不允许访问该目录

Allow选项 --设定允许访问Apache服务器的主机
Allow from all -- 允许所有主机访问
Allow from 201.1.1.1  234.3.4.1 -- 允许来自指定IP的主机访问

Deny选项 -- 设定拒绝访问Apache服务器的主机
Deny from all -- 拒绝所有主机的访问
Deny from 201.1.1.1  234.3.4.1 -- 拒绝来自指定IP的主机访问
#
Order选项 -- 用于指定allow和deny的先后次序
Order deny,allow
Deny from all
Allow from 202.44.23.1
Order allow,deny
Allow from all
Deny from 202.44.23.1
DefaultType text/plain

配置默认的MIME(Mutiproposed Internet Mail Extensions,多功能Internet 邮件扩充服务) 的类型,如果服务器不确定使用什么类型,就使用该默认设置。
如果你网站的内容主要是文字,则最好使用"text/plain"
如果你的网站上的内容主要是二进制文件(图片、视频等),则可以使用"application/octet-stream"
这样可以让你的浏览器在接收到二进制文件时,以正确的方式显示出来,而不是直接显示二进制文本

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools