From d37982ced1f46108fe4e90c41b1061ca3d8e2bee Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@unknown> Date: Tue, 16 Sep 2003 14:18:44 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'APACHE_2_0_BRANCH'. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@101255 13f79535-47bb-0310-9956-ffa450edef68 --- docs/conf/ssl-std.conf.in | 249 +++++++++++++++++ docs/manual/misc/relevant_standards.html | 3 + docs/manual/misc/relevant_standards.html.en | 197 ++++++++++++++ docs/manual/misc/relevant_standards.xml | 174 ++++++++++++ docs/manual/misc/relevant_standards.xml.meta | 11 + docs/manual/vhosts/name-based.xml.ja | 270 +++++++++++++++++++ modules/generators/mod_status.h | 92 +++++++ 7 files changed, 996 insertions(+) create mode 100644 docs/conf/ssl-std.conf.in create mode 100644 docs/manual/misc/relevant_standards.html create mode 100644 docs/manual/misc/relevant_standards.html.en create mode 100644 docs/manual/misc/relevant_standards.xml create mode 100644 docs/manual/misc/relevant_standards.xml.meta create mode 100644 docs/manual/vhosts/name-based.xml.ja create mode 100644 modules/generators/mod_status.h diff --git a/docs/conf/ssl-std.conf.in b/docs/conf/ssl-std.conf.in new file mode 100644 index 00000000000..a3056ca1f5a --- /dev/null +++ b/docs/conf/ssl-std.conf.in @@ -0,0 +1,249 @@ +# +# This is the Apache server configuration file providing SSL support. +# It contains the configuration directives to instruct the server how to +# serve pages over an https connection. For detailing information about these +# directives see +# +# For the moment, see for this info. +# The documents are still being prepared from material donated by the +# modssl project. +# +# 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. +# + + +# Until documentation is completed, please check http://www.modssl.org/ +# for additional config examples and module docmentation. Directives +# and features of mod_ssl are largely unchanged from the mod_ssl project +# for Apache 1.3. + +# +# When we also provide SSL we have to listen to the +# standard HTTP port (see above) and to the HTTPS port +# +# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two +# Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443" +# +Listen 443 + +## +## SSL Global Context +## +## All SSL configuration in this context applies both to +## the main server and all SSL-enabled virtual hosts. +## + +# +# Some MIME-types for downloading Certificates and CRLs +# +AddType application/x-x509-ca-cert .crt +AddType application/x-pkcs7-crl .crl + +# Pass Phrase Dialog: +# Configure the pass phrase gathering process. +# The filtering dialog program (`builtin' is a internal +# terminal dialog) has to provide the pass phrase on stdout. +SSLPassPhraseDialog builtin + +# Inter-Process Session Cache: +# Configure the SSL Session Cache: First the mechanism +# to use and second the expiring timeout (in seconds). +#SSLSessionCache none +#SSLSessionCache shmht:@exp_runtimedir@/ssl_scache(512000) +#SSLSessionCache shmcb:@exp_runtimedir@/ssl_scache(512000) +SSLSessionCache dbm:@exp_runtimedir@/ssl_scache +SSLSessionCacheTimeout 300 + +# Semaphore: +# Configure the path to the mutual exclusion semaphore the +# SSL engine uses internally for inter-process synchronization. +SSLMutex file:@exp_runtimedir@/ssl_mutex + +# Pseudo Random Number Generator (PRNG): +# Configure one or more sources to seed the PRNG of the +# SSL library. The seed data should be of good random quality. +# WARNING! On some platforms /dev/random blocks if not enough entropy +# is available. This means you then cannot use the /dev/random device +# because it would lead to very long connection times (as long as +# it requires to make more entropy available). But usually those +# platforms additionally provide a /dev/urandom device which doesn't +# block. So, if available, use this one instead. Read the mod_ssl User +# Manual for more details. +SSLRandomSeed startup builtin +SSLRandomSeed connect builtin +#SSLRandomSeed startup file:/dev/random 512 +#SSLRandomSeed startup file:/dev/urandom 512 +#SSLRandomSeed connect file:/dev/random 512 +#SSLRandomSeed connect file:/dev/urandom 512 + +## +## SSL Virtual Host Context +## + + + +# General setup for the virtual host +DocumentRoot "@exp_htdocsdir@" +ServerName www.example.com:443 +ServerAdmin you@example.com +ErrorLog @exp_logfiledir@/error_log +TransferLog @exp_logfiledir@/access_log + +# SSL Engine Switch: +# Enable/Disable SSL for this virtual host. +SSLEngine on + +# SSL Cipher Suite: +# List the ciphers that the client is permitted to negotiate. +# See the mod_ssl documentation for a complete list. +SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL + +# Server Certificate: +# Point SSLCertificateFile at a PEM encoded certificate. If +# the certificate is encrypted, then you will be prompted for a +# pass phrase. Note that a kill -HUP will prompt again. Keep +# in mind that if you have both an RSA and a DSA certificate you +# can configure both in parallel (to also allow the use of DSA +# ciphers, etc.) +SSLCertificateFile @exp_sysconfdir@/ssl.crt/server.crt +#SSLCertificateFile @exp_sysconfdir@/ssl.crt/server-dsa.crt + +# Server Private Key: +# If the key is not combined with the certificate, use this +# directive to point at the key file. Keep in mind that if +# you've both a RSA and a DSA private key you can configure +# both in parallel (to also allow the use of DSA ciphers, etc.) +SSLCertificateKeyFile @exp_sysconfdir@/ssl.key/server.key +#SSLCertificateKeyFile @exp_sysconfdir@/ssl.key/server-dsa.key + +# Server Certificate Chain: +# Point SSLCertificateChainFile at a file containing the +# concatenation of PEM encoded CA certificates which form the +# certificate chain for the server certificate. Alternatively +# the referenced file can be the same as SSLCertificateFile +# when the CA certificates are directly appended to the server +# certificate for convinience. +#SSLCertificateChainFile @exp_sysconfdir@/ssl.crt/ca.crt + +# Certificate Authority (CA): +# Set the CA certificate verification path where to find CA +# certificates for client authentication or alternatively one +# huge file containing all of them (file must be PEM encoded) +# Note: Inside SSLCACertificatePath you need hash symlinks +# to point to the certificate files. Use the provided +# Makefile to update the hash symlinks after changes. +#SSLCACertificatePath @exp_sysconfdir@/ssl.crt +#SSLCACertificateFile @exp_sysconfdir@/ssl.crt/ca-bundle.crt + +# Certificate Revocation Lists (CRL): +# Set the CA revocation path where to find CA CRLs for client +# authentication or alternatively one huge file containing all +# of them (file must be PEM encoded) +# Note: Inside SSLCARevocationPath you need hash symlinks +# to point to the certificate files. Use the provided +# Makefile to update the hash symlinks after changes. +#SSLCARevocationPath @exp_sysconfdir@/ssl.crl +#SSLCARevocationFile @exp_sysconfdir@/ssl.crl/ca-bundle.crl + +# Client Authentication (Type): +# Client certificate verification type and depth. Types are +# none, optional, require and optional_no_ca. Depth is a +# number which specifies how deeply to verify the certificate +# issuer chain before deciding the certificate is not valid. +#SSLVerifyClient require +#SSLVerifyDepth 10 + +# Access Control: +# With SSLRequire you can do per-directory access control based +# on arbitrary complex boolean expressions containing server +# variable checks and other lookup directives. The syntax is a +# mixture between C and Perl. See the mod_ssl documentation +# for more details. +# +#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ +# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \ +# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \ +# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \ +# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \ +# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/ +# + +# SSL Engine Options: +# Set various options for the SSL engine. +# o FakeBasicAuth: +# Translate the client X.509 into a Basic Authorisation. This means that +# the standard Auth/DBMAuth methods can be used for access control. The +# user name is the `one line' version of the client's X.509 certificate. +# Note that no password is obtained from the user. Every entry in the user +# file needs this password: `xxj31ZMTZzkVA'. +# o ExportCertData: +# This exports two additional environment variables: SSL_CLIENT_CERT and +# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the +# server (always existing) and the client (only existing when client +# authentication is used). This can be used to import the certificates +# into CGI scripts. +# o StdEnvVars: +# This exports the standard SSL/TLS related `SSL_*' environment variables. +# Per default this exportation is switched off for performance reasons, +# because the extraction step is an expensive operation and is usually +# useless for serving static content. So one usually enables the +# exportation for CGI and SSI requests only. +# o CompatEnvVars: +# This exports obsolete environment variables for backward compatibility +# to Apache-SSL 1.x, mod_ssl 2.0.x, Sioux 1.0 and Stronghold 2.x. Use this +# to provide compatibility to existing CGI scripts. +# o StrictRequire: +# This denies access when "SSLRequireSSL" or "SSLRequire" applied even +# under a "Satisfy any" situation, i.e. when it applies access is denied +# and no other module can change it. +# o OptRenegotiate: +# This enables optimized SSL connection renegotiation handling when SSL +# directives are used in per-directory context. +#SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + +# SSL Protocol Adjustments: +# The safe and default but still SSL/TLS standard compliant shutdown +# approach is that mod_ssl sends the close notify alert but doesn't wait for +# the close notify alert from client. When you need a different shutdown +# approach you can use one of the following variables: +# o ssl-unclean-shutdown: +# This forces an unclean shutdown when the connection is closed, i.e. no +# SSL close notify alert is send or allowed to received. This violates +# the SSL/TLS standard but is needed for some brain-dead browsers. Use +# this when you receive I/O errors because of the standard approach where +# mod_ssl sends the close notify alert. +# o ssl-accurate-shutdown: +# This forces an accurate shutdown when the connection is closed, i.e. a +# SSL close notify alert is send and mod_ssl waits for the close notify +# alert of the client. This is 100% SSL/TLS standard compliant, but in +# practice often causes hanging connections with brain-dead browsers. Use +# this only for browsers where you know that their SSL implementation +# works correctly. +# Notice: Most problems of broken clients are also related to the HTTP +# keep-alive facility, so you usually additionally want to disable +# keep-alive for those clients, too. Use variable "nokeepalive" for this. +# Similarly, one has to force some clients to use HTTP/1.0 to workaround +# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and +# "force-response-1.0" for this. +SetEnvIf User-Agent ".*MSIE.*" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + +# Per-Server Logging: +# The home of a custom SSL log file. Use this when you want a +# compact non-error SSL logfile on a virtual host basis. +CustomLog @exp_logfiledir@/ssl_request_log \ + "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" + + + + + diff --git a/docs/manual/misc/relevant_standards.html b/docs/manual/misc/relevant_standards.html new file mode 100644 index 00000000000..66aeada7de4 --- /dev/null +++ b/docs/manual/misc/relevant_standards.html @@ -0,0 +1,3 @@ +URI: relevant_standards.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 diff --git a/docs/manual/misc/relevant_standards.html.en b/docs/manual/misc/relevant_standards.html.en new file mode 100644 index 00000000000..99421e383d3 --- /dev/null +++ b/docs/manual/misc/relevant_standards.html.en @@ -0,0 +1,197 @@ + + + +Relevant Standards - Apache HTTP Server + + + + + +
<-
+

Relevant Standards

+
+

Available Languages:  en 

+
+ +

This page documents all the relevant standards that the + Apache HTTP Server follows, along with brief descriptions.

+ +

In addition to the information listed below, the following resources + should be consulted:

+ + + +

Notice

+

This document is not yet complete.

+
+ +
+ +
top
+
+

HTTP Recommendations

+ +

Regardless of what modules are compiled and used, Apache as a + basic web server complies with the following IETF recommendations:

+ +
+
RFC 1945 + (Informational)
+ +
The Hypertext Transfer Protocol (HTTP) is an application-level + protocol with the lightness and speed necessary for distributed, + collaborative, hypermedia information systems. This documents + HTTP/1.0.
+ +
RFC 2616 + (Standards Track)
+ +
The Hypertext Transfer Protocol (HTTP) is an + application-level protocol for distributed, collaborative, + hypermedia information systems. This documents HTTP/1.1.
+ +
RFC 2396 + (Standards Track)
+ +
A Uniform Resource Identifier (URI) is a compact string of + characters for identifying an abstract or physical resource.
+
+ +
top
+
+

HTML Recommendations

+ +

Regarding the Hypertext Markup Language, Apache complies with + the following IETF and W3C recommendations:

+ +
+
RFC 2854 + (Informational)
+ +
This document summarizes the history of HTML development, + and defines the "text/html" MIME type by pointing to the relevant + W3C recommendations.
+ +
HTML 4.01 Specification + (Errata) +
+ +
This specification defines the HyperText Markup Language (HTML), + the publishing language of the World Wide Web. This specification + defines HTML 4.01, which is a subversion of HTML 4.
+ +
HTML 3.2 Reference + Specification
+ +
The HyperText Markup Language (HTML) is a simple markup language + used to create hypertext documents that are portable from one + platform to another. HTML documents are SGML documents.
+ +
XHTML^(TM) 1.1 - + Module-based XHTML + (Errata) +
+ +
This Recommendation defines a new XHTML document type + that is based upon the module framework and modules defined in + Modularization of XHTML.
+ +
XHTML^(TM) 1.0 The + Extensible HyperText Markup Language (Second Edition) + (Errata) +
+ +
This specification defines the Second Edition of XHTML 1.0, + a reformulation of HTML 4 as an XML 1.0 application, and three + DTDs corresponding to the ones defined by HTML 4.
+
+ +
top
+
+

Authentication

+ +

Concerning the different methods of authentication, Apache + follows the following IETF recommendations:

+ +
+
RFC 2617 + (Draft standard)
+ +
"HTTP/1.0", includes the specification for a Basic + Access Authentication scheme.
+ +
+ +
top
+
+

Language/Country Codes

+ +

The following links document ISO and other language and country + code information:

+ +
+
ISO 639-2
+ +
ISO 639 provides two sets of language codes, one as a two-letter + code set (639-1) and another as a three-letter code set (this part + of ISO 639) for the representation of names of languages.
+ +
+ ISO 3166-1
+ +
These pages document the country names (official short names + in English) in alphabetical order as given in ISO 3166-1 and the + corresponding ISO 3166-1-alpha-2 code elements.
+ +
BCP 47 + (Best Current Practice), + RFC 3066
+ +
This document describes a language tag for use in cases where + it is desired to indicate the language used in an information + object, how to register values for use in this language tag, + and a construct for matching such language tags.
+ +
RFC 3282 + (Standards Track)
+ +
This document defines a "Content-language:" header, for use in + cases where one desires to indicate the language of something that + has RFC 822-like headers, like MIME body parts or Web documents, + and an "Accept-Language:" header for use in cases where one wishes + to indicate one's preferences with regard to language.
+
+ +
+
+

Available Languages:  en 

+
+ \ No newline at end of file diff --git a/docs/manual/misc/relevant_standards.xml b/docs/manual/misc/relevant_standards.xml new file mode 100644 index 00000000000..cc57d4af950 --- /dev/null +++ b/docs/manual/misc/relevant_standards.xml @@ -0,0 +1,174 @@ + + + + + + Miscellaneous Documentation + + Relevant Standards + + +

This page documents all the relevant standards that the + Apache HTTP Server follows, along with brief descriptions.

+ +

In addition to the information listed below, the following resources + should be consulted:

+ + + + Notice +

This document is not yet complete.

+
+ +
+ +
HTTP Recommendations + +

Regardless of what modules are compiled and used, Apache as a + basic web server complies with the following IETF recommendations:

+ +
+
RFC 1945 + (Informational)
+ +
The Hypertext Transfer Protocol (HTTP) is an application-level + protocol with the lightness and speed necessary for distributed, + collaborative, hypermedia information systems. This documents + HTTP/1.0.
+ +
RFC 2616 + (Standards Track)
+ +
The Hypertext Transfer Protocol (HTTP) is an + application-level protocol for distributed, collaborative, + hypermedia information systems. This documents HTTP/1.1.
+ +
RFC 2396 + (Standards Track)
+ +
A Uniform Resource Identifier (URI) is a compact string of + characters for identifying an abstract or physical resource.
+
+ +
+ +
HTML Recommendations + +

Regarding the Hypertext Markup Language, Apache complies with + the following IETF and W3C recommendations:

+ +
+
RFC 2854 + (Informational)
+ +
This document summarizes the history of HTML development, + and defines the "text/html" MIME type by pointing to the relevant + W3C recommendations.
+ +
HTML 4.01 Specification + (Errata) +
+ +
This specification defines the HyperText Markup Language (HTML), + the publishing language of the World Wide Web. This specification + defines HTML 4.01, which is a subversion of HTML 4.
+ +
HTML 3.2 Reference + Specification
+ +
The HyperText Markup Language (HTML) is a simple markup language + used to create hypertext documents that are portable from one + platform to another. HTML documents are SGML documents.
+ +
XHTML^(TM) 1.1 - + Module-based XHTML + (Errata) +
+ +
This Recommendation defines a new XHTML document type + that is based upon the module framework and modules defined in + Modularization of XHTML.
+ +
XHTML^(TM) 1.0 The + Extensible HyperText Markup Language (Second Edition) + (Errata) +
+ +
This specification defines the Second Edition of XHTML 1.0, + a reformulation of HTML 4 as an XML 1.0 application, and three + DTDs corresponding to the ones defined by HTML 4.
+
+ +
+ +
Authentication + +

Concerning the different methods of authentication, Apache + follows the following IETF recommendations:

+ +
+
RFC 2617 + (Draft standard)
+ +
"HTTP/1.0", includes the specification for a Basic + Access Authentication scheme.
+ +
+ +
+ +
Language/Country Codes + +

The following links document ISO and other language and country + code information:

+ +
+
ISO 639-2
+ +
ISO 639 provides two sets of language codes, one as a two-letter + code set (639-1) and another as a three-letter code set (this part + of ISO 639) for the representation of names of languages.
+ +
+ ISO 3166-1
+ +
These pages document the country names (official short names + in English) in alphabetical order as given in ISO 3166-1 and the + corresponding ISO 3166-1-alpha-2 code elements.
+ +
BCP 47 + (Best Current Practice), + RFC 3066
+ +
This document describes a language tag for use in cases where + it is desired to indicate the language used in an information + object, how to register values for use in this language tag, + and a construct for matching such language tags.
+ +
RFC 3282 + (Standards Track)
+ +
This document defines a "Content-language:" header, for use in + cases where one desires to indicate the language of something that + has RFC 822-like headers, like MIME body parts or Web documents, + and an "Accept-Language:" header for use in cases where one wishes + to indicate one's preferences with regard to language.
+
+ +
+ +
diff --git a/docs/manual/misc/relevant_standards.xml.meta b/docs/manual/misc/relevant_standards.xml.meta new file mode 100644 index 00000000000..77d8a06c0d8 --- /dev/null +++ b/docs/manual/misc/relevant_standards.xml.meta @@ -0,0 +1,11 @@ + + + + relevant_standards + /misc/ + .. + + + en + + diff --git a/docs/manual/vhosts/name-based.xml.ja b/docs/manual/vhosts/name-based.xml.ja new file mode 100644 index 00000000000..7445be8b821 --- /dev/null +++ b/docs/manual/vhosts/name-based.xml.ja @@ -0,0 +1,270 @@ + + + + + + +バーチャルホスト +名前ベースのバーチャルホスト + + + +

この文書では名前ベースのバーチャルホストをどんなとき、 + どうやって使うかを説明します。

+ +
+ +ネームベースのバーチャルホスト +バーチャルホストのマッチングについての詳細 +大量のバーチャルホストの動的な設定 +バーチャルホストの一般的な設定例 +ServerPath 設定例 + +
名前ベースと IP ベースのバーチャルホストの比較 + +

IP ベースのバーチャルホストでは、応答する + バーチャルホストへのコネクションを決定するために IP + アドレスを使用します。ですから、それぞれのホストに個々に IP + アドレスが必要になります。これに対して名前ベースのバーチャルホストでは、 + クライアントが HTTP ヘッダの一部としてホスト名を告げる、 + ということに依存します。この技術で同一 IP + アドレスを異なる多数のホストで共有しています。

+ +

名前ベースのバーチャルホストは通常単純で、それぞれのホスト名と + それに対応する正確な IP アドレスを DNS で設定し、異なる + ホスト名を区別するように Apache HTTP サーバを設定するだけです。 + さらに、名前ベースのバーチャルホストは不足する IP + アドレスの需要を緩和します。したがって、IP ベースのバーチャルホストを + 選択すべき特定の理由がなければ名前ベースのバーチャルホストを使うべきです。 + IP ベースのバーチャルホストを使用することを考慮する理由として、

+ +
    +
  • 名前ベースのバーチャルホストに対応していない古いクライアントがある + 名前ベースのバーチャルホストが働くためには、クライアントは + HTTP ホストヘッダを送ってこなければなりません。 + これは HTTP/1.1 の仕様で要求されていて、すべての現代的な + HTTP/1.0 ブラウザでも拡張として実装されています。 + とても古いクライアントをサポートしつつ、名前ベースの + バーチャルホストを行いたい場合は、この文書の最後の方に + 書かれている解決策になるかもしれない方法を見てください。
  • + +
  • 名前ベースのバーチャルホストは SSL プロトコルの特徴により、 + SSL セキュアサーバには使えません。
  • + +
  • オペレーティングシステムやネットワーク装置のなかには、 + 別の IP アドレス上でない場合、複数のホストを別扱いできないような + 帯域管理の方法を実装しているものがあります。
  • +
+ +
+ +
名前ベースのバーチャルホストを利用する + + + + core + + + + DocumentRoot + NameVirtualHost + ServerAlias + ServerName + ServerPath + VirtualHost + VirtualHost + + + +

名前ベースのバーチャルホストを使うには、そのホストへの + リクエストを受け付けるサーバの IP アドレス (もしかしたらポートも) + を指定する必要があります。 + これは NameVirtualHost + ディレクティブで設定します。通常、NameVirtualHost で + * の属性を使ってサーバの全ての IP アドレスを使います。 + NameVirtualHost ディレクティブで + IP アドレスを書いても、 + 自動的にサーバがその IP アドレスをリッスンするということはないことに + 注意してください。詳細は「Apache の使うアドレスと + ポートを設定する」を読んでください。さらに、ここで指定された + IP アドレスは全てサーバのネットワークインターフェースと関連付けられて + いなければなりません。

+ +

次は、扱うホストそれぞれに対して VirtualHost ブロックを + 作成してください。VirtualHost + ディレクティブの引数は NameVirtualHost + ディレクティブの引数と同じにしてください (すなわち、IP アドレスか、全てのアドレスを意味する + *)。それぞれの VirtualHost + ディレクティブの中には、最低限、どのホストが扱われるかを示す ServerName ディレクティブと、 + そのホスト用のコンテンツがファイルシステム上のどこにあるかを示す + DocumentRoot ディレクティブを + 書く必要があります。

+ + メインホストはなくなります +

既にあるウェブサーバにバーチャルホストを追加する場合、 + 既存のウェブサーバに対しても VirtualHost + ブロックを作らなければなりません。このバーチャルホストの + ServerName と + DocumentRoot + は、グローバルな ServerName と + DocumentRoot + と同じものにします。また、このバーチャルホストを設定ファイルの中で + 先頭に置いて、デフォルトホストとして動作するようにします。

+
+ +

たとえば、www.domain.tld を動かしていて、 + さらにバーチャルホスト www.otherdomain.tld + を追加するとしましょう。このバーチャルホストは同一 IP を指しているとします。 + そのような場合は、httpd.conf + に以下のようなコードを追加するだけです

+ + + NameVirtualHost *
+
+ <VirtualHost *>
+ + ServerName www.domain.tld
+ DocumentRoot /www/domain
+
+ </VirtualHost>
+
+ <VirtualHost *>
+ + ServerName www.otherdomain.tld
+ DocumentRoot /www/otherdomain
+
+ </VirtualHost>
+
+ +

NameVirtualHost 及び + VirtualHost のどちらの場合も、 + * の部分には明示的に IP アドレスを指定することができます。

+ +

複数の名前でサーバアクセスができるようにしたいことも多いでしょう。 + このようなことは、ServerAlias ディレクティブを VirtualHost + セクションに記述することで実現できます。 + 例えば上記の VirtualHost の例であれば、 + 次のように一覧に挙げられた名前が、 + ユーザが同一のウェブサイトとして目にして使用できるサーバ名である、 + と ServerAlias + ディレクティブで指定できます。

+ + + ServerAlias domain.tld *.domain.tld + + +

domain.tld ドメインへの全てのホストへのリクエストは + www.domain.tld のバーチャルホストが処理します。 + 名前をマッチさせるために、ワイルドカード文字 * や ? + を使用することもできます。もちろん思いつきの名前を作って、 + ServerName や + ServerAlias + にその名前を書くといったことはできません。まずは、 + これらの名前が サーバに付けられた IP アドレスにマップされるように + DNS サーバを適切に設定しなければなりません。

+ +

最後に、VirtualHost コンテナの中に + 他のディレクティブを書くことで、バーチャルホストの設定を細かく調整 + することができます。 + ほとんどのディレクティブはこれらのコンテナに設置することができて、 + 変更点はそのバーチャルホストに対してのみ有効になります。 + どのディレクティブを書くことができるかは、ディレクティブの コンテキスト を + 調べてください。主サーバコンテキスト + (VirtualHost + コンテナの外) の設定用ディレクティブはバーチャルホストでの設定で + 上書きされない場合のみ使用されます。

+ +

リクエストが来ると、サーバはまず最初に NameVirtualHost + にマッチする IP アドレスかどうかをチェックします。マッチすれば + マッチした IP アドレスの VirtualHost + のそれぞれのセクションの中から + ServerName か + ServerAlias + に要求されたホスト名があるか探します。 + 見つかればそのサーバ用の設定を使います。マッチするバーチャルホスト + が見つからなければ、マッチした IP アドレスの + リストの最初にあるバーチャルホスト が使われます。

+ +

結果として、リストの最初のバーチャルホストが デフォルト の + バーチャルホストになります。IP アドレスが NameVirtualHost + ディレクティブにマッチした場合は、メインのサーバ の + DocumentRoot + は決して使われません + どのバーチャルホストにもマッチしないリクエストに対して、 + 特別な設定をしたいのであれば、設定ファイル中の最初の + <VirtualHost> コンテナにそれを記述してください。

+ +
+ +
古いブラウザとの互換性 + +

以前述べたように、名前ベースのバーチャルホストが正しく動作する + ために必要な情報を送ってこないクライアントが依然として存在しています。 + そのようなクライアントに対しては、該当する IP アドレスについて、 + 一番最初に設定されているバーチャルホスト + (プライマリの名前ベースのバーチャルホスト) + からページが送り返されます。

+ + どのぐらい古いの ? +

「古い」と表現している場合、本当に古いことを意味して使っています。 + 不幸にして今現在でもこのような古いブラウザに遭遇することがあります。 + 現在のブラウザは全て、名前ベースのバーチャルホストに必要な + Host ヘッダを送ります。

+
+ +

ServerPath + ディレクティブで対処が可能です。ちょっと不格好ですけれども。

+ +

設定例

+ + + NameVirtualHost 111.22.33.44
+
+ <VirtualHost 111.22.33.44>
+ + ServerName www.domain.tld
+ ServerPath /domain
+ DocumentRoot /web/domain
+
+ </VirtualHost>
+
+ +

この例にはどういう意味があるでしょうか? これは + "/domain" で始まる URI へのリクエストはすべて、 + バーチャルホスト www.domain.tld で処理される、 + という意味です。つまり、すべてのクライアントで + http://www.domain.tld/domain/ でアクセスできるページが、 + Host: ヘッダを送ってくるクライアントであれば + http://www.domain.tld/ としてもアクセスできる、 + という意味です。

+ +

これが動作するようにするには、 + プライマリのバーチャルホストのページに + http://www.domain.tld/domain/ へのリンクを設置します。 + そして、バーチャルホストのページでは、純粋な相対リンク (例: + "file.html" や "../icons/image.gif")、 + あるいは /domain/ で始まるリンク (例: + "http://www.domain.tld/domain/misc/file.html" や + "/domain/misc/file.html") だけを設置します。

+ +

これには、幾分かの規律が必要となりますが、 + このようなガイドラインを忠実に守ることにより、たいていの場合、 + すべてのブラウザで ― 新しいブラウザでも古いものでも ― + 作成したページが見えるということを保証します。

+ +
+
+ + diff --git a/modules/generators/mod_status.h b/modules/generators/mod_status.h new file mode 100644 index 00000000000..c828efbad7b --- /dev/null +++ b/modules/generators/mod_status.h @@ -0,0 +1,92 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * 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, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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 Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef MOD_STATUS_H +#define MOD_STATUS_H + +#include "ap_config.h" +#include "httpd.h" + +#define AP_STATUS_SHORT (0x1) /* short, non-HTML report requested */ +#define AP_STATUS_NOTABLE (0x2) /* HTML report without tables */ +#define AP_STATUS_EXTENDED (0x4) /* detailed report */ + +#if !defined(WIN32) +#define STATUS_DECLARE(type) type +#define STATUS_DECLARE_NONSTD(type) type +#define STATUS_DECLARE_DATA +#elif defined(STATUS_DECLARE_STATIC) +#define STATUS_DECLARE(type) type __stdcall +#define STATUS_DECLARE_NONSTD(type) type +#define STATUS_DECLARE_DATA +#elif defined(STATUS_DECLARE_EXPORT) +#define STATUS_DECLARE(type) __declspec(dllexport) type __stdcall +#define STATUS_DECLARE_NONSTD(type) __declspec(dllexport) type +#define STATUS_DECLARE_DATA __declspec(dllexport) +#else +#define STATUS_DECLARE(type) __declspec(dllimport) type __stdcall +#define STATUS_DECLARE_NONSTD(type) __declspec(dllimport) type +#define STATUS_DECLARE_DATA __declspec(dllimport) +#endif + +/* Optional hooks which can insert extra content into the mod_status + * output. FLAGS will be set to the bitwise OR of any of the + * AP_STATUS_* flags. + * + * Implementations of this hook should generate content using + * functions in the ap_rputs/ap_rprintf family; each hook should + * return OK or DECLINED. */ +APR_DECLARE_EXTERNAL_HOOK(ap, STATUS, int, status_hook, + (request_rec *r, int flags)) +#endif -- 2.47.2