Apache httpd.conf配置文件 1(Global Environment )

本文档详细介绍了Apache服务器的主配置文件httpd.conf,包括全局环境设置、主要服务器参数和虚拟主机设置。讲解了如何理解配置指令,强调了ServerRoot、PidFile、Timeout、KeepAlive等关键配置的作用,并探讨了预派生子进程的MPM模型,如prefork和worker模式,以及相关参数调整。同时提到了动态共享对象(DSO)支持、加载模块以及配置文件的包含策略。
摘要由CSDN通过智能技术生成

Apache 版本: Server version: Apache/2.2.15 

总计 1000行左右

英文前带井号的是注释,不起作用。    

但很多注释去掉前方的  #  即可生效。



#

# This is the main Apache server configuration file.  It contains the  这是Apache服务器主要配置文件

# configuration directives that give the server its instructions.  它包含影响服务器运行的配置指令

# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information. 这里是详细的信息

# In particular, see   尤其是看

# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>

# for a discussion of each configuration directive.   每项配置的讨论  

#

#

# Do NOT simply read the instructions in here without understanding 
不要只是简单的阅读这些指令信息而不去理解它

# what they do.  They're here only as hints or reminders.  If you are unsure

# consult the online docs. You have been warned. 

#这里只是做了简单的提示提醒,如果你没有参考在线文件,你就会被警告


# The configuration directives are grouped into three basic sections:这些配置指令被分为下面三个部分


#  1. Directives that control the operation of the Apache server process as a

#     whole (the 'global environment').控制整个Apache服务器行为的部分(即全局环境变量)


#  2. Directives that define the parameters of the 'main' or 'default' server,定义主要和默认服务指令的参数

#     which responds to requests that aren't handled by a virtual host.对请求作出响应,并非由一个虚拟主机处理

#     These directives also provide default values for the settings  也为全部虚拟主机提供默认参数

#     of all virtual hosts.


#  3. Settings for virtual hosts, which allow Web requests to be sent to设置虚拟主机,允许web请求发送给不同iIP

#     different IP addresses or hostnames and have them handled by the或主机名,这些请求的处理通过同一个

#     same Apache server process.                                                            Apache服务进程。

#

# Configuration and logfile names: If the filenames you specify for many配置和日志名称

# of the server's control files begin with "/" (or "drive:/" for Win32), the   文件名开头带/使用绝对路径,不带/使用

# server will use that explicit path.  If the filenames do *not* begin       相对路径,相对于服务器根目录。

# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"  举例说明,相对路径文件logs/foo.log 相对

# with ServerRoot set to "/etc/httpd" will be interpreted by the      路径为/etc/httpd,则路径被解释为

# server as "/etc/httpd/logs/foo.log".                                              /etc/httpd/logs/foo.log

#

 

### Section 1: Global Environment         第一部分,全局环境

#

# The directives in this section affect the overall operation of Apache, 这一部分指令会影响整个apache操作

# such as the number of concurrent requests it can handle or where it 例如Apache能够处理的并发请求的数量

# can find its configuration files.                                                             或者配置文件地址

#

 

#

# Don't give away too much information about all the subcomponents 不要泄露太多信息关于正在运行的组件信息

# we are running.  Comment out this line if you don't mind remote sites  注释掉这一行,如果你不介意远程站点

# finding out what major optional modules you are running                    发现你正在运行的其它模块


ServerTokens OS                                      此指令控制了Server回送给客户端的回应头域是否包含
                                                                   关于服务器OS类型和编译进的模块描信息
                                                                   服务器会发送(比如说):Server: Apache/2.0.41
                                                                   注意:在使用ServerTokens指令时要先启用ServerSignature指令

 



#

ServerRoot: The top of the directory tree under which the server's  ServerRoot服务根目录这个顶级目录树下

# configuration, error, and log files are kept.                                            是服务器配置、错误、日志 文件

#

# NOTE!  If you intend to place this on an NFS (or otherwise network)  注意 如果你打算放置上述在NFS或其它网络

# mounted filesystem then please read the LockFile documentation       位置文件系统,请一定阅读 LockFile 文档

# (available at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);

# you will save yourself a lot of trouble.                                                你自己也会解决很多问题

#

# Do NOT add a slash at the end of the directory path.                      不要增加斜线 在目录路径的结尾

#

ServerRoot "/etc/httpd"                                                                   ServerRoot 服务器根目录……

 



#

# PidFile: The file in which the server should record its process  Pid文件: 服务器记录启动时进程号的文件

# identification number when it starts.  Note the PIDFILE variable in     注意 如果文件位置改变 文件变量必须在……

# /etc/sysconfig/httpd must be set appropriately if this location is        设置好

# changed.

#                                                                                                          apache进程的进程号文件存放位置

PidFile run/httpd.pid          

 


#

# Timeout: The number of seconds before receives and sends time out.       接收和发生超时信息的时间(秒)

#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值