热门标签 | HotTags
当前位置:  开发笔记 > 运维 > 正文

ApacheReferenceManual7

directiveSyntax:...Context:serverconfig,virtualhostStatus:coreCompatibility:LocationisonlyavailableinApache1.1andlater.ThedirectiveprovidesforaccesscontrolbyURL

directive Syntax: ... Context: server config, virtual host Status: core Compatibility: Location is only available in Apache 1.1 and later. The directive provides for access control by URL. It is similar to the directive, and starts a subsection which is terminated with a directive. sections are processed in the order they appear in the configuration file, after the sections and .htaccess files are read, and after the sections. Note that URLs do not have to line up with the filesystem at all, it should be emphasized that operates completely outside the filesystem. For all origin (non-proxy) requests, the URL to be matched is of the form /path/, and you should not include any http://servername prefix. For proxy requests, the URL to be matched is of the form scheme://servername/path, and you must include the prefix. The URL may use wildcards In a wild-card string, `? matches any single character, and `* matches any sequences of characters. Apache 1.2 and above: Extended regular expressions can also be used, with the addition of the ~ character. For example: would match URLs that contained the substring "/extra/data" or "/special/data". In Apache 1.3 and above, a new directive exists which behaves identical to the regex version of . The Location functionality is especially useful when combined with the SetHandler directive. For example, to enable status requests, but allow them only from browsers at foo.com, you might use: SetHandler server-status order deny,allow deny from all allow from .foo.com Apache 1.3 and above note about / (slash): The slash character has special meaning depending on where in a URL it appears. People may be used to its behaviour in the filesystem where multiple adjacent slashes are frequently collapsed to a single slash (i.e., /home///foo is the same as /home/foo). In URL-space this is not necessarily true. The directive and the regex version of require you to explicitly specify multiple slashes if that is your intention. For example, would match the request URL /abc but not the request URL //abc. The (non-regex) directive behaves similarly when used for proxy requests. But when (non-regex) is used for non-proxy requests it will implicitly match multiple slashes with a single slash. For example, if you specify and the request is to /abc//def then it will match. See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received -------------------------------------------------------------------------------- Syntax: ... Context: server config, virtual host Status: core Compatibility: LocationMatch is only available in Apache 1.3 and later. The directive provides for access control by URL, in an identical manner to . However, it takes a regular expression as an argument instead of a simple string. For example: would match URLs that contained the substring "/extra/data" or "/special/data". See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received -------------------------------------------------------------------------------- LockFile directive Syntax: LockFile filename Default: LockFile logs/accept.lock Context: server config Status: core The LockFile directive sets the path to the lockfile used when Apache is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at its default value. The main reason for changing it is if the logs directory is NFS mounted, since the lockfile must be stored on a local disk. The PID of the main server process is automatically appended to the filename. SECURITY: It is best to avoid putting this file in a world writable directory such as /var/tmp because someone could create a denial of service attack and prevent the server from starting by creating a lockfile with the same name as the one the server will try to create. -------------------------------------------------------------------------------- LogLevel directive Syntax: LogLevel level Default: LogLevel error Context: server config, virtual host Status: core Compatibility: LogLevel is only available in 1.3 or later. LogLevel adjusts the verbosity of the messages recorded in the error logs (see ErrorLog directive). The following levels are available, in order of decreasing significance: Level Description Example emerg Emergencies - system is unusable. "Child cannot open lock file. Exiting" alert Action must be taken immediately. "getpwuid: couldnt determine user name from uid" crit Critical Conditions. "socket: Failed to get a socket, exiting child" error Error conditions. "Premature end of script headers" warn Warning conditions. "child process 1234 did not exit, sending another SIGHUP" notice Normal but significant condition. "httpd: caught SIGBUS, attempting to dump core in ..." info Informational. "Server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers)..." debug Debug-level messages "Opening config file ..." When a particular level is specified, messages from all other levels of higher significance will be reported as well. E.g., when LogLevel info is specified, then messages with log levels of notice and warn will also be posted. Using a level of at least crit is recommended. -------------------------------------------------------------------------------- MaxClients directive Syntax: MaxClients number Default: MaxClients 256 Context: server config Status: core The MaxClients directive sets the limit on the number of simultaneous requests that can be supported; not more than this number of child server processes will be created. To configure more than 256 clients, you must edit the HARD_SERVER_LIMIT entry in httpd.h and recompile. Any connection attempts over the MaxClients limit will normally be queued, up to a number based on the ListenBacklog directive. Once a child process is freed at the end of a different request, the connection will then be serviced. -------------------------------------------------------------------------------- MaxKeepAliveRequests directive Syntax: MaxKeepAliveRequests number Default: MaxKeepAliveRequests 100 Context: server config Status: core Compatibility: Only available in Apache 1.2 and later. The MaxKeepAliveRequests directive limits the number of requests allowed per connection when KeepAlive is on. If it is set to "0", unlimited requests will be allowed. We recommend that this setting be kept to a high value for maximum server performance. --------------------------------------------------------------------------------

推荐阅读
  • 如何使用 net.sf.extjwnl.data.Word 类及其代码示例详解 ... [详细]
  • 在Linux环境下,本文详细探讨了Apache服务器中CGI技术的应用与实现。首先,通过使用yum包管理器安装了必要的软件,如PHP。安装完成后,对Apache服务器进行了配置,确保CGI功能正常运行。此外,还介绍了如何编写和调试CGI脚本,以及如何在实际环境中部署这些脚本以提供动态网页内容。实验结果表明,通过合理的配置和优化,Apache服务器能够高效地支持CGI应用程序,为用户提供丰富的交互体验。 ... [详细]
  • MongoDB Aggregates.group() 方法详解与编程实例 ... [详细]
  • 技术日志:深入探讨Spark Streaming与Spark SQL的融合应用
    技术日志:深入探讨Spark Streaming与Spark SQL的融合应用 ... [详细]
  • 在Linux系统中,原本已安装了多个版本的Python 2,并且还安装了Anaconda,其中包含了Python 3。本文详细介绍了如何通过配置环境变量,使系统默认使用指定版本的Python,以便在不同版本之间轻松切换。此外,文章还提供了具体的实践步骤和注意事项,帮助用户高效地管理和使用不同版本的Python环境。 ... [详细]
  • 如何利用Apache与Nginx高效实现动静态内容分离
    如何利用Apache与Nginx高效实现动静态内容分离 ... [详细]
  • 本文深入探讨了IO复用技术的原理与实现,重点分析了其在解决C10K问题中的关键作用。IO复用技术允许单个进程同时管理多个IO对象,如文件、套接字和管道等,通过系统调用如`select`、`poll`和`epoll`,高效地处理大量并发连接。文章详细介绍了这些技术的工作机制,并结合实际案例,展示了它们在高并发场景下的应用效果。 ... [详细]
  • 如何正确配置与使用日志组件:Log4j、SLF4J及Logback的连接与整合方法
    在当前的软件开发实践中,无论是开源项目还是日常工作中,日志框架都是不可或缺的工具之一。本文详细探讨了如何正确配置与使用Log4j、SLF4J及Logback这三个流行的日志组件,并深入解析了它们之间的连接与整合方法,旨在帮助开发者高效地管理和优化日志记录流程。 ... [详细]
  • 在使用sbt构建项目时,遇到了“对象apache不是org软件包的成员”的错误。本文详细分析了该问题的原因,并提供了有效的解决方案,包括检查依赖配置、清理缓存和更新sbt插件等步骤,帮助开发者快速解决问题。 ... [详细]
  • 深入解析Wget CVE-2016-4971漏洞的利用方法与安全防范措施
    ### 摘要Wget 是一个广泛使用的命令行工具,用于从 Web 服务器下载文件。CVE-2016-4971 漏洞涉及 Wget 在处理特定 HTTP 响应头时的缺陷,可能导致远程代码执行。本文详细分析了该漏洞的成因、利用方法以及相应的安全防范措施,包括更新 Wget 版本、配置防火墙规则和使用安全的 HTTP 头。通过这些措施,可以有效防止潜在的安全威胁。 ... [详细]
  • ActiveMQ是由Apache开发的一款广受欢迎且功能强大的开源消息中间件。作为完全符合JMS 1.1和J2EE 1.4规范的JMS Provider实现,尽管JMS规范已问世多年,但ActiveMQ依然保持了其在消息队列领域的领先地位。本文将带你初步了解ActiveMQ的核心概念及其应用场景,帮助你快速入门这一重要的消息传递技术。 ... [详细]
  • 深入解析 javax.faces.view.ViewDeclarationLanguageWrapper.getWrapped() 方法及其应用实例 ... [详细]
  • NoSQL数据库,即非关系型数据库,有时也被称作Not Only SQL,是一种区别于传统关系型数据库的管理系统。这类数据库设计用于处理大规模、高并发的数据存储与查询需求,特别适用于需要快速读写大量非结构化或半结构化数据的应用场景。NoSQL数据库通过牺牲部分一致性来换取更高的可扩展性和性能,支持分布式部署,能够有效应对互联网时代的海量数据挑战。 ... [详细]
  • 构建顶级PHP博客系统:实践与洞见
    构建顶级PHP博客系统不仅需要扎实的技术基础,还需深入理解实际应用需求。本文以Zend Studio为开发环境,MySQL作为数据存储,Apache服务器为运行平台,结合jQuery脚本语言,详细阐述了从环境搭建到功能实现的全过程,分享了开发PHP博客管理系统的宝贵经验和实用技巧。 ... [详细]
  • Linux学习精华:程序管理、终端种类与命令帮助获取方法综述 ... [详细]
author-avatar
法华大道暴力喵一只
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有