阿帕奇apache服务器怎么配置?

更新时间:2024-02-09 09:11:01 阅读量: 经典范文大全 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

篇一:1.0 版阿帕奇服务器(Apache HTTP server)的文件

目录(Contents) (略)

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

distribution.

3. All advertising materials mentioning features or use of this

software must display the following acknowledge: `This product

includes software developed by the Apache Group for use in the

Apache HTTP server project (http://www.apache.org/).'

4. The names `Apache Server' and `Apache Group' must not be used to

endorse or prompt products derived from this software without

prior written permission.

5. Redistribution of any form whatsoever must retain the following

acknowledge: `This product includes software developed by the

Apache Group for use in the Apache HTTP server project

(http://www.apache.org/).'

THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY

EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARITICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT, INCIDETAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA OR

PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY

OF LIABILITY, WHERHER IN CONTRACT, STRICT LIABILITY, OR TORT

(INCLUDING NEGLIGENCE OR OTHER WISE)ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many

individuals on behalf of the Apache Group and was originally

based on public domain software written at the National Center

for Supercomputing Applications, University of Illinois, Urbana-

Champaign. For more information on the apache Group and the Apache

HTTP server project, please see http://www.apache.org/.

第一章

编译以及安装阿帕奇

1.1下载阿帕奇

最新的阿帕奇资讯可以在阿帕奇网站 http://www.apache.org/ 找到。

此处会列出目前发行的版本,任何更新的公开测试版,同时还有映射的

(mirror)网站与匿名文件传输(ftp) 站之细节。

1.2编译阿帕奇

这一版的阿帕奇支援所谓的‘选用性模组’。然而,为了使这些模组能

有效率,此服务器必须知道哪些模组要编译进去;这需要产生一点短短

的程序码(`modules.c') 单纯地列出它们。

如果你满意我们的标准模组集,而且打算继续让它保持这样,那麽你可

以直接编辑我们提供的 Makefile 并且如同你以前作过的一样编译它。

如果你想要使用选用性模组,那麽无论如何,你都得执行配置指令稿。

这样做:

1. 编辑 `Configuration' 这个文件。这里面包含每一种机器

的 Makefile 设定,而且在这底下还有个额外的节区列出要

编译进去的模组,以及包含这些模组的文件名称,你将得:

(a) 选择适合你机器的一种编译器以及编译选项。

(b) 消掉相对於你想包含进去的模组上面的注解(文件底

端列出模组的那些行)或者加上对应你自己所撰写之

自制(custom)模组的一些新行。注意,如果你想要有

DBM 验认(auth)的话必须明确地配置进去;只要消掉

对应的行上面的注解即可。

2. 执行 `Configure' 这个指令shell;

% Configure

Using `Configuration' as config file

%

这会产生新版的 Makefile 以及 modules.c 文件。如果你

想要维护多个配置,那麽你可以这样,例如

% Configure -file Configuration.ai

Using alternate config file Configuration.ai

%

3. 键入 `make'

我们放进阿帕奇发行套件里的模组是我们测试过而且有许多 阿帕奇发展群成员使用的模组。这些成员或协力团体(third parties)配合特殊需要或功能而贡献的一些额外模组可以在

找到。在该网页上有如何连结这些模组到阿帕奇核心程序码 里去的说明。

1.3安装阿帕奇

编译之後,你将会在 src/ 目录里获得一份称为 `httpd' 的可执行文件。阿帕奇的可执行文件发行套件会提供这个文件。

下一个步骤是为服务器编辑配置档。你应该会在称为 `conf' 的目录里发现三个配置档的发行版本: srm.conf-dist, access.conf-dist 以及

httpd.conf-dist 。把它们复制成所需的 srm.conf, access.conf 及

httpd.conf 文件。

首先编辑 httpd.conf 。这设定此服务器一般的属性;端口号,执行者的身分等等。接下来编辑 srm.conf 文件;这设定文件树的根目录,指定像是服务端剖析的 HTML 或内部的影像地图(imagemap)剖析等等功能。最後编辑 access.conf 文件,至少作些存取(access)的基本设定。

最後,调用httpd 程序,使用 -f 参数配合 httpd.conf 所在的完整路径。像是,最普遍的例子:

/usr/local/etc/apache/src/httpd -f

/usr/local/etc/apache/conf/httpd.conf

现在服务器应该已经开始执行。

依照预设 srm.conf 以及 access.conf 这些文件是藉由名称定位的;要藉由其它的名称来指定调用它们的话,可以在 httpd.conf 里面使用AccessConfig 以及 ResourceConfig 指令。

第二章

启动阿帕奇

2.1启动阿帕奇

httpd 这支程序可以藉由网际网路服务程序 inetd 在每一次有连线要进入 HTTP 服务的时候启动,或者另一种方式,它也可以作为服务程序(daemon)持续地执行,处理请求。无论选择哪一种方式,都必须设定这个 ServerType 指令告诉服务器它要如何执行。

2.2命令列选项

下列选项可以用在 httpd 的命令列上:

-d serverroot

把 ServerRoot 这个参数的起始值设定为 serverroot 。这可以藉由在配置文件里面的 ServerRoot 命令来加以改变。此预设为/usr/local/etc/httpd 。

-f config

启动时执行在 config 文件里面的指令。如果 config 没有以 /作为开始的话,那麽它会被当作相对於 ServerRoot 的路径。此预设值是 conf/httpd.conf 。

-X

以单一程序(single-process)模式执行,只用在内部除错;服务程序不会脱离终端作业或是产生任何子程序。不要使用这个模式来提供正常的网页服务。

-v

篇二:虚拟机中如何在Linux上安装和配置Apache服务器

每日一句:

I am a slow walker, but I never walk backwards.(我走得很慢,但从来不后退。)

一、本次配置

a) 操作系统:Linux

b) 服务器:

c) APR:

d) APR-Util:

e) PCRE:

二、Linux安装程序的基本步骤

1、./configure --prefix=安装目录

2、make

3、make install

三、Linux安装apache服务器步骤:

1、gzip -d httpd- NN.tar.gz (阿帕奇服务器安装包)

2、tar xvf httpd- NN.tar(执行第一步后出现这个文件)

3、cd httpd- NN(执行完第二步后会产生一个服务器的目录,使用cd命令进入)

4、安装程序的基本步骤

5、安装目录/bin/apachectl -k start (启动服务器)

6、测试。打开浏览器输入http://服务器IP,如果出现It Works,则服务器安装成功

7、安装过程中遇到的问题

a) 安装服务器时提示缺少apr文件(到官网下载后进行安装(还是按照安装步骤)) b) 安装apr时提示确实apr-util(到后进行安装(还是按照安装步骤)) c) 安装服务器时提示确实pcre(到后进行安装(还是按照安装步骤))

四、配置apache的虚拟主机

a) 将“安装目录\conf\httpd.conf ”中“#Include etc/extra/httpd-vhosts.conf ”的#去掉。

这样才能使httpd-vhosts.conf文件起作用,或者直接在httpd.conf中写配置也可以(不建议这么做)

b) 在httpd-vhosts.conf中配置VirtualHost(注:Apache在接受到请求时,首先会默认

第一个VirtualHost,然后再找匹配的,如果没有匹配的,默认就是第一个VirtualHost起作用)

<VirtualHost *:80> #主机名

ServerAdmin admin@tsm.com #如果服务器有任何问题将发信到这个地址

DocumentRoot /www/tsm.com #虚拟主机的指向目录

ServerName #访问主机的域名[:端口号]

ServerAlias *.tsm.com #- -这个不知道是啥。

ErrorLog logs/tsm.com-error_log #虚拟主机发生错误时的记录日志(可省略) Customlog logs/tsm.com_access_log common #对虚拟主机发出请求时的记录日志(可省略)

【】 <Directory /www/tsm.com> #虚拟主机对目录的访问权限1(默认为不可访问,

- -这里对其进行了修改、)

Options FollowSymLinks Indexes

AllowOverride None

Order deny,allow

Allow from all

Require all granted

</Directory>

</VirtualHost>

c) 修改本地的hosts文件。(C:\windows\system32\drivers\etc\host)。

格式:服务器IP 主机域名(e.g:192.168.241.1 )

d) 测试。http://主机域名。看到默认网页或者看到文件和目录列表(有权限时)。

【1】访问权限:当其允许时,如果没有默认的页面可以显示,浏览器就会显示文件根目录的目录列表,目录列表包括文件根目录下的文件和子目录。否则则显示:

Forbidden

You don't have permission to access / on this server.

篇三:阿帕奇 HTTP 服务器参考手册

阿帕奇 HTTP 服务器参考手册--老文档一篇

http://

APACHE

An HTTP Server

Reference Manual

@ David Robinson and the Apache Group, 1995

http://www.apache.org/

保留所有权利。这个产品或文件受版权保护并且得在限制其用途,复制 ,散播以及编辑的授权下散播。细节请参阅阿帕奇授权书。

版权所有者不对这份手册的内容作任何保证及建议而且特别声明不保证 符合任何商业目的。

版权所有者保留修订这份手册的权利且其内容得依时变更而不必通知任 何人这些修订与变更。

All rights reserved. This product or documentation protected by copyright and is distributedunder licencesrestricting its use,copying,distribution and decompilation. See the Apache licencefor details.

The copyright owner gives no warranties and makes no representations

about the contents of this manual and specifically disclaims

warranties of merchantability of fitness for any purpose.

The Copyright owner reserves the right to revise this manual and

make changes from time to time in its contents without notifying any person of such revision or changes.

TRADEMARKS

Unix is a registered trademark of UNIX System Laboratories, Inc. Sun and SunOs are trademarks of Sun Microsystems, Inc. Netscape is a trademark of Netscape Communications Corporation. All other product

names mentioned herein are trademarks of their respective owners.

目录(Contents) (略)

序(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 distribution.

3. All advertising materials mentioning features or use of this software must display the following acknowledge: `This product includes software developed by the Apache Group for use in the Apache HTTP server project (http://www.apache.org/).'

4. The names `Apache Server' and `Apache Group' must not be used to endorse or prompt products derived from this software without

prior written permission.

5. Redistribution of any form whatsoever must retain the following acknowledge: `This product includes software developed by the Apache Group for use in the Apache HTTP server project (http://www.apache.org/).'

THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARITICULARPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR ITSCONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT, INCIDETAL, SPECIAL,EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA ORPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHERHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHER WISE)ARISING IN ANY WAY OUT OF THE USE

OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals on behalf of the Apache Group and was originally based on public domain software written at the National Center for Supercomputing Applications, University of Illinois, Urbana- Champaign. For more information on the apache Group and the ApacheHTTP server project, please see http://www.apache.org/.

第一章

编译以及安装阿帕奇

1.1下载阿帕奇

最新的阿帕奇资讯可以在阿帕奇网站 http://www.apache.org/ 找到。 此处会列出目前发行的版本,任何更新的公开测试版,同时还有映射的 (mirror)网站与匿名文件传输(ftp) 站之细节。

1.2编译阿帕奇

这一版的阿帕奇支援所谓的‘选用性模组’。然而,为了使这些模组能 有效率,此服务器必须知道哪些模组要编译进去;这需要产生一点短短 的程序码(`modules.c') 单纯地列出它们。

如果你满意我们的标准模组集,而且打算继续让它保持这样,那麽你可 以直接编辑我们提供的 Makefile 并且如同你以前作过的一样编译它。 如果你想要使用选用性模组,那麽无论如何,你都得执行配置指令稿。

这样做:

1.

(a)

(b)

DBM

2.

% Configure

Using `Configuration' as config file

%

% Configure -file Configuration.ai

Using alternate config file Configuration.ai %

3.

parties)

<URL:http://www.apache.org/dist/contrib/modules />;

编辑 `Configuration' 这个文件。这里面包含每一种机器 的 Makefile 设定,而且在这底下还有个额外的节区列出要 编译进去的模组,以及包含这些模组的文件名称,你将得: 选择适合你机器的一种编译器以及编译选项。 消掉相对於你想包含进去的模组上面的注解(文件底 端列出模组的那些行)或者加上对应你自己所撰写之 自制(custom)模组的一些新行。注意,如果你想要有 验认(auth)的话必须明确地配置进去;只要消掉 对应的行上面的注解即可。 执行 `Configure' 这个指令shell; 这会产生新版的 Makefile 以及 modules.c 文件。如果你 想要维护多个配置,那麽你可以这样,例如 键入 `make' 我们放进阿帕奇发行套件里的模组是我们测试过而且有许多 阿帕奇发展群成员使用的模组。这些成员或协力团体(third 配合特殊需要或功能而贡献的一些额外模组可以在 里 找到。在该网页上有如何连结这些模组到阿帕奇核心程序码 里去的说明。

本文来源:https://www.bwwdw.com/article/ycsb.html

Top