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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor