Apache Reference Manual (9)

 更新时间:2016年11月25日 15:18  点击:2057
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.
序(Preface)
这份手册是 1.0 版阿帕奇服务器(Apache HTTP server)的文件。这个
服务器是阿帕奇计划的产品,此计划试图回应某些对积极发展一套可以
免费取得之 HTTP 服务器的关心。这个计划的目标是提供一个安全的,
有效率的而且可以扩充功能的服务器,此服务器提供 HTTP 服务且符合
目前的 HTTP 标准。
这套阿帕奇 httpd 服务器的设计不但与 NCSA httpd 1.3 相容,并且
提供常常有人要求的特色,像是
。作为身分验认之用的 DBM 资料库
。自定的(customised)错误与问题回应方式
。多重的 directoryindex 指令
。不限次数的 Alias 以及 Redirect 指令
。以内容为基础的(Content-based) 文件协商(negotiation)
。虚拟服务器
阿帕奇授权书
Copyright 1995 The Apache Group. All rights reserved.
假若符合下列条件,无论是否经过修改,以原始程序及执行程序的形式
散播与使用都是许可的:
1. 散播原始程序码必须保留上述的版权告示,这份条件列表以及下列
声明。
2. 以执行程序码的形式散播必须在随附散播的文件以及/或是资讯中
重现上述的版权告示,这份条件列表以及下列声明。
3. 所有提及或使用这套软体特色的广告都必须显示下列讯息:
`This product includes software developed by the Apache Group
for use in the Apache HTTP server project (http://www.apache.org/).'
4. `Apache Server' 以及 `Apache Group' 这些名称没有随附前述的
的许可不得用来为这套软体的衍生产品背书或鼓励采用。
5. 以任何形式散播都必须保留下列讯息:
`This product includes software developed by the Apache Group
for use in the Apache HTTP server project (http://www.apache.org/).'
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following condictions
are met:
1. Redistribution of source code must retain the above copyright
notice, this list of condictions and the following disclaimer.
2. Redistribution in binary form must reproduce the above copyright
notice, this list of condictions and the following disclaimer in
the documentation and/or other materials provided with the
这里参照的是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。
一、前期准备情况 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.
[!--infotagslink--]

相关文章

  • Lua语言新手简单入门教程

    这篇文章主要给大家介绍的是关于Lua语言新手入门的简单教程,文中通过示例代码一步步介绍的非常详细,对各位新手们的入门提供了一个很方便的教程,需要的朋友可以参考借鉴,下面随着小编来一起学习学习吧。...2020-06-30
  • lua读取redis数据的null判断示例代码

    最近在工作中遇到了一个问题,通过查找相关资料才得知原因是因为返回结果的问题,下面这篇文章主要给大家介绍了关于lua读取redis数据的null判断的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考下...2020-06-30
  • Django def clean()函数对表单中的数据进行验证操作

    这篇文章主要介绍了Django def clean()函数对表单中的数据进行验证操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-07-09
  • C#中out与ref的区别实例解析

    这篇文章主要介绍了C#中out与ref的区别实例解析,对C#初学者有不错的学习借鉴价值,需要的朋友可以参考下...2020-06-25
  • 记一次EFCore类型转换错误及解决方案

    这篇文章主要介绍了记一次EFCore类型转换错误及解决方案,帮助大家更好的理解和学习使用asp.net core,感兴趣的朋友可以了解下...2021-09-22
  • Vue3中reactive函数toRef函数ref函数简介

    这篇文章主要介绍了Vue3中的三种函数,分别对reactive函数toRef函数以及ref函数原理及使用作了简单介绍,有需要的朋友可以借鉴参考下...2021-09-24
  • Apache启动报错No space left on device: AH00023该怎么解决

    Apache启动报错No space left on device: AH00023错误可能是进程导致了,虽然小编不知道什么原因但网上提供的解决办法确实是可以解决我们的问题,下面来看看。对于这类错误是因为linux系统的ipc信号量造成的,apache启动时...2015-10-21
  • c#基础系列之ref和out的深入理解

    有过C#基础知识的都应该清楚Ref和Out的使用方法,所以下面这篇文章主要给大家介绍了关于c#基础系列之ref和out的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考借鉴,下面随着小编来一起学习学习吧...2020-06-25
  • apache配置黑名单和白名单及账户权限控制

    本文我们将分享apache配置黑名单和白名单,apache层的账户权限控制,以及apache黑名单白名单过滤功能,apache rewrite规则实现白名单。 apache配置黑名单和白名单的两...2016-09-14
  • Lua判断变量是否为数字、字符串是否可以转换为数字等

    这篇文章主要介绍了Lua判断变量是否为数字、字符串是否可以转换为数字等,本文讲解了Lua 判断是字符还是数字的方法、Lua判断数字的方法、判断可否转换为数字的方法、判断并且准备一个初值的方法,需要的朋友可以参考下...2020-06-30
  • apache开启gzip详解教程

    今天在用百度工具检测时发,发现有个提示如下 原来可以开启gzip啊,因为我的是apache所以和iis不同,经过网站搜索开启方法如下 一,找到你的httpd.conf文件,打开找到如下 ...2016-01-28
  • 解决PHPstudy Apache无法启动的问题【亲测有效】

    这篇文章主要介绍了PHPstudy Apache无法启动的问题及解决方法【亲测有效】,本文给大家总结了三种方法供大家参考,需要的朋友可以参考下...2020-10-30
  • apache http server遇到了一个问题,需要关闭

    重装系统后,重新安装了xamp,最近启动的时候经常报apache http server遇到了一个问题,需要关闭,显示如图: 解决方法:查看szModName报错的模块,然后把PHP安装目录下对应的模块...2016-01-28
  • Windows Server 2016 上配置 APACHE+SSL+PHP+perl的教程详解

    Windows Server 2016 上配置 APACHE+SSL+PHP+perl怎么配置?小编推荐了一篇介绍Windows Server 2016 上配置 APACHE+SSL+PHP+perl的教程,有需要的同学快来看看吧! ...2017-07-06
  • nginx+apache+mysql+php+memcached+squid搭建集群web环境

    当前,LAMP开发模式是WEB开发的首选,如何搭建一个高效、可靠、稳定的WEB服务器一直是个热门主题,本文就是这个主题的一次尝试。...2016-01-27
  • 详解Ref在React中的交叉用法

    众所周知,react推出了hooks之后,很多项目就开始往hooks上靠拢,所以也就出现了class和hooks交叉使用的项目。这个时候使用ref需要注意一些东西...2021-06-20
  • Lua流程控制语句if else的使用示例

    今天小编就为大家分享一篇关于Lua流程控制语句if else的使用示例,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧...2020-06-30
  • 隐藏Nginx或Apache以及PHP的版本号的方法

    这篇文章主要介绍了隐藏Nginx或Apache以及PHP的版本号的方法,主要用来防止针对性的漏洞攻击,需要的朋友可以参考下...2016-01-05
  • Lua的table库函数insert、remove、concat、sort详细介绍

    这篇文章主要介绍了Lua的table库函数insert、remove、concat、sort详细介绍,本文分别给出了这几个函数的使用实例,需要的朋友可以参考下...2020-06-30
  • apache下设置缓存方法详细介绍

    默认情况下,apache安装完以后,是不允许被cache的。如果外接了cache或squid服务器要求进行web加速的话,就需要在htttpd.conf里进行设置,当然前提是在安装apache的时候要激活mod_c...2016-01-28