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

ApacheReferenceManual4_PHP教程

Jul 13, 2016 pm 05:28 PM
config context server syntax

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

热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.能量晶体解释及其做什么(黄色晶体)
2 周前 By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

如何修复 .NET 解析器返回的错误 0xC00CE556 如何修复 .NET 解析器返回的错误 0xC00CE556 Apr 25, 2023 am 08:34 AM

在安装应用程序的新版本时,Windows可能会显示此错误消息“解析C:\\Windows\Microsoft.Net\Framework\v2.0.50727\Config\machine.configParser返回错误0xC00CE556时出错”。当您的系统启动时,这个问题也会出现。无论您在何种情况下遇到此问题,.NETFramework都是幕后真正的罪魁祸首。您可以使用一些非常简单的修复程序来阻止此错误代码再次出现。修复1–替换损坏的文件您可以轻松地从原始目录中替换损坏的ma

如何安装、卸载、重置Windows服务器备份 如何安装、卸载、重置Windows服务器备份 Mar 06, 2024 am 10:37 AM

WindowsServerBackup是WindowsServer操作系统自带的一个功能,旨在帮助用户保护重要数据和系统配置,并为中小型和企业级企业提供完整的备份和恢复解决方案。只有运行Server2022及更高版本的用户才能使用这一功能。在本文中,我们将介绍如何安装、卸载或重置WindowsServerBackup。如何重置Windows服务器备份如果您的服务器备份遇到问题,备份所需时间过长,或无法访问已存储的文件,那么您可以考虑重新设置WindowsServer备份设置。要重置Windows

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

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

context是什么意思 context是什么意思 Aug 04, 2023 pm 05:27 PM

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

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 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

php如何使用ThinkPHP\Config进行配置管理? php如何使用ThinkPHP\Config进行配置管理? May 31, 2023 pm 02:31 PM

随着PHP语言的不断发展,做为PHP后端框架中广泛使用的ThinkPHP也在不断完善。随着业务场景的逐渐复杂,ThinkPHP中对于配置管理的需求也越来越大。在这种背景下,ThinkPHP提供了丰富的配置管理功能,今天我们就来介绍一下如何通过ThinkPHPConfig实现配置管理。一、ThinkPHPConfig的介绍ThinkPHPConfig是Thin

See all articles