搜索
首页后端开发php教程ApacheReferenceManual4_PHP教程

Syntax: ... Context: server config, virtual host Status: Core. Compatibility: Available in Apache 1.3 and later and are used to enclose a group of directives which will apply only to the named directory and sub-directories of that directory, the same as . However, it takes as an argument a regular expression. For example: would match directories in /www/ that consisted of three numbers. See Also: for a description of how regular expressions are mixed in with normal s. See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received -------------------------------------------------------------------------------- DocumentRoot directive Syntax: DocumentRoot directory-filename Default: DocumentRoot /usr/local/apache/htdocs Context: server config, virtual host Status: core This directive sets the directory from which httpd will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document. Example: DocumentRoot /usr/web then an access to http://www.my.host.com/index.html refers to /usr/web/index.html. There appears to be a bug in mod_dir which causes problems when the DocumentRoot has a trailing slash (i.e., "DocumentRoot /usr/web/") so please avoid that. -------------------------------------------------------------------------------- ErrorDocument directive Syntax: ErrorDocument error-code document Context: server config, virtual host, directory, .htaccess Status: core Override: FileInfo Compatibility: The directory and .htaccess contexts are only available in Apache 1.1 and later. In the event of a problem or error, Apache can be configured to do one of four things, output a simple hardcoded error message output a customized message redirect to a local URL to handle the problem/error redirect to an external URL to handle the problem/error The first option is the default, while options 2-4 are configured using the ErrorDocument directive, which is followed by the HTTP response code and a message or URL. Messages in this context begin with a single quote ("), which does not form part of the message itself. Apache will sometimes offer additional information regarding the problem/error. URLs can begin with a slash (/) for local URLs, or be a full URL which the client can resolve. Examples: ErrorDocument 500 http://foo.example.com/cgi-bin/tester ErrorDocument 404 /cgi-bin/bad_urls.pl ErrorDocument 401 /subscription_info.html ErrorDocument 403 "Sorry cant allow you access today Note that when you specify an ErrorDocument that points to a remote URL (ie. anything with a method such as "http" in front of it) Apache will send a redirect to the client to tell it where to find the document, even if the document ends up being on the same server.. This has several implications, the most important being that if you use an "ErrorDocument 401" directive then it must refer to a local document. This results from the nature of the HTTP basic authentication scheme. See Also: documentation of customizable responses. -------------------------------------------------------------------------------- ErrorLog directive Syntax: ErrorLog filename|syslog[:facility] Default: ErrorLog logs/error_log (Unix) Default: ErrorLog logs/error.log (Windows and OS/2) Context: server config, virtual host Status: core The error log directive sets the name of the file to which the server will log any errors it encounters. If the filename does not begin with a slash (/) then it is assumed to be relative to the ServerRoot. If the filename begins with a pipe (|) then it is assumed to be a command to spawn to handle the error log. Apache 1.3 and above: Using syslog instead of a filename enables logging via syslogd(8) if the system supports it. The default is to use syslog facility local7, but you can override this by using the syslog:facility syntax where facility can be one of the names usually documented in syslog(1). SECURITY: See the security tips document for details on why your security could be compromised if the directory where logfiles are stored is writable by anyone other than the user that starts the server. See also: LogLevel -------------------------------------------------------------------------------- directive Syntax: ... Context: server config, virtual host, .htaccess Status: core Compatibility: only available in Apache 1.2 and above. The directive provides for access control by filename. It is comparable to the directive and directives. It should be matched with a directive. The directives given within this section will be applied to any object with a basename (last component of filename) matching the specified filename. sections are processed in the order they appear in the configuration file, after the sections and .htaccess files are read, but before sections. Note that can be nested inside sections to restrict the portion of the filesystem they apply to. The filename argument should include a filename, or a wild-card string, where `? matches any single character, and `* matches any sequences of characters. Extended regular expressions can also be used, with the addition of the ~ character. For example: would match most common Internet graphics formats. In Apache 1.3 and later, is preferred, however. Note that unlike and sections, sections can be used inside .htaccess files. This allows users to control access to their own files, at a file-by-file level. See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received ------------------------------------------------

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/531747.htmlTechArticleSyntax: ... Context: server config, virtual host Status: Core. Compatibility: Available in Apache 1.3 and later and are used to enclose a group of directives which will apply only...
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
context是什么意思context是什么意思Aug 04, 2023 pm 05:27 PM

context是程序执行时的环境和状态信息,可以包括各种各样的信息,比如变量的值、函数的调用栈、程序的执行位置等等,使得程序能够根据不同的上下文环境做出相应的决策和执行相应的操作。

Go中如何使用context实现请求缓存Go中如何使用context实现请求缓存Jul 22, 2023 pm 10:51 PM

Go中如何使用context实现请求缓存引言:在构建Web应用程序时,我们经常需要对请求进行缓存以提高性能。在Go语言中,我们可以使用context包来实现请求缓存的功能。本文将介绍如何使用context包来实现请求缓存,并提供代码示例来帮助读者更好地理解。什么是context?:在Go语言中,context包提供了一种方式来在多个goroutine之间传递

Windows Server 2025预览版迎来更新,微软改善Insiders测试体验Windows Server 2025预览版迎来更新,微软改善Insiders测试体验Feb 19, 2024 pm 02:36 PM

在发布WindowsServer的build26040版本之际,微软公布了该产品的官方名称:WindowsServer2025。一同推出的,还有Windows11WindowsInsiderCanaryChannel版本的build26040。有些朋友可能还记得,多年前有人成功将WindowsNT从工作站模式转换为服务器模式,显示微软操作系统各版本之间的共性。尽管现在微软的服务器操作系统版本和Windows11之间有明显区别,但关注细节的人可能会好奇:为什么WindowsServer更新了品牌,

Go中如何使用context实现请求链路追踪Go中如何使用context实现请求链路追踪Jul 21, 2023 pm 05:57 PM

Go中如何使用context实现请求链路追踪在微服务的架构中,请求链路追踪是一种非常重要的技术,用于追踪一个请求在多个微服务之间的传递和处理情况。在Go语言中,我们可以使用context包来实现请求链路追踪,本文将介绍如何使用context进行请求链路追踪,并给出代码示例。首先,我们需要了解一下context包的基本概念和用法。context包提供了一种机制

Go中如何使用context实现请求参数传递Go中如何使用context实现请求参数传递Jul 22, 2023 pm 04:43 PM

Go语言中的context包是用来在程序中传递请求的上下文信息的,它可以在跨多个Goroutine的函数之间传递参数、截取请求和取消操作。在Go中使用context包,我们首先需要导入"context"包。下面是一个示例,演示了如何使用context包实现请求参数传递。packagemainimport("context&quot

如何在Go中使用context实现请求超时控制如何在Go中使用context实现请求超时控制Jul 21, 2023 pm 12:18 PM

如何在Go中使用context实现请求超时控制引言:当我们进行网络请求时,经常会遇到请求超时的问题。一个长时间没有响应的网络请求,不仅会浪费服务器资源,还会影响整体性能。为了解决这个问题,Go语言引入了context包,可以用来实现请求的超时控制。本文将介绍如何在Go中使用context包来实现请求超时控制,并附上相应的代码示例。一、了解context包co

怎么修改Nginx版本名称伪装任意web server怎么修改Nginx版本名称伪装任意web serverMay 14, 2023 pm 09:19 PM

如何修改nginx默认的名称,可以稍微的伪装一下,也可以装x一般来说修改3个位置,一个是nginx.h、另一个是ngx_http_header_filter_module.c、还有一个ngx_http_special_response.c。提示:一般修改都是在nginx编译之前修改,修改完了之后需要重新编译代码如下:scr/core/nginx.conf#definenginx_version"1.4.7"#definenginx_ver"nginx/"n

如何优雅地使用Go和context进行错误处理如何优雅地使用Go和context进行错误处理Jul 21, 2023 pm 11:37 PM

如何优雅地使用Go和context进行错误处理在Go编程中,错误处理是一项非常重要的任务。优雅地处理错误可以提高代码的可读性、可维护性和稳定性。而Go语言的context包则为我们提供了一种非常方便的方式来处理与错误相关的操作。本文将介绍如何优雅地使用Go和context进行错误处理,并提供相关的代码示例。引言Go语言的错误处理机制是通过返回错误值的方式来实

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前By尊渡假赌尊渡假赌尊渡假赌

热工具

Atom编辑器mac版下载

Atom编辑器mac版下载

最流行的的开源编辑器

Dreamweaver Mac版

Dreamweaver Mac版

视觉化网页开发工具

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

将Eclipse与SAP NetWeaver应用服务器集成。

EditPlus 中文破解版

EditPlus 中文破解版

体积小,语法高亮,不支持代码提示功能