apache主要配置详解
1.
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#拒绝所有对你服务器文件系统的访问。你必须在下面其它的<Directory>区明确许可访问web内容目录
#
<Directory />
AllowOverride none
Require all denied
</Directory>
2.
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#DocumentRoot:你要使用【serve】的文档的目录。默认为所有请求都从这个目录获取,但是可以使用符号连接【symbolic link】和别名指定其它位置。
#【下面这个指令指定文档目录,也就是网站的根目录】
DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#可能的设置指令值是“None”,“All”,或者以下任意组合:
#Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#注意那个"MultiViews"必须准确命名-----“Options All”将不会起什么作用【doesn't give it to you】【?】
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#选项指令复杂且重要。请参阅http://httpd.apache.org/docs/2.4/mod/core.html#options以得到更多信息
#
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
# AllowOverride控制的指令可能包含在.htaccess文件中。它可以是“all”、“None”、或以下关键字的任意组合:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#下面的指令控制谁能从这台服务器上获取东西
#
Require all granted
</Directory>
3.
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
# DirectoryIndex:设置当Apache服务得到一个目录请求的时候访问的文件【即默认首页】
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
4.
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#下面的行禁止.htaccess和.htpasswd文件被web客户端查看【禁止从浏览器访问.htaccess和.htpasswd文件】
#
<Files ".ht*">
Require all denied
</Files>
5.
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog:错误日志文件的位置。如果你没有在<VirtualHost>容器中指定一个ErrorLog指令,与那个虚拟主机相关的错误消失将记录在这里。如果你确实为一个<VirtualHost>容器定义了错误消息文件,那么主机的错误日志将被记录在那里而不是这里。
#
ErrorLog "logs/error.log"
6.
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
#Redirect:允许你通知客户端以前存在于服务器名字空间的文档,现在已经不存在了。客户端将发送一个新请求以获得新的文档位置。
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Alias:别名,映射网络路径到文件系统路径并被且用于访问不存在于网站根目录的内容。
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#如果你包含了 trainng/on/webpath 那么服务器将获取它并呈现在URL中。【?】
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#ScriptAlias:脚本别名,它控制着那些包含服务器脚本的目录。“脚本别名”本质上与“别名”是相同的,除非目标目录中的文档被当作应用程序对待并且当被请求时由服务器运行而不是当作文档被发送到客户端。【当目标目录中的文档是应用程序,客户端有请求时被服务器运行,而不是以文档形式被发送到客户端,只有这个时候脚本别名与别名是不同的】【?】。以斜杠“/”结尾这个规则对于ScriptAlias和Alias指令是相同的。
#
ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"
</IfModule>
7.
<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from filename extension to MIME-type.
# TypesConfig指向一个文件,这个文件包含一个从文件扩展名到mime-type的映射列表【TypesConfig指向一个文件,这个文件包含一个文件扩展名与mime-type的映射列表】
#
TypesConfig conf/mime.types
#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
# AddType允许你为特殊的文件类型添加或覆盖在TypesConfig中规定的mime配置文件
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress information on the fly. Note: Not all browsers support this.
# AddEncoding允许你有特定的浏览器解压缩信息的自适应能力。注意:并非所有浏览器都支持。
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#如果上面的AddEncoding指令被注释,那么你可能应该定义那些扩展名以指出媒体类型。
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
# AddHandler允许你映射特定文件扩展名到"handlers":动作与文件类型无关。这也可以内建于服务器或者与动作指令【Action directive】一起添加(看下面)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#为了在脚本别名指定的目录外使用CGI脚本:(你也需要添加"ExecCGI"到"Options"指令)
#AddHandler cgi-script .cgi
# For type maps (negotiated resources):为了类型映射(协议资源)【?】
#AddHandler type-map var
#
# Filters allow you to process content before it is sent to the client.
# Filters允许你在内容被发送到客户端之前处理它。
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#为“服务器端包含”分析.shtml文件:(你也需要添加“includes”到"Options"指令)
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>
8.
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#可定制的错误响应支持三种方式:1)明文 2)本地重定向 3)外部重定向
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
#
# MaxRanges: Maximum number of Ranges in a request before
# returning the entire resource, or one of the special
# values 'default', 'none' or 'unlimited'.
# Default setting is to accept 200 Ranges.
# MaxRanges:定义了在一个请求返回全部资源之前Ranges的最大数字,或者在'default', 'none' or 'unlimited'三个值中指定的一个值。
#MaxRanges unlimited
9.
# Server-pool management (MPM specific)
#服务器池管理
#Include conf/extra/httpd-mpm.conf
# Multi-language error messages 多语言错误消息
#Include conf/extra/httpd-multilang-errordoc.conf
# Fancy directory listings动态目录列表形式配置
#Include conf/extra/httpd-autoindex.conf
# Language settings 语言设置
#Include conf/extra/httpd-languages.conf
# User home directories 用户家庭目录
#Include conf/extra/httpd-userdir.conf
# Real-time info on requests and configuration 请求和配置上的实时信息
#Include conf/extra/httpd-info.conf
# Virtual hosts 虚拟主机
#Include conf/extra/httpd-vhosts.conf
# Local access to the Apache HTTP Server Manual 本地访问Apache Http Server手册。
#Include conf/extra/httpd-manual.conf
# Distributed authoring and versioning (WebDAV) 分布式创作和版本控制
#Include conf/extra/httpd-dav.conf
# Various default settings 多种类默认设置
#Include conf/extra/httpd-default.conf
10.
# Configure mod_proxy_html to understand HTML4/XHTML1 配置mod_proxy_html,使它支持HTML4/XHTML1
<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>
# Secure (SSL/TLS) connections安全连接
#Include conf/extra/httpd-ssl.conf
apache主要配置详解的更多相关文章
- Apache日志配置详解(rotatelogs LogFormat)
logs/error_logCustomLog logs/access_log common--默认为以上部分 修改为如下: ErrorLog "|/usr/sbin/rotatelogs ...
- Apache的配置详解 带图
对Apache 的 Http.conf 各项配置详解 1.01 ServerRoot 配置 [ServerRoot "" 主要用于指定 Apache 的安装路径,此选项参数值在安装 ...
- Apache的配置详解,最好的Apache配置文档
http://blog.csdn.net/apple_llb/article/details/50253889 Apache的配置由httpd.conf文件配置,因此下面的配置指令都是在httpd.c ...
- Apache的配置详解
Apache的配置由httpd.conf文件配置,因此下面的配置指令都是在httpd.conf文件中修改. 主站点的配置(基本配置) (1) 基本配置: ServerRoot "/mnt/s ...
- apache 优化配置详解
###=========httpd.conf begin===================##Apache主配置文件##设置服务器的基础目录,默认为Apache安装目录ServerRoot &qu ...
- Apache常用配置详解
Apache配置文件:conf/httpd.conf.(注意:表示路径时使用‘/’而不使用‘\’,注释使用‘#’) 1. ServerRoot:服务器根目录,也就是Apache的安装目录,其他的目录配 ...
- apache 虚拟主机详细配置:http.conf配置详解
apache 虚拟主机详细配置:http.conf配置详解 Apache的配置文件http.conf参数含义详解 Apache的配置由httpd.conf文件配置,因此下面的配置指令都是在httpd. ...
- Apache + Tomcat集群配置详解 (1)
一.软件准备 Apache 2.2 : http://httpd.apache.org/download.cgi,下载msi安装程序,选择no ssl版本 Tomcat 6.0 : http://to ...
- Apache 中httpd.conf文件配置详解(转载)
httpd.conf文件配置详解 Apache的基本设置主要交由httpd.conf来设定管理,我们要修改Apache的相关设定,主要还是通过修改httpd.cong来实现.下面让我们来看看htt ...
随机推荐
- [Web 前端] 011 css 背景属性
1. 概览 参数 释义 background-color 背景颜色 background-image 背景图片 background-repeat 是否重复 background-position 定 ...
- CTF夺旗赛丨网络内生安全试验场第四季圣诞赛明日开赛!
期待许久的圣诞狂欢就要来喽 <Jingle bell>欢快的旋律 在耳边翩翩起舞 白胡子老爷爷骑着麋鹿准时来送礼物 2019圣诞节 i 春秋做你的圣诞老人 参加CTF欢乐圣诞赛 你提交答案 ...
- ES6扩展运算符(三点符号), 解构
http://www.cnblogs.com/chrischjh/p/4848934.html
- HihoCoder - 1093 小Hi和小Ho (SPFA)
描述 万圣节的晚上,小Hi和小Ho在吃过晚饭之后,来到了一个巨大的鬼屋! 鬼屋中一共有N个地点,分别编号为1..N,这N个地点之间互相有一些道路连通,两个地点之间可能有多条道路连通,但是并不存在一条两 ...
- Python笔记(读取txt文件中的数据)
在机器学习中,常常需要读取txt文本中的数据,这里主要整理了两种读取数据的方式 数据内容 共有四列数据,前三列为特征值,最后一列为数据标签 40920 8.326976 0.953952 3 1448 ...
- ElasticSearch 7.x 默认不在支持指定索引类型
原文:ElasticSearch 7.x 默认不在支持指定索引类型 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://bl ...
- XMLHttpRequest.setRequestHeader()
在AJAX中,如果需要像 HTML 表单那样 POST 数据,需要使用 setRequestHeader() 方法来添加 HTTP 头. 然后在 send() 方法中规定需要希望发送的数据: setR ...
- Python之路-numpy模块
这里是首先需要安装好Anaconda Anaconda的安装参考Python之路-初识python及环境搭建并测试 配置好环境之后开始使用Jupyter Notebook 1.打开cmd,输入 jup ...
- zip loader
GS.ZipAssetLoader = function(audioContext) { this.audioContext = audioContext, this.objLoader = new ...
- SpringBoot 利用freemaker生成静态页面
1. <!-- freemarker模板 --> <dependency> <groupId>org.springframework.boot</groupI ...