www.hj8828.comApache HTTP最新官方配置(中译版)

Apache最新官方配置文件中文版。帮忙web服务器管理员更方便的对Apache进行配置。
#
# Based upon the NCSA server configuration files originally by Rob
McCool.
#参照NCSA服务器的配置文件,原版由Rob McCool发布
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:; for detailed
information about
# the directives.
#这是Apache server的主配置文件. 它包含配置指令,来指示服务器
#请参考 了解关于指令的详细信息
# 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’).
# 1. 控制Apache server的全局操作的指令(全局环境变量).
# 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.
# 2.配置主服务或者默认服务的指令,它针对那些被虚拟主机以外的请求作出响应.
#它也包含虚拟主机的一些默认参数
# 3. Settings for virtual hosts, which allow Web requests to be sent
to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
# 3.
虚拟主机设置,这使得发往不同的ip或者主机名的请求可以被子同一个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”
# with ServerRoot set to “C:/Program Files/Apache Group/Apache2” will
be interpreted by the
# server as “C:/Program Files/Apache Group/Apache2/logs/foo.log”.
#配置和日志文件名:如果你所指定的文件名以”/”在Win32中以盘符:/)开头,服务器将以绝对路径来处理。如果不以”/”开头,则以相对于ServerRoot不解释,所以对于logs/foo.log来讲,当ServerRoot为”C:/Program
Files/Apache Group/Apache2”时,则指的是
C:/Program Files/Apache Group/Apache2/logs/foo.log文件
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., “c:/apache” instead of “c:\apache”).
注意,在文件名的定义中,必须用正斜杠,而不是反斜杠,如c:/apache而不是c:\apache
# If a drive letter is omitted, the drive on which Apache.exe is
located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#如果省略了盘符,则以Apache.exe所在的盘符为默认值
建议在绝对路径中永远使用显式的盘符,这样有助于消除误解
### Section 1: Global Environment
#第一部分全局环境
#
# The directives in this section affect the overall operation of
Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#本部分的指令将影响整个Apache服务器,例如它所能处理的并发请求数或者它在哪里能够找到其配置文件
#
# ServerRoot: The top of the directory tree under which the server’s
# configuration, error, and log files are kept.
# ServerRoot: 服务器的配置,错误和日志文件的根目录
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation
(available
# at
<URL:;);
# you will save yourself a lot of trouble.
#注意:如果将其保存到NFS上或者网络上mounted的文件系统上,然后应该阅读LockFile文档,.
# Do NOT add a slash at the end of the directory path.
#不要在目录的末尾加上斜杠
ServerRoot “C:/Program Files/Apache Group/Apache2”
ServerRoot:根目录
#
# ScoreBoardFile: File used to store internal server process
information.
# If unspecified (the default), the scoreboard will be stored in an
# anonymous shared memory segment, and will be unavailable to
third-party
# applications.
ScoreBoardFile: 保存服务器内部的处理信息
如果未定议(默认状态),scoreboard将被保存在匿名的共享内存段中,并且对于第三方来讲,是不可获得的
# If specified, ensure that no two invocations of Apache share the
same
# scoreboard file. The scoreboard file MUST BE STORED ON A LOCAL
DISK.
#如果已定义,应确保Apache的两个调用不能共享同一个scoreboard.
Scoreboard文件必须存放在可分配的磁盘上
#ScoreBoardFile logs/apache_runtime_status
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#PidFile:当服务器起努时,服务器需要将其进程ID号存放在此文件中
PidFile logs/httpd.pid
#
# Timeout: The number of seconds before receives and sends time out.
#Timeout:接收和发送数据的超时设置,秒数
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more
than
# one request per connection). Set to “Off” to deactivate.
#KeepAlive:
是否支持持久联接而不是每个请求建一个连接),设off关闭此功能
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited
amount.
# We recommend you leave this number high, for maximum performance.
#MaxKeepAliveRequests:在持久连接期间,所允许的最大请求数量。设为0表示不作限制
建议设为较高的数,以提高性能
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from
the
# same client on the same connection.
#KeepAliveTimeout:在同一个客户连接中,等待下一个请求的等待时间。
KeepAliveTimeout 15
##
## Server-Pool Size Regulation (MPM specific)
## 常规Server-Pool服务器池的大小(每分钟M数)
# WinNT MPM WinNT 的MPM
# ThreadsPerChild: constant number of worker threads in the server
process
ThreadPerChild:服务器进程中工作的线程数量
# MaxRequestsPerChild: maximum number of requests a server process
serves
每个服务进程的最大请求数
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#Listen:允许你将Apache绑定到指定的IP地址或端口,而不是默认端口,请同时参考<VirtualHost>指令
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#像下面那样指定侦听的IP地址,防止Apache抢占所有绑定的IP地址
#Listen 12.34.56.78:80
Listen 80
#
# Dynamic Shared Object (DSO) Support
#动态共享对象支持DSO
# To be able to use the functionality of a module which was built as a
DSO you
# have to place corresponding `LoadModule’ lines at this location so
the
# directives contained in it are actually available _before_ they are
used.
# Statically compiled modules (those listed by `httpd -l’) do not
need
# to be loaded here.
#为了能够使用模块功能,模块通常以DSO的方式构建,你应该在下面使用LoadModule行,使得能够在使用前获得指令的功能。静态编译模块在httpd-1中所列举的)不需要在此装载
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
#LoadModule auth_anon_module modules/mod_auth_anon.so
#LoadModule auth_dbm_module modules/mod_auth_dbm.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imap_module modules/mod_imap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so
#
# ExtendedStatus controls whether Apache will generate “full” status
# information (ExtendedStatus On) or just basic information
(ExtendedStatus
# Off) when the “server-status” handler is called. The default is
Off.
#扩展状态控制Apache是否产生完整的状态信息设为on产生全部),如果设为Off则产生基本的信息,当与server-status头有关,默认值为Off
#ExtendedStatus On
### Section 2: ‘Main’ server configuration
#第二部分:主服务配置
# The directives in this section set up the values used by the ‘main’
# server, which responds to any requests that aren’t handled by a
# <VirtualHost> definition. These values also provide defaults
for
# any <VirtualHost> containers you may define later in the
file.
#本节中指令的设置值,将被主服务所使用,主服务响应那些没有被<VirtualHost>所处理的请求,这些值也为<VirtualHost>容器提供了默认值,你可以在后面的文件中定义
# All of these directives may appear inside <VirtualHost>
containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
所有这些指令将出现在<VirtualHost>容器中,这些设定值将在定义virtual
host时被覆写。
#
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages,
such
# as error documents. e.g.
[email protected]
#
ServerAdmin:你的地址,当系统故障时,可以给你发email。此地址出现在那些由服务器生成的页面上,如出错文档。例如:[email protected]
ServerAdmin
[email protected]
#
# ServerName gives the name and port that the server uses to identify
itself.
# This can often be determined automatically, but we recommend you
specify
# it explicitly to prevent problems during startup.
#ServerNaem定义了server名称和端口号,用以标明自己的身份。通常可以自动定义,建议显式地定义,避免起动时出错
# If this is not set to valid DNS name for your host,
server-generated
# redirections will not work. See also the UseCanonicalName
directive.
#如果没有正确定义主机的DNS,服务器产生的重定向将不会工作,同时参考UseCanonicalName指令。
# If your host doesn’t have a registered DNS name, enter its IP address
here.
# You will have to access it by its address anyway, and this will
make
# redirections work in a sensible way.
#如果你没有注册DNS名字,请在这里输入IP地址。
你可以在任何情况下使用ip地址,这也使用得重定向变得敏感
ServerName www.moers.com:80
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set “Off”, Apache will use the Hostname and Port supplied
# by the client. When set “On”, Apache will use the value of the
# ServerName directive.
#UseCanonicalName:决定Apaceh如何构建自定参考URL,和SERVER_NAME及SERVER_PORT变量
当设为Off时,Apache将使用客户端给出的域名和端口。当设为On时,Apache将使用ServerName指令
UseCanonicalName Off
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory,
but
# symbolic links and aliases may be used to point to other locations.
#DocumentRoot:服务器文档放置目录。在默认情形下,所有的请求都从这里开始,除了记号和别名将改指它处以外。
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs”
#
# Each directory to which Apache has access can be configured with
respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#每个可供Apache访问的目录,可以配置成允许或禁止哪些服务和特征包括其子目录)
# First, we configure the “default” to be a very restrictive set of
# features.
#首先,我们定义一个默认的非常严格的配置
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled – so if something’s not working
as
# you might expect, make sure that you have specifically enabled it
# below.
#注意,从这一点往前,你必须许可某些特殊的功能,所以如果某些功能未能如你所愿,要确保你在在下述中启用了该功能。
#
# This should be changed to whatever you set DocumentRoot to.
# 这将改变你对DocumentRoot的设置
<Directory “C:/Program Files/Apache Group/Apache2/htdocs”>
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
可能的值为None,All或者任意组合
#  Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI
MultiViews
# 索引包括FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
# Note that “MultiViews” must be named *explicitly* — “Options
All”
# doesn’t give it to you.
#注意MultiViews被显式地Options All,
# The Options directive is both complicated and important. Please
see
#
# for more information.
#选项指令既复杂又重要,请参阅
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess
files.
# It can be “All”, “None”, or any combination of the keywords:
#  Options FileInfo AuthConfig Limit
#AllowOverride
控制什么指令能够加入到.htaccess中,可以是All,None,或者组合关键字
AllowOverride None
#
# Controls who can get stuff from this server.
#控制谁可以可以访问此服务
Order allow,deny
Allow from all
</Directory>
#
# UserDir: The name of the directory that is appended onto a user’s
home
# directory if a ~user request is received. Be especially careful to
use
# proper, forward slashes here. On Windows NT, “Personal/My Website”
# is a more appropriate choice.
# UserDir: 用户的home的名称,当接到到~user的请求时。
请小心正确使用”/”. 在WinNT上,”Personal/My Website”是更合适的选择
UserDir “My Documents/My Website”
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#控制UserDir目录,以下是一个例子,这个目录是只读的
# You must correct the path for the root to match your system’s
configured
# user directory location, e.g. “C:/WinNT/profiles/*/My Documents/My
Website”
# or whichever, as appropriate.
#你必须更正root目录,与系统设置相配,如用户目录是C:/WinNT/profiles/*/My
Documents/My Website或者其它合适的
#<Directory “C:/Documents and Settings/*/My Documents/My
Website”>
#AllowOverride FileInfo AuthConfig Limit
#Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#<Limit GET POST OPTIONS PROPFIND>
#Order allow,deny
#Allow from all
#</Limit>
#<LimitExcept GET POST OPTIONS PROPFIND>
#Order deny,allow
#Deny from all
#</LimitExcept>
#</Directory>
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#DirectoryIndex: Apache服务器将要以一个目录的形式响应服务
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#index.html变量文件一种映射)将直接传送内容。MultiViews选项可以用于同样的目的,但是要慢得多
DirectoryIndex index.html index.html.var
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the
AllowOverride
# directive.
#AccessFileName:
用来查找各个目录下额外的配置指令的配置文件名,同时参考AllowOverride(允许重载)指令
#Acce
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from
being
# viewed by Web clients.
#下面两行,阻址Web客户端访问
.htaccess和htpasswd(访问设定和密码)的文件
#
<Files ~ “^\.ht”>
Order allow,deny
Deny from all
</Files>
#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
# TypesConfig,描述在何处找到mime型别
TypesConfig conf/mime.types
#
# DefaultType is the default MIME type the server will use for a
document
# if it cannot otherwise determine one, such as from filename
extensions.
如果服务器不能确定文档的型别,将使用默认的MIME型别,例如根据扩展名
# If your server contains mostly text or HTML documents, “text/plain”
is
# a good value. If most of your content is binary, such as
applications
# or images, you may want to use “application/octet-stream” instead
to
# keep browsers from trying to display binary files as though they
are
# text.
#如果你的服务器主要包括text/html文档,”text/plain”就是一个好的取值。如果你的大多数内容是binary(二进制)的,如应用程序或图片,你可能希望使用application/octet-stream,使得浏览器试图显示二进制数据,尽管它们是文本
DefaultType text/plain
#
# The mod_mime_magic module allows the server to use various hints
from the
# contents of the file itself to determine its type. The
MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
mod_mime_magic模块,允许服务器根据内容提示来识别文件型别。MIMEMagicFile指令告知模块“内容提示”应到何处找。
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
#
# HostnameLookups: Log the names of clients or just their IP
addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it’d be overall better for the net if
people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to
the
# nameserver.
HostNameLookups: 客户日志或者仅其IP地址,如www.apache.org(on)
或者204.62.129.132
(off).默认为值设为off比较好,如果希望将此置为on将意味着第一次客户请求都至少要查询一次nameserver.
#
HostnameLookups Off
#
# EnableMMAP: Control whether memory-mapping is used to deliver
# files (assuming that the underlying OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems. On some systems, turning it off (regardless of
# filesystem) can improve performance; for details, please see
#
# EnableMMAP: 控制是否通过内存映射的方式传送文件(须得操作系统支持)
默认值为on; 如果你使用NSF加载的文件系统通常在linux下),应置为off.
在某些系统上,置off,不管使用什么文件系统,能够提高效率,详细情况,请参阅文档
#EnableMMAP off
#
# EnableSendfile: Control whether the sendfile kernel support is
# used to deliver files (assuming that the OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems. Please see
#
# EnableSendfile:
控制内核传送文件是否支持需要OS支持)。默认为on,如果使用NFS,则使用off
#EnableSendfile off
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
<VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
<VirtualHost>
# container, that host’s errors will be logged there and not here.
#ErrorLog: 出错日志文件
如果你想为虚拟主机定义Errorlog指令,则该虚拟主机的错误信息将被记录到这里
ErrorLog logs/error.log
#
# LogLevel: Control the number of messages logged to the error.log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
# LogLever:
日志等级,与log4j相似,译者注),决定哪些级别的出错信息将被记录,如debug,info,notice,warn,error,
crit,alert,emerg等,在设定级别以上的信息就会被记录(译者注).
LogLevel warn
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# 日志格式(与log4j相似)
LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\”
\”%{User-Agent}i\”” combined
LogFormat “%h %l %u %t \”%r\” %>s %b” common
LogFormat “%{Referer}i -> %U” referer
LogFormat “%{User-agent}i” agent
# You need to enable mod_logio.c to use %I and %O
#LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\”
\”%{User-Agent}i\” %I %O” combinedio
未完待续……

#
# This is the main Apache HTTP server configuration file. It contains
the
# configuration directives that give the server its instructions.
# See <URL:; for detailed
information.
# In particular, see
# <URL:;
# for a discussion of each configuration directive.
#
# 这是Apache server的主配置文件. 它包含配置指令,来指示服务器。
# 参考
了解关于指令的详细信息。
# 另外,参看
获取每个配置指令的讨论。

目标,在Linux进行apache2.2版本和tomcat6版本的虚拟主机配置。有些时候apache2.2是不能将请求转发给tomcat的(例如直接处理静态页面的显示),所以我们直接用ajp代理之类的简单策略就没有办法区分动态项目和静态项目处理方式了。在这个方面,tomcat早有准备,推出了tomcat-connectors进行了支持。

# # Based upon the NCSA server configuration files originally by Rob
McCool…

# 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’).
# 1.控制Apache server的全局操作的指令(全局环境变量)。
#
# 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.
# 2.
配置主服务或者默认服务的指令,它针对那些被虚拟主机以外的请求作出响应。
# 它也包含虚拟主机的一些默认参数。
#
# 3. Settings for virtual hosts, which allow Web requests to be sent
to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
# 3.
虚拟主机设置,这使得发往不同的ip或者主机名的请求可以被子同一个Apache服务器处理。

 
1、apache已经完全安装到了/usr/local/apache2.2目录下了,web服务端口是80。启动后是apache的it
works!提示

# 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”
# with ServerRoot set to “E:/usr/Apache2.2” will be interpreted by
the
# server as “E:/usr/Apache2.2/logs/foo.log”.
#
#
配置和日志文件名:如果你所指定的文件名以“/”(在Win32中以“盘符:/”)开头,
# 服务器将以绝对路径来处理。如果文件名不以“/”开头,则以相对路径处理,
# 相对于服务器根(Serverroot)。因此“logs/foo.log”,如果服务器根目录
#
为“E:/usr/Apache2.2”,则服务器解释为“E:/usr/Apache2.2/logs/foo.log”。

 
2、tomcat6已经安装到了/usr/local/tomcat6目录下了。8009端口开发,web服务端口是8080。启动后是tomcat的默认页。

#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., “c:/apache” instead of “c:\apache”).
#
注意:在文件名的定义中,必须用正斜杠,而不是反斜杠。(比如,“c:/apache”,而不是“c:\apache”)
#
# If a drive letter is omitted, the drive on which Apache.exe is
located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#
如果省略了盘符,则以Apache.exe所在的盘符为默认值。建议在绝对路径中明确
# 指定盘符,以避免混乱。

  我在tomcat6的webapps下已经部署了两个jsp项目MicTrader 和MicSeller。通过

# ThreadsPerChild: constant number of worker threads in the server
process
# MaxRequestsPerChild: maximum number of requests a server process
serves
# ThreadsPerChild:每个服务进程中的工作线程常数
# MaxRequestsPerChild:服务进程中允许的最大请求数目
ThreadsPerChild 250
MaxRequestsPerChild 0

#
# ServerRoot: The top of the directory tree under which the server’s
# configuration, error, and log files are kept.
# 指出服务器保存其配置、出错和日志文件等的根目录
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to point the LockFile
directive
# at a local disk. If you wish to share the same ServerRoot for
multiple
# httpd daemons, you will need to change at least LockFile and
PidFile.
#
#
不要在目录的末尾加上斜杠。如果你想将ServerRoot指向非本地硬盘上,请添加卷到本地硬盘上。
# 如果你想共享 ServerRoot
给多个HTTPD镜像服务,你必须改变LockFile和PidFile。
#
ServerRoot “E:/usr/Apache2.2”

  3、jdk已经安装了,并且上边的两个服务已经可用了

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
Listen:允许你绑定Apache服务到指定的IP地址和端口上,以取代默认值。请同时参考<VirtualHost>
# 指令。
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
像下面那样使Apache只在指定的IP地址上监听,以防止它在IP地址0.0.0.0上监听。
#
#Listen 12.34.56.78:80
Listen 8080

 
4、linux的RedHat4版本,相关编译包已经ok了

#
# Dynamic Shared Object (DSO) Support
# 动态共享对象(DSO)支持
#
# To be able to use the functionality of a module which was built as a
DSO you
# have to place corresponding `LoadModule’ lines at this location so
the
# directives contained in it are actually available _before_ they are
used.
# Statically compiled modules (those listed by `httpd -l’) do not
need
# to be loaded here.
#
为了能够使用那些以DSO模式编译的模块中的函数,你必须放置相应的“LoadModule”行在这里,以便
# 包含在其后的指令在使用之前激活。
# 那些静态编译的模块(即以“httpd -l”列出的模块)则不需要在这里加载。
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so
LoadModule php5_module “E:/usr/php/php5apache2_2.dll”

  下载:

# 配置 php.ini 的路径
PHPIniDir “E:/usr/php”

1、connector包:Apache Tomcat Connectors (mod_jk) 1.2.30 for Linux i586

# ‘Main’ server configuration
# 主服务配置
#
# The directives in this section set up the values used by the ‘main’
# server, which responds to any requests that aren’t handled by a
# <VirtualHost> definition. These values also provide defaults
for
# any <VirtualHost> containers you may define later in the
file.
#
#
本节中指令的设置值,将被主服务所使用,主服务响应那些没有被<VirtualHost>所处理的请求,
#
这些值也为<VirtualHost>容器提供了默认值,你可以在后面的文件中定义
#
# All of these directives may appear inside <VirtualHost>
containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
#
所有这些指令将出现在<VirtualHost>容器中,这些设定值将在定义virtual
host时被覆写。

命令:wget 

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
# ServerAdmin: 你的地址,当系统故障时,可以给你发email。
#
此地址出现在那些由服务器生成的页面上,如出错文档。例如:admin@your-domain.com
#
ServerAdmin indian@163.com

注意:

#
# ServerName gives the name and port that the server uses to identify
itself.
# This can often be determined automatically, but we recommend you
specify
# it explicitly to prevent problems during startup.
# ServerNaem 定义了server名称和端口号,用以标明自己的身份。
# 通常可以自动定义,建议明确地指定它,避免起动时出错
# If your host doesn’t have a registered DNS name, enter its IP address
here.
# 如果你没有注册DNS名字,请在这里输入IP地址。
ServerName www.kysf.net:8080

2、下载后的so文件名:mod_jk-1.2.30-httpd-2.2.X.so
将文件拷贝并重命名到:/usr/local/apache2.2/modules/mod_jk.so

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory,
but
# symbolic links and aliases may be used to point to other locations.
# DocumentRoot:
你的文档的根目录。默认情况下,所有的请求都从这里开始,
# 但是可以使用符号链接和别名来指向到其他的位置。
#
DocumentRoot “E:/usr/Apache2.2/htdocs”

给文件赋予系统读写权限:cd /usr/local/apache2.2/modules 

#
# Each directory to which Apache has access can be configured with
respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
每个可供Apache访问的目录,可以配置成允许和(或)禁止哪些服务和特性(包括其子目录)
#
# First, we configure the “default” to be a very restrictive set of
# features.
# 首先,我们定义一个默认的非常严格的配置
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>

chmod 777 mod_jk.so

#
# Note that from this point forward you must specifically allow
# particular features to be enabled – so if something’s not working
as
# you might expect, make sure that you have specifically enabled it
# below.
# 注意从这里开始你一定要明确地允许哪些特别的特性能够被使用。
# 所以,如果Apache没有象你所期待的那样工作的话,
请检查你是否在下面明确的指定它可用。

3、进行相关文件的配置(操作前请备份一份)

#
# This should be changed to whatever you set DocumentRoot to.
# 这将改变你对DocumentRoot的设置
#
<Directory “E:/usr/Apache2.2/htdocs”>

(1)、配置httpd.conf。注意内部标注add by
kongqz的地方。都是我加上去的。主要是进行了mod_jk.so模块加载,以及虚拟主机的配置两个配置工作

#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI
MultiViews
#
#Options:这个指令的值可以是“None”,“All”,或者下列选项的任意组合:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI
MultiViews

  1. #   
  2. # This is the main Apache HTTP server configuration file.  It contains the
      
  3. # configuration directives that give the server its instructions.
      
  4. # See <URL:http://httpd.apache.org/docs/2.2> for detailed information.   
  5. # In particular, see    
  6. <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>  
  7. # for a discussion of each configuration directive.   
  8. #   
  9. # Do NOT simply read the instructions in here without understanding
      
  10. # what they do.  They’re here only as hints or reminders.  If you are unsure
      
  11. # consult the online docs. You have been warned.     
  12. #   
  13. # Configuration and logfile names: If the filenames you specify for many
      
  14. # of the server’s control files begin with “/” (or “drive:/” for Win32), the
      
  15. # server will use that explicit path.  If the filenames do *not* begin
      
  16. # with “/”, the value of ServerRoot is prepended — so “logs/foo_log”
      
  17. # with ServerRoot set to “/usr/local/apache2.2” will be interpreted by the
      
  18. # server as “/usr/local/apache2.2/logs/foo_log”.   
  19. #   
  20. # ServerRoot: The top of the directory tree under which the server’s
      
  21. # configuration, error, and log files are kept.   
  22. #   
  23. # Do not add a slash at the end of the directory path.  If you point
      
  24. # ServerRoot at a non-local disk, be sure to point the LockFile directive
      
  25. # at a local disk.  If you wish to share the same ServerRoot for multiple
      
  26. # httpd daemons, you will need to change at least LockFile and PidFile.
      
  27. #   
  28. ServerRoot “/usr/local/apache2.2”   
  29. #   
  30. # Listen: Allows you to bind Apache to specific IP addresses and/or
      
  31. # ports, instead of the default. See also the <VirtualHost>  
  32. # directive.   
  33. #   
  34. # Change this to Listen on specific IP addresses as shown below to 
      
  35. # prevent Apache from glomming onto all bound IP addresses.   
  36. #   
  37. #Listen 12.34.56.78:80   
  38. Listen 80   
  39. #   
  40. # Dynamic Shared Object (DSO) Support   
  41. #   
  42. # To be able to use the functionality of a module which was built as a DSO you
      
  43. # have to place corresponding `LoadModule’ lines at this location so the
      
  44. # directives contained in it are actually available _before_ they are used.
      
  45. # Statically compiled modules (those listed by `httpd -l’) do not need
      
  46. # to be loaded here.   
  47. #   
  48. # Example:   
  49. # LoadModule foo_module modules/mod_foo.so   
  50. #   
  51. LoadModule authn_file_module modules/mod_authn_file.so   
  52. LoadModule authn_dbm_module modules/mod_authn_dbm.so   
  53. LoadModule authn_anon_module modules/mod_authn_anon.so   
  54. LoadModule authn_dbd_module modules/mod_authn_dbd.so   
  55. LoadModule authn_default_module modules/mod_authn_default.so   
  56. LoadModule authz_host_module modules/mod_authz_host.so   
  57. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
      
  58. LoadModule authz_user_module modules/mod_authz_user.so   
  59. LoadModule authz_dbm_module modules/mod_authz_dbm.so   
  60. LoadModule authz_owner_module modules/mod_authz_owner.so   
  61. LoadModule authz_default_module modules/mod_authz_default.so   
  62. LoadModule auth_basic_module modules/mod_auth_basic.so   
  63. LoadModule auth_digest_module modules/mod_auth_digest.so   
  64. LoadModule dbd_module modules/mod_dbd.so   
  65. LoadModule dumpio_module modules/mod_dumpio.so   
  66. LoadModule reqtimeout_module modules/mod_reqtimeout.so   
  67. LoadModule ext_filter_module modules/mod_ext_filter.so   
  68. LoadModule include_module modules/mod_include.so   
  69. LoadModule filter_module modules/mod_filter.so   
  70. LoadModule substitute_module modules/mod_substitute.so   
  71. LoadModule deflate_module modules/mod_deflate.so   
  72. LoadModule log_config_module modules/mod_log_config.so   
  73. LoadModule log_forensic_module modules/mod_log_forensic.so   
  74. LoadModule logio_module modules/mod_logio.so   
  75. LoadModule env_module modules/mod_env.so   
  76. LoadModule mime_magic_module modules/mod_mime_magic.so   
  77. LoadModule cern_meta_module modules/mod_cern_meta.so   
  78. LoadModule expires_module modules/mod_expires.so   
  79. LoadModule headers_module modules/mod_headers.so   
  80. LoadModule ident_module modules/mod_ident.so   
  81. LoadModule usertrack_module modules/mod_usertrack.so   
  82. LoadModule unique_id_module modules/mod_unique_id.so   
  83. LoadModule setenvif_module modules/mod_setenvif.so   
  84. LoadModule version_module modules/mod_version.so   
  85. LoadModule proxy_module modules/mod_proxy.so   
  86. LoadModule proxy_connect_module modules/mod_proxy_connect.so   
  87. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so   
  88. LoadModule proxy_http_module modules/mod_proxy_http.so   
  89. LoadModule proxy_scgi_module modules/mod_proxy_scgi.so   
  90. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so   
  91. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
      
  92. LoadModule mime_module modules/mod_mime.so   
  93. LoadModule dav_module modules/mod_dav.so   
  94. LoadModule status_module modules/mod_status.so   
  95. LoadModule autoindex_module modules/mod_autoindex.so   
  96. LoadModule asis_module modules/mod_asis.so   
  97. LoadModule info_module modules/mod_info.so   
  98. LoadModule cgi_module modules/mod_cgi.so   
  99. LoadModule dav_fs_module modules/mod_dav_fs.so   
  100. LoadModule vhost_alias_module modules/mod_vhost_alias.so   
  101. LoadModule negotiation_module modules/mod_negotiation.so   
  102. LoadModule dir_module modules/mod_dir.so   
  103. LoadModule imagemap_module modules/mod_imagemap.so   
  104. LoadModule actions_module modules/mod_actions.so   
  105. LoadModule speling_module modules/mod_speling.so   
  106. LoadModule userdir_module modules/mod_userdir.so   
  107. LoadModule alias_module modules/mod_alias.so   
  108. LoadModule rewrite_module modules/mod_rewrite.so   
  109. #add by kongqz 20101214   
  110. LoadModule jk_module modules/mod_jk.so   
  111. #AddModule mod_jk.c   
  112. Include /usr/local/apache2.2/conf/mod_jk.conf   
  113. <IfModule !mpm_netware_module>  
  114. <IfModule !mpm_winnt_module>  
  115. #   
  116. # If you wish httpd to run as a different user or group, you must run
      
  117. # httpd as root initially and it will switch.     
  118. #   
  119. # User/Group: The name (or #number) of the user/group to run httpd as.
      
  120. # It is usually good practice to create a dedicated user and group for
      
  121. # running httpd, as with most system services.   
  122. #   
  123. User daemon   
  124. Group daemon   
  125. </IfModule>  
  126. </IfModule>  
  127. # ‘Main’ server configuration   
  128. #   
  129. # The directives in this section set up the values used by the ‘main’
      
  130. # server, which responds to any requests that aren’t handled by a
      
  131. <VirtualHost> definition.  These values also provide defaults for
      
  132. # any <VirtualHost> containers you may define later in the file.
      
  133. #   
  134. # All of these directives may appear inside <VirtualHost> containers,   
  135. # in which case these default settings will be overridden for the
      
  136. # virtual host being defined.   
  137. #   
  138. #   
  139. # ServerAdmin: Your address, where problems with the server should be
      
  140. # e-mailed.  This address appears on some server-generated pages, such
      
  141. # as error documents.  e.g. admin@your-domain.com   
  142. #   
  143. ServerAdmin you@example.com   
  144. #   
  145. # ServerName gives the name and port that the server uses to identify itself.
      
  146. # This can often be determined automatically, but we recommend you specify
      
  147. # it explicitly to prevent problems during startup.   
  148. #   
  149. # If your host doesn’t have a registered DNS name, enter its IP address here.
      
  150. #   
  151. #ServerName www.example.com:80   
  152. #   
  153. # DocumentRoot: The directory out of which you will serve your   
  154. # documents. By default, all requests are taken from this directory, but
      
  155. # symbolic links and aliases may be used to point to other locations.
      
  156. #   
  157. DocumentRoot “/usr/local/apache2.2/htdocs”   
  158. #   
  159. # Each directory to which Apache has access can be configured with respect
      
  160. # to which services and features are allowed and/or disabled in that
      
  161. # directory (and its subdirectories).    
  162. #   
  163. # First, we configure the “default” to be a very restrictive set of 
      
  164. # features.     
  165. #   
  166. <Directory />  
  167.     Options FollowSymLinks   
  168.     AllowOverride None   
  169.     Order deny,allow   
  170.     Deny from all   
  171. </Directory>  
  172. #   
  173. # Note that from this point forward you must specifically allow   
  174. # particular features to be enabled – so if something’s not working as
      
  175. # you might expect, make sure that you have specifically enabled it
      
  176. # below.   
  177. #   
  178. #   
  179. # This should be changed to whatever you set DocumentRoot to.   
  180. #   
  181. <Directory “/usr/local/apache2.2/htdocs”>  
  182.     #   
  183.     # Possible values for the Options directive are “None”, “All”,
      
  184.     # or any combination of:   
  185.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
      
  186.     #   
  187.     # Note that “MultiViews” must be named *explicitly* — “Options All”
      
  188.     # doesn’t give it to you.   
  189.     #   
  190.     # The Options directive is both complicated and important.  Please see
      
  191.     #    
  192.     # for more information.   
  193.     #   
  194.     Options Indexes FollowSymLinks   
  195.     #   
  196.     # AllowOverride controls what directives may be placed in .htaccess files.
      
  197.     # It can be “All”, “None”, or any combination of the keywords:
      
  198.     #   Options FileInfo AuthConfig Limit   
  199.     #   
  200.     AllowOverride None   
  201.     #   
  202.     # Controls who can get stuff from this server.   
  203.     #   
  204.     Order allow,deny   
  205.     Allow from all   
  206. </Directory>  
  207. #   
  208. # DirectoryIndex: sets the file that Apache will serve if a directory
      
  209. # is requested.   
  210. #   
  211. <IfModule dir_module>  
  212.     DirectoryIndex index.html index.jsp   
  213. </IfModule>  
  214. #   
  215. # The following lines prevent .htaccess and .htpasswd files from being 
      
  216. # viewed by Web clients.    
  217. #   
  218. <FilesMatch “^\.ht”>  
  219.     Order allow,deny   
  220.     Deny from all   
  221.     Satisfy All   
  222. </FilesMatch>  
  223. #   
  224. # ErrorLog: The location of the error log file.   
  225. # If you do not specify an ErrorLog directive within a <VirtualHost>  
  226. # container, error messages relating to that virtual host will be
      
  227. # logged here.  If you *do* define an error logfile for a <VirtualHost>  
  228. # container, that host’s errors will be logged there and not here.
      
  229. #   
  230. ErrorLog “logs/error_log”   
  231. #   
  232. # LogLevel: Control the number of messages logged to the error_log.
      
  233. # Possible values include: debug, info, notice, warn, error, crit,
      
  234. # alert, emerg.   
  235. #   
  236. LogLevel warn   
  237. <IfModule log_config_module>  
  238.     #   
  239.     # The following directives define some format nicknames for use with
      
  240.     # a CustomLog directive (see below).   
  241.     #   
  242.     LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” combined
      
  243.     LogFormat “%h %l %u %t \”%r\” %>s %b” common   
  244.     <IfModule logio_module>  
  245.       # You need to enable mod_logio.c to use %I and %O   
  246.       LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\” %I %O” combinedio
      
  247.     </IfModule>  
  248.     #   
  249.     # The location and format of the access logfile (Common Logfile Format).
      
  250.     # If you do not define any access logfiles within a <VirtualHost>  
  251.     # container, they will be logged here.  Contrariwise, if you *do*
      
  252.     # define per-<VirtualHost> access logfiles, transactions will be   
  253.     # logged therein and *not* in this file.   
  254.     #   
  255.     CustomLog “logs/access_log” common   
  256.     #   
  257.     # If you prefer a logfile with access, agent, and referer information
      
  258.     # (Combined Logfile Format) you can use the following directive.
      
  259.     #   
  260.     #CustomLog “logs/access_log” combined   
  261. </IfModule>  
  262. <IfModule alias_module>  
  263.     #   
  264.     # Redirect: Allows you to tell clients about documents that used to 
      
  265.     # exist in your server’s namespace, but do not anymore. The client 
      
  266.     # will make a new request for the document at its new location.
      
  267.     # Example:   
  268.     # Redirect permanent /foo    
  269.     #   
  270.     # Alias: Maps web paths into filesystem paths and is used to
      
  271.     # access content that does not live under the DocumentRoot.   
  272.     # Example:   
  273.     # Alias /webpath /full/filesystem/path   
  274.     #   
  275.     # If you include a trailing / on /webpath then the server will
      
  276.     # require it to be present in the URL.  You will also likely
      
  277.     # need to provide a <Directory> section to allow access to   
  278.     # the filesystem path.   
  279.     #   
  280.     # ScriptAlias: This controls which directories contain server scripts. 
      
  281.     # ScriptAliases are essentially the same as Aliases, except that
      
  282.     # documents in the target directory are treated as applications and
      
  283.     # run by the server when requested rather than as documents sent to the
      
  284.     # client.  The same rules about trailing “/” apply to ScriptAlias
      
  285.     # directives as to Alias.   
  286.     #   
  287.     ScriptAlias /cgi-bin/ “/usr/local/apache2.2/cgi-bin/”   
  288. </IfModule>  
  289. <IfModule cgid_module>  
  290.     #   
  291.     # ScriptSock: On threaded servers, designate the path to the UNIX
      
  292.     # socket used to communicate with the CGI daemon of mod_cgid.
      
  293.     #   
  294.     #Scriptsock logs/cgisock   
  295. </IfModule>  
  296. #   
  297. # “/usr/local/apache2.2/cgi-bin” should be changed to whatever your ScriptAliased
      
  298. # CGI directory exists, if you have that configured.   
  299. #   
  300. <Directory “/usr/local/apache2.2/cgi-bin”>  
  301.     AllowOverride None   
  302.     Options None   
  303.     Order allow,deny   
  304.     Allow from all   
  305. </Directory>  
  306. #   
  307. # DefaultType: the default MIME type the server will use for a document
      
  308. # if it cannot otherwise determine one, such as from filename extensions.
      
  309. # If your server contains mostly text or HTML documents, “text/plain” is
      
  310. # a good value.  If most of your content is binary, such as applications
      
  311. # or images, you may want to use “application/octet-stream” instead to
      
  312. # keep browsers from trying to display binary files as though they are
      
  313. # text.   
  314. #   
  315. DefaultType text/plain   
  316. <IfModule mime_module>  
  317.     #   
  318.     # TypesConfig points to the file containing the list of mappings from
      
  319.     # filename extension to MIME-type.   
  320.     #   
  321.     TypesConfig conf/mime.types   
  322.     #   
  323.     # AddType allows you to add to or override the MIME configuration
      
  324.     # file specified in TypesConfig for specific file types.   
  325.     #   
  326.     #AddType application/x-gzip .tgz   
  327.     #   
  328.     # AddEncoding allows you to have certain browsers uncompress
      
  329.     # information on the fly. Note: Not all browsers support this.
      
  330.     #   
  331.     #AddEncoding x-compress .Z   
  332.     #AddEncoding x-gzip .gz .tgz   
  333.     #   
  334.     # If the AddEncoding directives above are commented-out, then you
      
  335.     # probably should define those extensions to indicate media types:
      
  336.     #   
  337.     AddType application/x-compress .Z   
  338.     AddType application/x-gzip .gz .tgz   
  339.     #   
  340.     # AddHandler allows you to map certain file extensions to “handlers”:
      
  341.     # actions unrelated to filetype. These can be either built into the server
      
  342.     # or added with the Action directive (see below)   
  343.     #   
  344.     # To use CGI scripts outside of ScriptAliased directories:   
  345.     # (You will also need to add “ExecCGI” to the “Options” directive.)
      
  346.     #   
  347.     #AddHandler cgi-script .cgi   
  348.     # For type maps (negotiated resources):   
  349.     #AddHandler type-map var   
  350.     #   
  351.     # Filters allow you to process content before it is sent to the client.
      
  352.     #   
  353.     # To parse .shtml files for server-side includes (SSI):   
  354.     # (You will also need to add “Includes” to the “Options” directive.)
      
  355.     #   
  356.     #AddType text/html .shtml   
  357.     #AddOutputFilter INCLUDES .shtml   
  358. </IfModule>  
  359. #   
  360. # The mod_mime_magic module allows the server to use various hints from the
      
  361. # contents of the file itself to determine its type.  The MIMEMagicFile
      
  362. # directive tells the module where the hint definitions are located.
      
  363. #   
  364. #MIMEMagicFile conf/magic   
  365. #   
  366. # Customizable error responses come in three flavors:   
  367. # 1) plain text 2) local redirects 3) external redirects   
  368. #   
  369. # Some examples:   
  370. #ErrorDocument 500 “The server made a boo boo.”   
  371. #ErrorDocument 404 /missing.html   
  372. #ErrorDocument 404 “/cgi-bin/missing_handler.pl”   
  373. #ErrorDocument 402 
      
  374. #   
  375. #   
  376. # EnableMMAP and EnableSendfile: On systems that support it,    
  377. # memory-mapping or the sendfile syscall is used to deliver   
  378. # files.  This usually improves server performance, but must   
  379. # be turned off when serving from networked-mounted    
  380. # filesystems or if support for these functions is otherwise   
  381. # broken on your system.   
  382. #   
  383. #EnableMMAP off   
  384. #EnableSendfile off   
  385. # Supplemental configuration   
  386. #   
  387. # The configuration files in the conf/extra/ directory can be    
  388. # included to add extra features or to modify the default configuration of 
      
  389. # the server, or you may simply copy their contents here and change as 
      
  390. # necessary.   
  391. # Server-pool management (MPM specific)   
  392. #Include conf/extra/httpd-mpm.conf   
  393. # Multi-language error messages   
  394. #Include conf/extra/httpd-multilang-errordoc.conf   
  395. # Fancy directory listings   
  396. #Include conf/extra/httpd-autoindex.conf   
  397. # Language settings   
  398. #Include conf/extra/httpd-languages.conf   
  399. # User home directories   
  400. #Include conf/extra/httpd-userdir.conf   
  401. # Real-time info on requests and configuration   
  402. #Include conf/extra/httpd-info.conf   
  403. # Virtual hosts   
  404. #Include conf/extra/httpd-vhosts.conf   
  405. # Local access to the Apache HTTP Server Manual   
  406. #Include conf/extra/httpd-manual.conf   
  407. # Distributed authoring and versioning (WebDAV)   
  408. #Include conf/extra/httpd-dav.conf   
  409. # Various default settings   
  410. #Include conf/extra/httpd-default.conf   
  411. #add by kongqz 20101214   
  412. NameVirtualHost *:80   
  413. <VirtualHost *:80>  
  414.     DocumentRoot /usr/local/tomcat6/webapps/MicSeller   
  415.     ServerName seller.linuxidc.com   
  416.     ErrorLog logs/seller-error_log.log   
  417.     CustomLog logs/seller-access_log.log common   
  418.     JkMount /* worker1   
  419. </VirtualHost>  
  420. <VirtualHost *:80>  
  421.     DocumentRoot /usr/local/tomcat6/webapps/MicTrader   
  422.     ServerName trader.linuxidc.com   
  423.     ErrorLog logs/trader-error_log.log   
  424.     CustomLog logs/trader-access_log.log common   
  425.     JkMount /* worker1   
  426. </VirtualHost>  
  427. # Secure (SSL/TLS) connections   
  428. #Include conf/extra/httpd-ssl.conf   
  429. #   
  430. # Note: The following must must be present to support   
  431. #       starting without SSL on platforms with no /dev/random equivalent
      
  432. #       but a statically compiled-in mod_ssl.   
  433. #   
  434. <IfModule ssl_module>  
  435. SSLRandomSeed startup builtin   
  436. SSLRandomSeed connect builtin   
  437. </IfModule>  

#
# Note that “MultiViews” must be named *explicitly* — “Options
All”
# doesn’t give it to you.
#
# 注意,“MultiViews”必须被显式的指定,“Options
All”不能为你提供这个特性。
#
# The Options directive is both complicated and important. Please see
#
# for more information.
#
# options 指令既复杂又重要,请参见

# 获取更多信息。
#
Options Indexes FollowSymLinks

(2)、增加mod_jk.conf配置文件。这里我将host表中的ip指向服务器,并将域名seller.linuxidc.com和trader.linuxidc.com也一并指向到此服务器

#
# AllowOverride controls what directives may be placed in .htaccess
files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
# AllowOverride 控制那些被放置在.htaccess文件中的指令。
# 它可以是“All”,“None”,或者下列指令的组合:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

  1. JkWorkersFile /usr/local/apache2.2/conf/workers.properties  
  2. # Where to put jk logs   
  3. JkLogFile /usr/local/apache2.2/logs/mod_jk.log  
  4. # Set the jk log level [debug/error/info]
      
  5. JkLogLevel info  
  6. # Select the log format   
  7. JkLogStampFormat “[%a %b %d %H:%M:%S %Y]” 
  8. # JkOptions indicate to send SSL KEY SIZE, 
      
  9. JkOptions  +ForwardKeySize +ForwardURICompat -ForwardDirectories
     
  10. # JkRequestLogFormat set the request format 
      
  11. JkRequestLogFormat “%w %V %T”  
  12. JkMount /servlet/*  worker1   
  13. JkMount /*.jsp worker1   
  14. JkMount /MicSeller/* worker1   
  15. JkMount /MicTrader/* worker1