转载:Apache Server 的 httpd.conf 文件注释

 更新时间:2016年11月25日 15:18  点击:1557
这里参照的是Apache Server1_3_12_win32版本。
ServerType standalone
#设置服务器的形式是单独启动(standalone),还是借由互联网络伺服程序inetd来启动。一般使用前者。
ServerRoot "d:/Apache"
#设置服务器的Home目录,用来存放服务器的设置文件、错误文件、记录文件。
PidFile logs/httpd.pid
#程序启动时,把父进程httpd的进程号(process id)存在这个文件中。这个文件名可以配合PidFile指令加以改变。
ScoreBoardFile logs/apache_status
#设置网络上WWW服务器一些执行程序的记录文件。
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf
#这两个文件的内容已经包含在httpd.conf文件中了。
Timeout 300
#如果客户端300秒还没有连上,或者服务器300秒还没有传送数据到客户端,就会自动断线。
KeepAlive On
#设置是否支持续传功能。
MaxKeepAliveRequests 100
#设置支持续传功能的数目。数目越多则浪费的硬盘空间越多。设置为0则不止持续传。
KeepAliveTimeout 15
#如果该为使用者在15秒后还没有向服务器发出要求,则他在不能续传。
MaxRequestsPerChild 0
#设置同时间内child process数目。
ThreadsPerChild 50
#设置服务器使用进程的数目。
#Listen 3000
#Listen 12.34.56.78:80
#允许使用其它的Port或IP访问服务器。此例中Port为3000,IP为12.34.56.78:80。
#BindAddress *
#设置Apache监听所有的IP,也可以具体的指定。
#LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
……
#打开当前未激活预定以的模块。
#ExtendedStatus On
#设置服务器产生的状态信息。
这里参照的是Apache Server1_3_12_win32版本。
Port 80
#设置服务器使用的Port。
ServerAdmin you@your.address
#设置服务器管理者的E-Mail地址。
#ServerName new.host.name
#服务器的主机名。如果你有固定的IP地址,则不需要设置。
DocumentRoot "d:/Apache/htdocs"
#设置存放站点html文件的目录。
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#设置/目录的指令。具体地说明:
Option:定义在目录内所能执行的操作。None表示只能浏览,FollowSymLinks允许页面连接到别处,ExecCGI允许执行CGI,MultiViews允许看动画或是听音乐之类的操作,Indexes允许服务器返回目录的格式化列表,Includes允许使用SSI。这些设置可以复选。All则可以做任何事,但不包括MultiViews。
PidFile directive
Syntax: PidFile filename
Default: PidFile logs/httpd.pid
Context: server config
Status: core
The PidFile directive sets the file to which the server records the process id of the daemon. If the filename does not begin with a slash (/) then it is assumed to be relative to the ServerRoot. The PidFile is only used in standalone mode.
It is often useful to be able to send the server a signal, so that it closes and then reopens its ErrorLog and TransferLog, and re-reads its configuration files. This is done by sending a SIGHUP (kill -1) signal to the process id listed in the PidFile.
The PidFile is subject to the same warnings about log file placement and security.
--------------------------------------------------------------------------------
Port directive
Syntax: Port number
Default: Port 80
Context: server config
Status: core
Number is a number from 0 to 65535; some port numbers (especially below 1024) are reserved for particular protocols. See /etc/services for a list of some defined ports; the standard port for the http protocol is 80.
The Port directive has two behaviors, the first of which is necessary for NCSA backwards compatibility (and which is confusing in the context of Apache).
In the absence of any Listen or BindAddress directives specifying a port number, a Port directive given in the "main server" (i.e., outside any <VirtualHost> section) sets the network port on which the server listens. If there are any Listen or BindAddress directives specifying :number then Port has no effect on what address the server listens at.
The Port directive sets the SERVER_PORT environment variable (for CGI and SSI), and is used when the server must generate a URL that refers to itself (for example when creating an external redirect to itself). This behaviour is modified by UseCanonicalName.
In no event does a Port setting affect what ports a VirtualHost responds on, the VirtualHost directive itself is used for that.
一、前期准备情况 Apache2(Win32) 完全模块化安装perl,php,ssl
  1、一个安装好的WIN2000服务器,注意:如果你的机器上已经安装了IIS,将IIS里的所有web站点停掉或端口先改成别的。
  2、下载软件
APACHE 2.0.48
Perl 4.3.1
PHP 4.3.1
MYSQL 4.0.12
ZendOptimizer
  还有几个小东西,很重要,后面的安装会用到(不会全用到,有些文件是编译好的,可以直接用)
  下载地址1: http://www.xdiy.net/soft/serv.rar
  下载地址1: http://www.techxy.com/xdiy/serv.zip
  包里面是:mod_perl 1.9/ mod_ssl 2.0.43/ OpenSSL 0.9.6h/ mod_jk/ ApacheModuleGzip.dll
  gd 2.0.9/ gdpm/ perldiver 1.1/ 中文php.ini/editplus /php_gd_gif.dll 等
  二、安装开始
  1、APACHE安装
  1.1:运行apache_2.0.44-win32-x86-no_ssl.msi,
  假设我的安装的默认路径是 X: ,这样就安装在x盘下的APACHE2的路径下,同时默认域为domain.com。
  1.2:(作一个虚拟主机,此步可以不做)
  编辑X:apache2confhttpd.conf
  找到 #NameVirtualHost *
  修改为 NameVirtualHost 192.168.0.1 #注意这个IP为你自己主机设的IP
  找到 ServerName domain.com 修改为 #ServerName domain.com
  找到ServerAdmin * (*是你安装apache时所填写的邮箱地址)修改为 #ServerAdmin
  接下来添加以下语句:#……的是我的注释,不用加,看一下就可以了
<VirtualHost 192.168.0.1>
ServerAdmin webmaster@domain.com
#主机管理员(联系人)的邮箱地址
ServerName domain.com
#主机名(主机头名)
ServerAlias domain.com www1.domain.com
#主机名(同样可以生效的主机头名)
document.oot X:/VirtualHost/domain.com/www.domain/wwwroot
#该虚拟主机的的www根目录.
ErrorLog X:/VirtualHost/domain.com/www.domain/logs/www.domain-error_log
#错误日志文档,也可以是../logs/www.domain-error_log
CustomLog X:/VirtualHost/domain.com/www.domain/logs/www.domain-access_log common
ScriptAlias /cgi-bin /cgi-bin
#指定perl脚本运行目录,当然,不指定的话整个目录全部可以运行
ScriptAlias /php4/ "/php-bin"
#指定php脚本运行目录,当然,不指定的话整个目录全部可以运行
UseCanonicalName directive
Syntax: UseCanonicalName on|off|dns
Default: UseCanonicalName on
Context: server config, virtual host, directory
Override: Options
Compatibility: UseCanonicalName is only available in Apache 1.3 and later
In many situations Apache has to construct a self-referential URL. That is, a URL which refers back to the same server. With UseCanonicalName on (and in all versions prior to 1.3) Apache will use the ServerName and Port directives to construct a canonical name for the server. This name is used in all self-referential URLs, and for the values of SERVER_NAME and SERVER_PORT in CGIs.
With UseCanonicalName off Apache will form self-referential URLs using the hostname and port supplied by the client if any are supplied (otherwise it will use the canonical name). These values are the same that are used to implement name based virtual hosts, and are available with the same clients. The CGI variables SERVER_NAME and SERVER_PORT will be constructed from the client supplied values as well.
An example where this may be useful is on an intranet server where you have users connecting to the machine using short names such as www. You'll notice that if the users type a shortname, and a URL which is a directory, such as http://www/splat, without the trailing slash then Apache will redirect them to http://www.domain.com/splat/. If you have authentication enabled, this will cause the user to have to reauthenticate twice (once for www and once again for www.domain.com). But if UseCanonicalName is set off, then Apache will redirect to http://www/splat/.
There is a third option, UseCanonicalName DNS, which is intended for use with mass IP-based virtual hosting to support ancient clients that do not provide a Host: header. With this option Apache does a reverse DNS lookup on the server IP address that the client connected to in order to work out self-referential URLs.
Warning: if CGIs make assumptions about the values of SERVER_NAME they may be broken by this option. The client is essentially free to give whatever value they want as a hostname. But if the CGI is only using SERVER_NAME to construct self-referential URLs then it should be just fine.
IndexOptions FancyIndexing
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz
ReadmeName README
HeaderName HEADER
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
当一个HTTP请求的URL为一个目录的时候,服务器返回这个目录中的索引文件。但如果一个目录中不存在缺省的索引文件,并且该服务器又许可显示目录文件列表的时候,就会显示出这个目录中的文件列表,为了使得这个文件列表能具有可理解性,而不仅仅是一个简单的列表,就需要前面的这些设置参数。
如果使用了IndexOptions FancyIndexing选项,可以让服务器产生的目录列
表中针对各种不同类型的文档引用各种图标。而哪种文件使用哪种图标,则使用
下面的 AddIconByEncoding、AddIconByType以及AddIcon来定义,分别依据MIME 的编码、类型以及文件的后缀来判断使用何种图标。如果不能确定文档使用的图标,就使用 DefaultIcon定义的缺省图标。
[!--infotagslink--]

相关文章

  • php读取zip文件(删除文件,提取文件,增加文件)实例

    下面小编来给大家演示几个php操作zip文件的实例,我们可以读取zip包中指定文件与删除zip包中指定文件,下面来给大这介绍一下。 从zip压缩文件中提取文件 代...2016-11-25
  • Jupyter Notebook读取csv文件出现的问题及解决

    这篇文章主要介绍了JupyterNotebook读取csv文件出现的问题及解决,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教...2023-01-06
  • Photoshop打开PSD文件空白怎么解决

    有时我们接受或下载到的PSD文件打开是空白的,那么我们要如何来解决这个 问题了,下面一聚教程小伙伴就为各位介绍Photoshop打开PSD文件空白解决办法。 1、如我们打开...2016-09-14
  • 解决python 使用openpyxl读写大文件的坑

    这篇文章主要介绍了解决python 使用openpyxl读写大文件的坑,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2021-03-13
  • C#实现HTTP下载文件的方法

    这篇文章主要介绍了C#实现HTTP下载文件的方法,包括了HTTP通信的创建、本地文件的写入等,非常具有实用价值,需要的朋友可以参考下...2020-06-25
  • SpringBoot实现excel文件生成和下载

    这篇文章主要为大家详细介绍了SpringBoot实现excel文件生成和下载,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-02-09
  • C#操作本地文件及保存文件到数据库的基本方法总结

    C#使用System.IO中的文件操作方法在Windows系统中处理本地文件相当顺手,这里我们还总结了在Oracle中保存文件的方法,嗯,接下来就来看看整理的C#操作本地文件及保存文件到数据库的基本方法总结...2020-06-25
  • php无刷新利用iframe实现页面无刷新上传文件(1/2)

    利用form表单的target属性和iframe 一、上传文件的一个php教程方法。 该方法接受一个$file参数,该参数为从客户端获取的$_files变量,返回重新命名后的文件名,如果上传失...2016-11-25
  • php批量替换内容或指定目录下所有文件内容

    要替换字符串中的内容我们只要利用php相关函数,如strstr,str_replace,正则表达式了,那么我们要替换目录所有文件的内容就需要先遍历目录再打开文件再利用上面讲的函数替...2016-11-25
  • PHP文件上传一些小收获

    又码了一个周末的代码,这次在做一些关于文件上传的东西。(PHP UPLOAD)小有收获项目是一个BT种子列表,用户有权限上传自己的种子,然后配合BT TRACK服务器把种子的信息写出来...2016-11-25
  • Zend studio文件注释模板设置方法

    步骤:Window -> PHP -> Editor -> Templates,这里可以设置(增、删、改、导入等)管理你的模板。新建文件注释、函数注释、代码块等模板的实例新建模板,分别输入Name、Description、Patterna)文件注释Name: 3cfileDescriptio...2013-10-04
  • AI源文件转photoshop图像变模糊问题解决教程

    今天小编在这里就来给photoshop的这一款软件的使用者们来说下AI源文件转photoshop图像变模糊问题的解决教程,各位想知道具体解决方法的使用者们,那么下面就快来跟着小编...2016-09-14
  • C++万能库头文件在vs中的安装步骤(图文)

    这篇文章主要介绍了C++万能库头文件在vs中的安装步骤(图文),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2021-02-23
  • php文件上传你必须知道的几点

    本篇文章主要说明的是与php文件上传的相关配置的知识点。PHP文件上传功能配置主要涉及php.ini配置文件中的upload_tmp_dir、upload_max_filesize、post_max_size等选项,下面一一说明。打开php.ini配置文件找到File Upl...2015-10-21
  • ant design中upload组件上传大文件,显示进度条进度的实例

    这篇文章主要介绍了ant design中upload组件上传大文件,显示进度条进度的实例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-10-29
  • C#使用StreamWriter写入文件的方法

    这篇文章主要介绍了C#使用StreamWriter写入文件的方法,涉及C#中StreamWriter类操作文件的相关技巧,需要的朋友可以参考下...2020-06-25
  • php实现文件下载实例分享

    举一个案例:复制代码 代码如下:<?phpclass Downfile { function downserver($file_name){$file_path = "./img/".$file_name;//转码,文件名转为gb2312解决中文乱码$file_name = iconv("utf-8","gb2312",$file_name...2014-06-07
  • C#路径,文件,目录及IO常见操作汇总

    这篇文章主要介绍了C#路径,文件,目录及IO常见操作,较为详细的分析并汇总了C#关于路径,文件,目录及IO常见操作,具有一定参考借鉴价值,需要的朋友可以参考下...2020-06-25
  • 查找php配置文件php.ini所在路径的二种方法

    通常php.ini的位置在:复制代码 代码如下:/etc目录下或/usr/local/lib目录下。如果你还是找不到php.ini或者找到了php.ini修改后不生效(其实是没找对),请使用如下办法:1.新建php文件,写入如下代码复制代码 代码如下:<?phpe...2014-05-31
  • PHP判断上传文件类型的解决办法

    分享给大家php判断上传文件类型的方法,大家一起学习学习。/** * 读取文件前几个字节 判断文件类型 * @return String */ function checkTitle($filename){ $file=fopen($filename, "rb"); $bin=fread($file, 2); /...2015-10-21