From 80db94fff6a9620fb469ee911347ed973e3f7735 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Tue, 27 Dec 2011 19:42:03 +0100 Subject: Upstream tarball 2.2.3 --- docs/manual/howto/access.html | 3 + docs/manual/howto/access.html.en | 189 +++++++++ docs/manual/howto/auth.html | 11 + docs/manual/howto/auth.html.en | 391 +++++++++++++++++++ docs/manual/howto/auth.html.ja.euc-jp | 386 +++++++++++++++++++ docs/manual/howto/auth.html.ko.euc-kr | 323 ++++++++++++++++ docs/manual/howto/cgi.html | 11 + docs/manual/howto/cgi.html.en | 555 +++++++++++++++++++++++++++ docs/manual/howto/cgi.html.ja.euc-jp | 549 ++++++++++++++++++++++++++ docs/manual/howto/cgi.html.ko.euc-kr | 503 ++++++++++++++++++++++++ docs/manual/howto/htaccess.html | 15 + docs/manual/howto/htaccess.html.en | 385 +++++++++++++++++++ docs/manual/howto/htaccess.html.ja.euc-jp | 383 ++++++++++++++++++ docs/manual/howto/htaccess.html.ko.euc-kr | 333 ++++++++++++++++ docs/manual/howto/htaccess.html.pt-br | 375 ++++++++++++++++++ docs/manual/howto/index.html | 11 + docs/manual/howto/index.html.en | 117 ++++++ docs/manual/howto/index.html.ja.euc-jp | 104 +++++ docs/manual/howto/index.html.ko.euc-kr | 109 ++++++ docs/manual/howto/public_html.html | 11 + docs/manual/howto/public_html.html.en | 161 ++++++++ docs/manual/howto/public_html.html.ja.euc-jp | 155 ++++++++ docs/manual/howto/public_html.html.ko.euc-kr | 156 ++++++++ docs/manual/howto/ssi.html | 11 + docs/manual/howto/ssi.html.en | 486 +++++++++++++++++++++++ docs/manual/howto/ssi.html.ja.euc-jp | 481 +++++++++++++++++++++++ docs/manual/howto/ssi.html.ko.euc-kr | 426 ++++++++++++++++++++ 27 files changed, 6640 insertions(+) create mode 100644 docs/manual/howto/access.html create mode 100644 docs/manual/howto/access.html.en create mode 100644 docs/manual/howto/auth.html create mode 100644 docs/manual/howto/auth.html.en create mode 100644 docs/manual/howto/auth.html.ja.euc-jp create mode 100644 docs/manual/howto/auth.html.ko.euc-kr create mode 100644 docs/manual/howto/cgi.html create mode 100644 docs/manual/howto/cgi.html.en create mode 100644 docs/manual/howto/cgi.html.ja.euc-jp create mode 100644 docs/manual/howto/cgi.html.ko.euc-kr create mode 100644 docs/manual/howto/htaccess.html create mode 100644 docs/manual/howto/htaccess.html.en create mode 100644 docs/manual/howto/htaccess.html.ja.euc-jp create mode 100644 docs/manual/howto/htaccess.html.ko.euc-kr create mode 100644 docs/manual/howto/htaccess.html.pt-br create mode 100644 docs/manual/howto/index.html create mode 100644 docs/manual/howto/index.html.en create mode 100644 docs/manual/howto/index.html.ja.euc-jp create mode 100644 docs/manual/howto/index.html.ko.euc-kr create mode 100644 docs/manual/howto/public_html.html create mode 100644 docs/manual/howto/public_html.html.en create mode 100644 docs/manual/howto/public_html.html.ja.euc-jp create mode 100644 docs/manual/howto/public_html.html.ko.euc-kr create mode 100644 docs/manual/howto/ssi.html create mode 100644 docs/manual/howto/ssi.html.en create mode 100644 docs/manual/howto/ssi.html.ja.euc-jp create mode 100644 docs/manual/howto/ssi.html.ko.euc-kr (limited to 'docs/manual/howto') diff --git a/docs/manual/howto/access.html b/docs/manual/howto/access.html new file mode 100644 index 00000000..e4762a1e --- /dev/null +++ b/docs/manual/howto/access.html @@ -0,0 +1,3 @@ +URI: access.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 diff --git a/docs/manual/howto/access.html.en b/docs/manual/howto/access.html.en new file mode 100644 index 00000000..8b94ac9b --- /dev/null +++ b/docs/manual/howto/access.html.en @@ -0,0 +1,189 @@ + + + +Access Control - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

Access Control

+
+

Available Languages:  en 

+
+ +

Access control refers to any means of controlling access to any + resource. This is separate from authentication and authorization.

+
+ +
top
+
+

Related Modules and Directives

+ +

Access control can be done by several different modules. The most +important of these is mod_authz_host. Other modules +discussed in this document include mod_setenvif and +mod_rewrite.

+ +
top
+
+

Access control by host

+

+ If you wish to restrict access to portions of your site based on the + host address of your visitors, this is most easily done using + mod_authz_host. +

+ +

The Allow and + Deny directives let + you allow and deny access based on the host name, or host + address, of the machine requesting a document. The + Order directive goes + hand-in-hand with these two, and tells Apache in which order to + apply the filters.

+ +

The usage of these directives is:

+ +

+ Allow from address +

+ +

where address is an IP address (or a partial IP + address) or a fully qualified domain name (or a partial domain + name); you may provide multiple addresses or domain names, if + desired.

+ +

For example, if you have someone spamming your message + board, and you want to keep them out, you could do the + following:

+ +

+ Deny from 10.252.46.165 +

+ +

Visitors coming from that address will not be able to see + the content covered by this directive. If, instead, you have a + machine name, rather than an IP address, you can use that.

+ +

+ Deny from host.example.com +

+ +

And, if you'd like to block access from an entire domain, + you can specify just part of an address or domain name:

+ +

+ Deny from 192.168.205
+ Deny from phishers.example.com moreidiots.example
+ Deny from ke +

+ +

Using Order will let you + be sure that you are actually restricting things to the group that you want + to let in, by combining a Deny and an Allow directive:

+ +

+ Order deny,allow
+ Deny from all
+ Allow from dev.example.com +

+ +

Listing just the Allow + directive would not do what you want, because it will let folks from that + host in, in addition to letting everyone in. What you want is to let + only those folks in.

+
top
+
+

Access control by environment variable

+ +

+ mod_authz_host, in conjunction with + mod_setenvif, can be used to restrict access to + your website based on the value of arbitrary environment variables. + This is done with the Allow from env= and Deny + from env= syntax. +

+ +

+ SetEnvIf User-Agent BadBot GoAway=1
+ Order allow,deny
+ Allow from all
+ Deny from env=GoAway +

+ +

Warning:

+

Access control by User-Agent is an unreliable technique, + since the User-Agent header can be set to anything at all, + at the whim of the end user.

+
+ +

+ In the above example, the environment variable GoAway + is set to 1 if the User-Agent matches the + string BadBot. Then we deny access for any request when + this variable is set. This blocks that particular user agent from + the site. +

+ +

An environment variable test can be negated using the =! + syntax:

+ +

+ Allow from env=!GoAway +

+ +
top
+
+

Access control with mod_rewrite

+ +

The [F] RewriteRule flag causes a 403 Forbidden +response to be sent. Using this, you can deny access to a resource based +on arbitrary criteria.

+ +

For example, if you wish to block access to a resource between 8pm +and 6am, you can do this using mod_rewrite.

+ +

+RewriteEngine On
+RewriteCond %{TIME_HOUR} > 20 [OR]
+RewriteCond %{TIME_HOUR} < 07
+RewriteRule ^/fridge - [F] +

+ +

This will return a 403 Forbidden response for any request after 8pm +or before 7am. This technique can be used for any criteria that you wish +to check. You can also redirect, or otherwise rewrite these requests, if +that approach is preferred.

+ +
top
+
+

More information

+

You should also read the documentation for + mod_auth_basic and mod_authz_host which + contain some more information about how this all works. + mod_authn_alias can also help in simplifying certain + authentication configurations.

+ +

See the Authentication and Authorization + howto.

+
+
+

Available Languages:  en 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/auth.html b/docs/manual/howto/auth.html new file mode 100644 index 00000000..fddd9973 --- /dev/null +++ b/docs/manual/howto/auth.html @@ -0,0 +1,11 @@ +URI: auth.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: auth.html.ja.euc-jp +Content-Language: ja +Content-type: text/html; charset=EUC-JP + +URI: auth.html.ko.euc-kr +Content-Language: ko +Content-type: text/html; charset=EUC-KR diff --git a/docs/manual/howto/auth.html.en b/docs/manual/howto/auth.html.en new file mode 100644 index 00000000..491abd15 --- /dev/null +++ b/docs/manual/howto/auth.html.en @@ -0,0 +1,391 @@ + + + +Authentication, Authorization and Access Control - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

Authentication, Authorization and Access Control

+
+

Available Languages:  en  | + ja  | + ko 

+
+ +

Authentication is any process by which you verify that + someone is who they claim they are. Authorization is any + process by which someone is allowed to be where they want to + go, or to have information that they want to have.

+
+ +
top
+
+

Related Modules and Directives

+ +

There are three types of modules involved in the authentication and +authorization process. You will usually need to choose at least one +module from each group.

+ + + +

The module mod_authnz_ldap is both an + authentication and authorization provider. The module + mod_authn_alias is not an authentication provider + in itself, but allows other authentication providers to be + configured in a flexible manner.

+ +

The module mod_authz_host provides authorization + and access control based on hostname, IP address or characteristics + of the request, but is not part of the authentication provider + system.

+ +

You probably also want to take a look at the Access Control howto, which discusses the + various ways to control access to your server.

+ +
top
+
+

Introduction

+

If you have information on your web site that is sensitive + or intended for only a small group of people, the techniques in + this article will help you make sure that the people that see + those pages are the people that you wanted to see them.

+ +

This article covers the "standard" way of protecting parts + of your web site that most of you are going to use.

+ +

Note:

+

If your data really needs to be secure, consider using + mod_ssl in addition to any authentication.

+
+
top
+
+

The Prerequisites

+

The directives discussed in this article will need to go + either in your main server configuration file (typically in a + <Directory> section), or + in per-directory configuration files (.htaccess files).

+ +

If you plan to use .htaccess files, you will + need to have a server configuration that permits putting + authentication directives in these files. This is done with the + AllowOverride directive, which + specifies which directives, if any, may be put in per-directory + configuration files.

+ +

Since we're talking here about authentication, you will need + an AllowOverride directive like the + following:

+ +

+ AllowOverride AuthConfig +

+ +

Or, if you are just going to put the directives directly in + your main server configuration file, you will of course need to + have write permission to that file.

+ +

And you'll need to know a little bit about the directory + structure of your server, in order to know where some files are + kept. This should not be terribly difficult, and I'll try to + make this clear when we come to that point.

+
top
+
+

Getting it working

+

Here's the basics of password protecting a directory on your + server.

+ +

First, you need to create a password file. Exactly how you do + this will vary depending on what authentication provider you have + chosen. More on that later. To start with, we'll use a text password + file.

+ +

This file should be + placed somewhere not accessible from the web. This is so that + folks cannot download the password file. For example, if your + documents are served out of /usr/local/apache/htdocs you + might want to put the password file(s) in + /usr/local/apache/passwd.

+ +

To create the file, use the htpasswd utility that + came with Apache. This will be located in the bin directory + of wherever you installed Apache. If you have installed Apache from + a third-party package, it may be in your execution path.

+ +

To create the file, type:

+ +

+ htpasswd -c /usr/local/apache/passwd/passwords rbowen +

+ +

htpasswd will ask you for the password, and + then ask you to type it again to confirm it:

+ +

+ # htpasswd -c /usr/local/apache/passwd/passwords rbowen
+ New password: mypassword
+ Re-type new password: mypassword
+ Adding password for user rbowen +

+ +

If htpasswd is not in your path, of course + you'll have to type the full path to the file to get it to run. + With a default installation, it's located at + /usr/local/apache2/bin/htpasswd

+ +

Next, you'll need to configure the server to request a + password and tell the server which users are allowed access. + You can do this either by editing the httpd.conf + file or using an .htaccess file. For example, if + you wish to protect the directory + /usr/local/apache/htdocs/secret, you can use the + following directives, either placed in the file + /usr/local/apache/htdocs/secret/.htaccess, or + placed in httpd.conf inside a <Directory + /usr/local/apache/apache/htdocs/secret> section.

+ +

+ AuthType Basic
+ AuthName "Restricted Files"
+ # (Following line optional)
+ AuthBasicProvider file
+ AuthUserFile /usr/local/apache/passwd/passwords
+ Require user rbowen +

+ +

Let's examine each of those directives individually. The AuthType directive selects + that method that is used to authenticate the user. The most + common method is Basic, and this is the method + implemented by mod_auth_basic. It is important to be aware, + however, that Basic authentication sends the password from the client to + the server unencrypted. This method should therefore not be used for + highly sensitive data, unless accompanied by mod_ssl. + Apache supports one other authentication method: + AuthType Digest. This method is implemented by mod_auth_digest and is much more secure. Most recent + browsers support Digest authentication.

+ +

The AuthName directive sets + the Realm to be used in the authentication. The realm serves + two major functions. First, the client often presents this information to + the user as part of the password dialog box. Second, it is used by the + client to determine what password to send for a given authenticated + area.

+ +

So, for example, once a client has authenticated in the + "Restricted Files" area, it will automatically + retry the same password for any area on the same server that is + marked with the "Restricted Files" Realm. + Therefore, you can prevent a user from being prompted more than + once for a password by letting multiple restricted areas share + the same realm. Of course, for security reasons, the client + will always need to ask again for the password whenever the + hostname of the server changes.

+ +

The AuthBasicProvider is, + in this case, optional, since file is the default value + for this directive. You'll need to use this directive if you are + choosing a different source for authentication, such as + mod_authn_dbm or mod_authn_dbd.

+ +

The AuthUserFile + directive sets the path to the password file that we just + created with htpasswd. If you have a large number + of users, it can be quite slow to search through a plain text + file to authenticate the user on each request. Apache also has + the ability to store user information in fast database files. + The mod_authn_dbm module provides the AuthDBMUserFile directive. These + files can be created and manipulated with the dbmmanage program. Many + other types of authentication options are available from third + party modules in the Apache Modules + Database.

+ +

Finally, the Require + directive provides the authorization part of the process by + setting the user that is allowed to access this region of the + server. In the next section, we discuss various ways to use the + Require directive.

+
top
+
+

Letting more than one +person in

+

The directives above only let one person (specifically + someone with a username of rbowen) into the + directory. In most cases, you'll want to let more than one + person in. This is where the AuthGroupFile comes in.

+ +

If you want to let more than one person in, you'll need to + create a group file that associates group names with a list of + users in that group. The format of this file is pretty simple, + and you can create it with your favorite editor. The contents + of the file will look like this:

+ +

+ GroupName: rbowen dpitts sungo rshersey +

+ +

That's just a list of the members of the group in a long + line separated by spaces.

+ +

To add a user to your already existing password file, + type:

+ +

+ htpasswd /usr/local/apache/passwd/passwords dpitts +

+ +

You'll get the same response as before, but it will be + appended to the existing file, rather than creating a new file. + (It's the -c that makes it create a new password + file).

+ +

Now, you need to modify your .htaccess file to + look like the following:

+ +

+ AuthType Basic
+ AuthName "By Invitation Only"
+ # Optional line: + AuthBasicProvider file + AuthUserFile /usr/local/apache/passwd/passwords
+ AuthGroupFile /usr/local/apache/passwd/groups
+ Require group GroupName +

+ +

Now, anyone that is listed in the group GroupName, + and has an entry in the password file, will be let in, if + they type the correct password.

+ +

There's another way to let multiple users in that is less + specific. Rather than creating a group file, you can just use + the following directive:

+ +

+ Require valid-user +

+ +

Using that rather than the Require user rbowen + line will allow anyone in that is listed in the password file, + and who correctly enters their password. You can even emulate + the group behavior here, by just keeping a separate password + file for each group. The advantage of this approach is that + Apache only has to check one file, rather than two. The + disadvantage is that you have to maintain a bunch of password + files, and remember to reference the right one in the + AuthUserFile directive.

+
top
+
+

Possible problems

+

Because of the way that Basic authentication is specified, + your username and password must be verified every time you + request a document from the server. This is even if you're + reloading the same page, and for every image on the page (if + they come from a protected directory). As you can imagine, this + slows things down a little. The amount that it slows things + down is proportional to the size of the password file, because + it has to open up that file, and go down the list of users + until it gets to your name. And it has to do this every time a + page is loaded.

+ +

A consequence of this is that there's a practical limit to + how many users you can put in one password file. This limit + will vary depending on the performance of your particular + server machine, but you can expect to see slowdowns once you + get above a few hundred entries, and may wish to consider a + different authentication method at that time.

+
top
+
+

Alternate password storage

+ +

Because storing passwords in plain text files has the above + problems, you may wish to store your passwords somewhere else, such + as in a database.

+ +

mod_authn_dbm and mod_authn_dbd + are two modules which make this possible. Rather than selecting + AuthBasicSource file, + instead you can choose dbm or dbd as your + storage format.

+ +

To select a dbd file rather than a text file, for example:

+ +

+ <Directory /www/docs/private>
+ AuthName "Private"
+ AuthType Basic
+ AuthBasicProvider dbm
+ AuthDBMUserFile /www/passwords/passwd.dbm
+ Require valid-user +

+ +

Other options are available. Consult the + mod_authn_dbm documentation for more details.

+
top
+
+

More information

+

You should also read the documentation for + mod_auth_basic and mod_authz_host which + contain some more information about how this all works. + mod_authn_alias can also help in simplifying certain + authentication configurations.

+ +

And you may want to look at the Access + Control howto, which discusses a number of related topics.

+ +
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/auth.html.ja.euc-jp b/docs/manual/howto/auth.html.ja.euc-jp new file mode 100644 index 00000000..73e85d12 --- /dev/null +++ b/docs/manual/howto/auth.html.ja.euc-jp @@ -0,0 +1,386 @@ + + + +認証、承認、アクセス制御 - Apache HTTP サーバ + + + + + +
<-
+
+Apache > HTTP サーバ > ドキュメンテーション > バージョン 2.2 > How-To / チュートリアル

認証、承認、アクセス制御

+
+

Available Languages:  en  | + ja  | + ko 

+
+
This translation may be out of date. Check the + English version for recent changes.
+ +

「認証」とは、誰かが自分は誰であるかを主張した場合に、 + それを確認するための全過程を指します。「承認」とは、 + 誰かが行きたい場所に行けるように、あるいは欲しい情報を + 得ることができるようにするための全過程を指します。

+
+ +
top
+
top
+
+

はじめに

+

もし機密の情報や、ごくごく少数グループの人向けの情報を + ウェブサイトに置くのであれば、この文書に書かれている + テクニックを使うことで、そのページを見ている人たちが + 望みの人たちであることを確実にできるでしょう。

+ +

この文書では、多くの人が採用するであろう、 + ウェブサイトの一部分を保護する「一般的な」 + 方法についてカバーしています。

+
top
+
+

準備

+

この文書で取り扱われるディレクティブは、 + メインサーバ設定ファイル (普通は + <Directory> + セクション中) か、あるいはディレクトリ毎の設定ファイル + (.htaccess ファイル) かで用います。

+ +

.htaccess ファイルを用いるのであれば、 + これらのファイルに認証用のディレクティブを置けるように + サーバの設定をしないといけないでしょう。これは + AllowOverride + ディレクティブで可能になります。 + AllowOverride + ディレクティブでは、ディレクトリ毎の設定ファイル中に置くことのできる + ディレクティブを、もしあれば、指定します。

+ +

認証について話を進めているので、次のような + AllowOverride + ディレクティブが必要になるでしょう。

+ +

+ AllowOverride AuthConfig +

+ +

そうでなく、メインサーバ設定ファイルの中に + 直接置くのであれば、当然ながらそのファイルへの書き込み + 権限を持っていなければならないでしょう。

+ +

また、どのファイルがどこに保存されているか知るために、 + サーバのディレクトリ構造について少し知っておく + 必要があるでしょう。 + これはそんなに難しくないので、この文書中で + ディレクトリ構造について知っておく必要がある場面では、 + 明らかになるようにします。

+
top
+
+

動作させる

+

では、サーバ上のあるディレクトリをパスワードで保護する + 基本手順を示します。

+ +

パスワードファイルを作る必要があります。 + このファイルは、ウェブからアクセスできる場所に + 置くべきではありません。他の人がパスワードファイルを + ダウンロードできないようにするためです。例えば、 + /usr/local/apache/htdocs でドキュメントを + 提供しているのであれば、パスワードファイルは + /usr/local/apache/passwd + などに置いた方が良いでしょう。

+ +

ファイルを作るためには、Apache 付属の htpasswd + を使います。このコマンドは Apache をどこにインストールしようとも、 + インストールディレクトリの bin + ディレクトリ以下に置かれます。ファイルを作るには、次のように + タイプしてください。

+ +

+ htpasswd -c /usr/local/apache/passwd/passwords rbowen +

+ +

htpasswd は、パスワードを要求し、その後 + 確認のためにもう一度入力するように要求してきます。

+ +

+ # htpasswd -c /usr/local/apache/passwd/passwords rbowen
+ New password: mypassword
+ Re-type new password: mypassword
+ Adding password for user rbowen +

+ +

もし htpasswd がパスの中に入っていない場合は、 + もちろん、実行するためにプログラムまでのフルパスを + タイプする必要があります。私のサーバであれば、 + /usr/local/apache/bin/htpasswd + にプログラムが置かれています。

+ +

次に、サーバがパスワードを要求するように設定して、 + どのユーザがアクセスを許されているかをサーバに知らせなければ + なりません。 httpd.conf を編集するか + .htaccess ファイルを使用するかで + 設定します。例えば、ディレクトリ + /usr/local/apache/htdocs/secret + を保護したい場合は、 + /usr/local/apache/htdocs/secret/.htaccess + か httpd.conf 中の <Directory + /usr/local/apache/apache/htdocs/secret> セクションに + 配置して、次のディレクティブを使うことができます。

+ +

+ AuthType Basic
+ AuthName "Restricted Files"
+ AuthUserFile /usr/local/apache/passwd/passwords
+ Require user rbowen +

+ +

個々のディレクティブについて見てみましょう。 + AuthType + ディレクティブはどういう認証方法でユーザの認証を行うかを + 選択します。最も一般的な方法は Basic + で、これは mod_auth_basic + で実装されています。しかしながら、 + これは気を付けるべき重要なポイントなのですが、 + Basic 認証はクライアントからサーバへ、 + パスワードを暗号化せずに送ります。ですから、 + この方法は特に機密性の高いデータに対しては用いるべきでは + ありません。 Apache ではもう一つ別の認証方法: + AuthType Digest をサポートしています。 + この方法は mod_auth_digest + で実装されていて、もっと安全です。 + ごくごく最近のクライアントしか Digest + 認証をサポートしていないようです。

+ +

AuthName + ディレクティブでは、認証に使う Realm (訳注: 領域) + を設定します。Realm は大きく分けて二つの機能を提供します。 + 一つ目は、クライアントがパスワードダイアログボックスの + 一部としてユーザにこの情報をよく提示する、というものです。 + 二つ目には、クライアントが与えられた認証領域に対してどのパスワードを + 送信すれば良いのかを決定するために使われる、という機能です。

+ +

例えば、"Restricted Files" 領域中で + 一度認証されれば、同一サーバ上で "Restricted Files" + Realm としてマークされたどんな領域でも、クライアントは + 自動的に同じパスワードを使おうと試みます。 + このおかげで、複数の制限領域に同じ realm を共有させて、 + ユーザがパスワードを何度も要求される事態を + 防ぐことができます。もちろん、セキュリティ上の理由から、 + サーバのホスト名が変わればいつでも必ず、 + クライアントは再びパスワードを尋ねる必要があります。

+ +

AuthUserFile + ディレクティブは htpasswd で作った + パスワードファイルへのパスを設定します。 + ユーザ数が多い場合は、リクエスト毎のユーザの認証のための + プレーンテキストの探索が非常に遅くなることがあります。 + Apache ではユーザ情報を高速なデータベースファイルに + 保管することもできます。 + mod_authn_dbm モジュールが + AuthDBMUserFile + ディレクティブを提供します。これらのファイルは dbmmanage + プログラムで作成したり操作したりできます。 + Apache + モジュールデータベース中にあるサードパーティー製の + モジュールで、その他多くのタイプの認証オプションが + 利用可能です。

+ +

最後に、Require + ディレクティブが、サーバのこの領域にアクセスできるユーザを + 指定することによって、プロセスの承認部分を提供します。 + 次のセクションでは、Require + ディレクティブの様々な用法について述べます。

+
top
+
+

+複数の人が入れるようにする

+

上記のディレクティブは、ただ一人 (具体的にはユーザ名 + rbowen の誰か) がディレクトリに + 入れるようにします。多くの場合は、複数の人が + 入れるようにしたいでしょう。ここで + AuthGroupFile + の登場です。

+ +

もし複数の人が入れるようにしたいのであれば、 + グループに属するユーザの一覧の入っている、グループ名のついた + グループファイルを作る必要があります。このファイルの + 書式はきわめて単純で、お好みのエディタで生成できます。 + ファイルの中身は次のようなものです。

+ +

+ GroupName: rbowen dpitts sungo rshersey +

+ +

一行にスペース区切りで、グループに所属するメンバーの + 一覧をならべるだけです。

+ +

既に存在するパスワードファイルにユーザを加える場合は、 + 次のようにタイプしてください。

+ +

+ htpasswd /usr/local/apache/passwd/passwords dpitts +

+ +

以前と同じ応答が返されますが、新しいファイルを + 作るのではなく、既にあるファイルに追加されています。 + (新しいパスワードファイルを作るには -c + を使います。)

+ +

ここで次のようにして .htaccess ファイルを + 修正する必要があります。

+ +

+ AuthType Basic
+ AuthName "By Invitation Only"
+ AuthUserFile /usr/local/apache/passwd/passwords
+ AuthGroupFile /usr/local/apache/passwd/groups
+ Require group GroupName +

+ +

これで、グループ GroupName にリストされていて、 + password ファイルにエントリがある人は、 + 正しいパスワードをタイプすれば入ることができるでしょう。

+ +

もっと特定せずに複数のユーザが入れるようにする、 + もう一つの方法があります。グループファイルを作るのではなく、 + 次のディレクティブを使えばできます。

+ +

+ Require valid-user +

+ +

require user rbowen 行でなく、上記を使うと、 + パスワードファイルにリストされている人であれば誰でも + 許可されます。 + 単にパスワードファイルをグループ毎に分けておくことで、 + グループのような振る舞いをさせることもできます。 + このアプローチの利点は、Apache は二つではなく、 + ただ一つのファイルだけを検査すればよいという点です。 + 欠点は、たくさんのパスワードファイルを管理して、その中から + AuthUserFile + ディレクティブに正しいファイルを参照させなければならない点です。

+
top
+
+

起こりえる問題

+

Basic 認証が指定されている場合は、 + サーバにドキュメントをリクエストする度に + ユーザ名とパスワードを検査しなければなりません。 + これは同じページ、ページにある全ての画像を + リロードする場合であっても該当します + (もし画像も保護されたディレクトリから来るのであれば) 。 + 予想される通り、これは動作を多少遅くします。 + 遅くなる程度はパスワードファイルの大きさと比例しますが、 + これは、ファイルを開いてあなたの名前を発見するまで + ユーザ名のリストを読まなければならないからです。 + そして、ページがロードされる度にこれを行わなければ + なりません。

+ +

結論としては、一つのパスワードファイルに置くことのできる + ユーザ数には実質的な限界があります。 + この限界はサーバマシンの性能に依存して変わりますが、 + 数百のエントリを越えたあたりから速度低下が見られると予期されています。 + その時は他の認証方法を考慮に入れた方が良いでしょう。

+
top
+
+

もっと巧みに制御できない +?

+

ユーザ名とパスワードによる認証は認証の一つの方法に過ぎません。 + しばしば誰であるかということとは違う何かに基づいて、 + 入れるようにしたくなることもあるでしょう。 + 例えばその人がどこから来ているかといったことです。

+ +

Allow と + Deny + ディレクティブを使って、ドキュメントを要求してきたマシンの + ホスト名やホストアドレスに基づいて許可不許可を制御できます。 + Order + ディレクティブはこの二つと連携して動作し、Apache + にどの順番でフィルタを適用するかを知らせます。

+ +

これらのディレクティブの使い方は次のようになります。

+ +

+ Allow from address +

+ +

ここで、address は IP アドレス + (または IP アドレスの一部)、あるいは完全修飾ドメイン名 + (またはドメイン名の一部) です。 + 必要であれば複数のアドレスやドメイン名を指定できます。

+ +

例えば、もし誰かが掲示板を攻撃していて、 + その人を閉め出したいのであれば、 + 次のようにすることができます。

+ +

+ Deny from 205.252.46.165 +

+ +

このアドレスから来る人は、このディレクティブの範囲内の + コンテンツを見ることができないません。もし IP + アドレスの代わりにマシン名があれば、それを使えます。

+ +

+ Deny from host.example.com +

+ +

ドメイン全体からのアクセスを防ぎたければ、 + 単にアドレスやドメイン名の一部を指定することができます。

+ +

+ Deny from 192.101.205
+ Deny from cyberthugs.com moreidiots.com
+ Deny from ke +

+ +

Order を使うことで、 + Deny と + Allow の組み合わせで + 入っても良いグループが本当に確実に限定できているようにできます。

+ +

+ Order deny,allow
+ Deny from all
+ Allow from dev.example.com +

+ +

Allow + ディレクティブを単純に列挙するのでは望みの動作をしないでしょう。 + なぜなら、全ての人が入れるということに加えて、 + 指定したホストからの人が入れるようにするからです。 + やりたいことは、指定した人たちだけが入れるように + することです。

+
top
+
+

追加情報

+

これら全てがどのように動作するかについて + もっと多くの情報が書かれている mod_auth_basic と + mod_authz_host + の文書も読むとよいでしょう。

+
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/auth.html.ko.euc-kr b/docs/manual/howto/auth.html.ko.euc-kr new file mode 100644 index 00000000..b76e5262 --- /dev/null +++ b/docs/manual/howto/auth.html.ko.euc-kr @@ -0,0 +1,323 @@ + + + +昔装(Authentication), 映廃採食(Authorization), +羨悦薦嬢(Access Control) - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

昔装(Authentication), 映廃採食(Authorization), +羨悦薦嬢(Access Control)

+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+
戚 庚辞澗 置重毒 腰蝕戚 焼鑑艦陥. + 置悦拭 痕井吉 鎧遂精 慎嬢 庚辞研 凧壱馬室推.
+ +

昔装(authentication)精 切重戚 刊姥虞壱 爽舌馬澗 紫寓聖 + 溌昔馬澗 箭託戚陥. 映廃採食(authorization)澗 亜壱 粛精 員生稽 + 亜亀系 箸精 据馬澗 舛左研 条亀系 買遂馬澗 引舛戚陥.

+
+ +
top
+
top
+
+

社鯵

+

雁重税 瀬紫戚闘拭 赤澗 舛左亜 社呪税 紫寓級幻税 搾腔戚暗蟹 + 戚級幻聖 是廃 舛左虞檎, 戚 越拭辞 竺誤馬澗 奄狛聖 紫遂馬食 + 雁重戚 左掩 据馬澗 紫寓幻 凪戚走研 左亀系 拝 呪 赤陥.

+ +

戚 越精 瀬紫戚闘税 析採研 左硲馬奄是背 弦精 紫寓級戚 + 紫遂馬澗 "妊層旋昔" 号狛聖 陥潔陥.

+
top
+
+

奄沙 走縦

+

戚 越拭辞 陥欠澗 走獣嬢澗 辞獄税 爽竺舛督析(析鋼旋生稽 + <Directory> + 悉芝)戚蟹 巨刑塘軒紺 竺舛督析(.htaccess 督析)拭辞 + 紫遂廃陥.

+ +

.htaccess 督析聖 紫遂馬形檎 戚 督析拭 赤澗 + 昔装 走獣嬢研 買遂馬亀系 辞獄研 竺舛背醤 廃陥. 戚研 是背 + 巨刑塘軒紺 竺舛督析拭 嬢恐 走獣嬢研 紫遂拝 呪 赤澗走研 衣舛馬澗 + AllowOverride 走獣嬢研 + 紫遂廃陥.

+ +

食奄辞澗 昔装聖 陥欠奄 凶庚拭, 陥製引 旭精 + AllowOverride 走獣嬢亜 琶推馬陥.

+ +

+ AllowOverride AuthConfig +

+ +

箸精 走獣嬢研 送羨 辞獄 爽竺舛督析拭 旋澗陥檎, 益 督析拭 + 床奄 映廃戚 弘経 赤嬢醤 廃陥.

+ +

益軒壱 左硲拝 督析戚 嬢巨赤澗走 硝奄是背 辞獄税 巨刑塘軒 + 姥繕拭 企背 繕榎 硝焼醤廃陥. 戚 析精 嬢憩走省壱, 旋雁廃 + 凶拭 切室備 竺誤拝 依戚陥.

+
top
+
+

奄沙旋昔 竺舛馬奄

+

戚薦 辞獄税 巨刑塘軒研 章硲稽 左硲馬澗 奄沙旋昔 号狛聖 + 竺誤廃陥.

+ +

胡煽 章硲督析聖 幻級嬢醤 廃陥. 戚 督析精 瀬拭辞 羨悦拝 + 呪 蒸澗 員拭 赤嬢醤 廃陥. 陥献紫寓戚 章硲督析聖 陥錘稽球馬走 + 公馬惟馬奄 是背辞陥. 森研 級嬢, 庚辞級戚 + /usr/local/apache/htdocs拭 赤陥檎 章硲督析(級)精 + /usr/local/apache/passwd拭 黍陥.

+ +

焼督帖拭 匂敗吉 htpasswd 亀姥研 紫遂馬食 + 章硲督析聖 幻窮陥. 戚 覗稽益轡精 焼督帖研 竺帖廃 員税 + bin 巨刑塘軒拭 赤陥. 督析聖 幻級形檎 陥製引 + 旭戚 脊径廃陥.

+ +

+ htpasswd -c /usr/local/apache/passwd/passwords rbowen +

+ +

htpasswd澗 章硲研 弘嬢左壱, 溌昔聖 是背 + 章硲研 陥獣 脊径馬虞壱 推短廃陥.

+ +

+ # htpasswd -c /usr/local/apache/passwd/passwords rbowen
+ New password: mypassword
+ Re-type new password: mypassword
+ Adding password for user rbowen +

+ +

弘経 htpasswd戚 叔楳督析 井稽拭 蒸陥檎 + 叔楳督析税 穿端 井稽研 脊径背醤 廃陥. 鎧亜 紫遂馬澗 辞獄拭辞澗 + /usr/local/apache/bin/htpasswd拭 叔楳督析戚 + 赤陥.

+ +

陥製生稽 辞獄亜 章硲研 推短馬亀系 竺舛馬壱, 辞獄拭惟 + 嬢恐 紫遂切税 羨悦聖 買遂拝走 硝形操醤 廃陥. + httpd.conf研 畷増馬暗蟹 .htaccess + 督析聖 紫遂馬食 竺舛廃陥. 森研 級嬢, + /usr/local/apache/htdocs/secret 巨刑塘軒研 + 左硲馬形檎, 焼掘 走獣嬢研 + /usr/local/apache/htdocs/secret/.htaccess 督析戚蟹 + httpd.conf税 <Directory + /usr/local/apache/apache/htdocs/secret> 悉芝拭 旋嬢醤 + 廃陥.

+ +

+ AuthType Basic
+ AuthName "Restricted Files"
+ AuthUserFile /usr/local/apache/passwd/passwords
+ Require user rbowen +

+ +

走獣嬢研 馬蟹梢 詞縄左切. AuthType 走獣嬢澗 紫遂切研 昔装拝 + 号狛聖 識澱廃陥. 亜舌 析鋼旋昔 号狛精 Basic生稽, + mod_auth_basic戚 姥薄廃陥. 益君蟹 Basic + 昔装精 崎虞酔煽亜 辞獄稽 章硲研 章硲鉢馬走 省壱 左浬陥. + 益君糠稽 奄腔 切戟研 左硲馬奄是背 戚 号狛聖 紫遂馬檎 照吉陥. + 焼督帖澗 AuthType Digest虞澗 昔装 号狛亀 走据廃陥. + 戚 号狛精 mod_auth_digest亜 姥薄馬悟, 古酔 + 照穿馬陥. 亜舌 置悦 適虞戚情闘級幻戚 Digest 昔装聖 走据廃陥壱 + 廃陥.

+ +

AuthName 走獣嬢澗 + 昔装拭 紫遂拝 慎蝕(realm)聖 走舛廃陥. 慎蝕精 + 砧亜走 蝕拝聖 廃陥. 湛腰属澗 適虞戚情闘亜 左搭 戚 舛左研 + 章硲 企鉢但拭 左食層陥. 砧腰属澗 慎蝕 舛左研 紫遂馬食 + 適虞戚情闘亜 働舛 昔装姥蝕拭 嬢恐 章硲研 左馨走 衣舛廃陥.

+ +

森研 級嬢, 析舘 適虞戚情闘亜 "Restricted Files" + 慎蝕拭 昔装戚 失因馬心陥檎, 適虞戚情闘澗 切疑生稽 旭精 辞獄拭辞 + "Restricted Files" 慎蝕生稽 妊獣吉 姥蝕拭 企背 + 疑析廃 章硲研 獣亀廃陥. 益掘辞 食君 薦廃 姥蝕戚 旭精 慎蝕聖 + 因政馬檎 紫遂切亜 食君腰 章硲研 脊径馬走 省焼亀 吉陥. 弘経 + 左照雌 戚政稽 適虞戚情闘澗 辞獄税 硲什闘誤戚 陥牽檎 牌雌 + 歯稽 章硲研 弘嬢沙陥.

+ +

AuthUserFile + 走獣嬢澗 酔軒亜 号榎 htpasswd稽 幻窮 章硲督析税 + 井稽研 竺舛廃陥. 紫遂切亜 弦陥檎 推短原陥 古腰 紫遂切研 + 昔装馬奄是背 析鋼 庚辞督析聖 伊事馬澗汽 獣娃戚 雌雁備 弦戚 + 杏険 呪 赤陥. 焼督帖澗 匙献 汽戚展今戚什 督析拭 紫遂切 舛左研 + 煽舌拝 呪 赤陥. mod_authn_dbm 乞汲精 AuthDBMUserFile 走獣嬢研 + 薦因廃陥. dbmmanage + 覗稽益轡聖 紫遂馬食 章硲督析聖 幻級壱 陥潔陥. 焼督帖 乞汲 + 汽戚展今戚什拭澗 食君 陥献 昔装 号縦聖 薦因馬澗 薦誌切亜 + 幻窮 乞汲級戚 赤陥.

+ +

原走厳生稽 Require + 走獣嬢澗 辞獄税 働舛 慎蝕拭 羨悦拝 呪 赤澗 紫遂切研 走舛馬食 + 映廃採食研 廃陥. 陥製 箭精 require 走獣嬢研 + 紫遂馬澗 陥丞廃 号狛聖 竺誤廃陥.

+
top
+
+

食君誤聖 級食左鎧奄

+

是税 走獣嬢澗 巨刑塘軒稽 (紫遂切誤戚 rbowen昔) + 廃 紫寓幻聖 級食左浬陥. 企採歳税 井酔 食君 紫寓聖 級食左鎧壱 + 粛聖 依戚陥. 戚薦 AuthGroupFile聖 + 紫遂拝 凶陥.

+ +

食君 紫寓聖 級食左鎧壱 粛陥檎 益血誤引 益 益血拭 嬢恐 + 紫遂切級戚 赤澗走 硝形爽澗 益血督析戚 琶推馬陥. 戚 督析税 + 莫縦精 古酔 娃舘馬食, 焼巷 畷増奄稽蟹 幻級 呪 赤陥. 督析鎧遂精 + 陥製引 旭陥.

+ +

+ GroupName: rbowen dpitts sungo rshersey +

+ +

益撹 因拷生稽 姥歳廃 延 益血 姥失据 鯉系析 屍戚陥.

+ +

奄糎税 章硲督析拭 紫遂切研 蓄亜馬形檎 陥製引 旭戚 脊径廃陥

+ +

+ htpasswd /usr/local/apache/passwd/passwords dpitts +

+ +

穿引 旭走幻, 歯稽 督析聖 幻級走 省壱 奄糎 督析拭 紫遂切研 + 蓄亜廃陥. (-c 辛芝精 歯稽 章硲督析聖 幻窮陥).

+ +

戚薦 .htaccess 督析聖 陥製引 旭戚 呪舛廃陥.

+ +

+ AuthType Basic
+ AuthName "By Invitation Only"
+ AuthUserFile /usr/local/apache/passwd/passwords
+ AuthGroupFile /usr/local/apache/passwd/groups
+ Require group GroupName +

+ +

益君檎 GroupName 益血拭 紗馬悟 + password 督析拭 牌鯉戚 赤澗 紫遂切亜 臣郊献 + 章硲研 脊径馬檎 羨悦聖 買遂廃陥.

+ +

食君 析鋼 紫遂切研 級食左鎧澗 陥献 号狛戚 赤陥. 益血督析聖 + 幻級 琶推蒸戚 陥製 走獣嬢研 紫遂馬奄幻 馬檎 吉陥.

+ +

+ Require valid-user +

+ +

Require user rbowen 企重 戚 走獣嬢研 紫遂馬檎 + 章硲督析拭 赤澗 刊姥虞亀 臣郊献 章硲研 脊径馬奄幻 馬檎 羨悦聖 + 買遂廃陥. 益血紺稽 陥献 章硲督析聖 紫遂馬食 益血引 搾汁廃 + 反引研 条聖 呪亀 赤陥. 戚 井酔 焼督帖亜 督析 砧鯵(章硲督析引 + 益血督析)亜 焼観 督析 廃鯵(章硲督析)幻 伊紫馬檎 吉陥澗 依戚 + 舌繊戚陥. 益君蟹 食君 章硲督析聖 淫軒背醤 馬壱, AuthUserFile 走獣嬢拭 + 舛溌廃 章硲督析聖 走舛背醤 馬澗 依精 舘繊戚陥.

+
top
+
+

降持拝 呪 赤澗 庚薦繊

+

Basic 昔装 号縦精 辞獄拭辞 庚辞研 推短拝 凶原陥 紫遂切誤引 + 章硲研 溌昔廃陥. 宿走嬢 旭精 凪戚走研 歯稽 壱徴拝 凶亀 凪戚走人 + (益顕戚 章硲稽 左硲馬澗 巨刑塘軒拭 赤澗 井酔) 凪戚走拭 赤澗 + 乞窮 益顕拭 企背 陥獣 溌昔廃陥. 像拙馬牛戚 紗亀亜 繕榎 汗形遭陥. + 章硲督析聖 伸嬢辞 紫遂切誤聖 達聖 凶猿走 紫遂切 鯉系聖 詞縄坐醤 + 馬奄凶庚拭 章硲督析 滴奄亜 朕霜 呪系 希 汗形遭陥. 益軒壱 + 戚 拙穣聖 凪戚走研 推短拝 凶原陥 遭楳廃陥.

+ +

益掘辞 薄叔旋生稽 廃 章硲督析拭 煽舌拝 呪 赤澗 紫遂切呪拭澗 + 廃域亜 赤陥. 戚 廃域澗 紫遂馬澗 辞獄税 失管拭 魚虞 陥牽走幻, + 牌鯉戚 呪拷鯵亜 角澗陥檎 汗形遭陥壱 持唖馬壱 陥献 昔装 号狛聖 + 壱形背醤 廃陥.

+
top
+
+

陥献 号狛亀 亜管廃亜?

+

紫遂切誤引 章硲研 紫遂廃 昔装戚 陥亜 焼艦陥. 曽曽 羨紗廃 + 舌社人 旭精 陥献 舛左研 亜走壱 紫遂切研 級食左鎧壱 粛聖 + 凶亜 赤陥.

+ +

Allow人 + Deny 走獣嬢澗 + 庚辞研 推短廃 陳濃斗税 硲什闘誤 箸精 硲什闘 爽社研 亜走壱 + 羨悦聖 買遂馬暗蟹 暗採廃陥. Order 走獣嬢澗 戚 砧 + 走獣嬢人 旭戚 紫遂馬食, 焼督帖拭惟 嬢恐 授辞稽 鋭帳聖 旋遂拝走 + 硝鍵陥.

+ +

戚級 走獣嬢 紫遂狛精 陥製引 旭陥.

+ +

+ Allow from address +

+ +

食奄辞 address澗 IP 爽社(箸精 IP 爽社 析採)蟹 + 刃穿廃 亀五昔誤(箸精 亀五昔誤 析採)戚陥. 据廃陥檎 食君 爽社蟹 + 亀五昔誤聖 紫遂拝 呪 赤陥.

+ +

森研 級嬢, 刊浦亜亜 惟獣毒拭 韻壱研 臣軒壱 赤陥檎 陥製引 + 旭戚 羨悦聖 厳聖 呪 赤陥.

+ +

+ Deny from 205.252.46.165 +

+ +

益 爽社拭辞 級嬢神澗 号庚切澗 戚 走獣嬢亜 左硲馬澗 凪戚走研 + 瑳 呪 蒸陥. IP 爽社 企重 陥製引 旭戚 陳濃斗誤聖 紫遂拝 呪亀 + 赤陥.

+ +

+ Deny from host.example.com +

+ +

暁, 穿端 亀五昔税 羨悦聖 厳生形檎 爽社蟹 亀五昔誤税 析採研 + 紫遂廃陥.

+ +

+ Deny from 192.101.205
+ Deny from cyberthugs.com moreidiots.com
+ Deny from ke +

+ +

Order研 + DenyAllow 走獣嬢人 旭戚 + 紫遂馬食 叔薦稽 据馬澗 企雌聖 厳聖 呪 赤陥.

+ +

+ Order deny,allow
+ Deny from all
+ Allow from dev.example.com +

+ +

Allow + 走獣嬢幻 紫遂馬檎, 背雁 硲什闘税 紫遂切研 買遂馬壱 暗奄拭 + 蓄亜稽 乞窮 紫寓聖 買遂馬糠稽 据馬澗 衣引研 条走 公廃陥. + 雁重精 働舛 紫寓 買遂馬掩 据廃陥.

+
top
+
+

希 弦精 舛左

+

mod_auth_basic引 + mod_authz_host 庚辞拭 羨悦薦嬢亜 疑拙馬澗 + 号狛拭 企廃 希 弦精 舛左亜 赤陥.

+
+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/cgi.html b/docs/manual/howto/cgi.html new file mode 100644 index 00000000..8d3dbcba --- /dev/null +++ b/docs/manual/howto/cgi.html @@ -0,0 +1,11 @@ +URI: cgi.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: cgi.html.ja.euc-jp +Content-Language: ja +Content-type: text/html; charset=EUC-JP + +URI: cgi.html.ko.euc-kr +Content-Language: ko +Content-type: text/html; charset=EUC-KR diff --git a/docs/manual/howto/cgi.html.en b/docs/manual/howto/cgi.html.en new file mode 100644 index 00000000..42893e6c --- /dev/null +++ b/docs/manual/howto/cgi.html.en @@ -0,0 +1,555 @@ + + + +Apache Tutorial: Dynamic Content with CGI - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

Apache Tutorial: Dynamic Content with CGI

+
+

Available Languages:  en  | + ja  | + ko 

+
+
+ +
top
+
+

Introduction

+ + + + +

The CGI (Common Gateway Interface) defines a way for a web + server to interact with external content-generating programs, + which are often referred to as CGI programs or CGI scripts. It + is the simplest, and most common, way to put dynamic content on + your web site. This document will be an introduction to setting + up CGI on your Apache web server, and getting started writing + CGI programs.

+
top
+
+

Configuring Apache to permit CGI

+ + +

In order to get your CGI programs to work properly, you'll + need to have Apache configured to permit CGI execution. There + are several ways to do this.

+ +

ScriptAlias

+ + +

The + ScriptAlias + + directive tells Apache that a particular directory is set + aside for CGI programs. Apache will assume that every file in + this directory is a CGI program, and will attempt to execute + it, when that particular resource is requested by a + client.

+ +

The ScriptAlias + directive looks like:

+ +

+ ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ +

+ +

The example shown is from your default httpd.conf + configuration file, if you installed Apache in the default + location. The ScriptAlias + directive is much like the Alias directive, which defines a URL prefix that + is to mapped to a particular directory. Alias + and ScriptAlias are usually used for + directories that are outside of the DocumentRoot directory. The difference between + Alias and ScriptAlias + is that ScriptAlias has the added meaning + that everything under that URL prefix will be considered a CGI + program. So, the example above tells Apache that any request for a + resource beginning with /cgi-bin/ should be served from + the directory /usr/local/apache2/cgi-bin/, and should be + treated as a CGI program.

+ +

For example, if the URL + http://www.example.com/cgi-bin/test.pl + is requested, Apache will attempt to execute the file + /usr/local/apache2/cgi-bin/test.pl + and return the output. Of course, the file will have to + exist, and be executable, and return output in a particular + way, or Apache will return an error message.

+ + +

CGI outside of ScriptAlias directories

+ + +

CGI programs are often restricted to ScriptAlias'ed directories for security reasons. + In this way, administrators can tightly control who is allowed to + use CGI programs. However, if the proper security precautions are + taken, there is no reason why CGI programs cannot be run from + arbitrary directories. For example, you may wish to let users + have web content in their home directories with the + UserDir directive. + If they want to have their own CGI programs, but don't have access to + the main cgi-bin directory, they will need to be able to + run CGI programs elsewhere.

+ +

There are two steps to allowing CGI execution in an arbitrary + directory. First, the cgi-script handler must be + activated using the AddHandler or SetHandler directive. Second, + ExecCGI must be specified in the Options directive.

+ + +

Explicitly using Options to permit CGI execution

+ + +

You could explicitly use the Options directive, inside your main server configuration + file, to specify that CGI execution was permitted in a particular + directory:

+ +

+ <Directory /usr/local/apache2/htdocs/somedir>
+ + Options +ExecCGI
+
+ </Directory> +

+ +

The above directive tells Apache to permit the execution + of CGI files. You will also need to tell the server what + files are CGI files. The following AddHandler directive tells the server to treat all + files with the cgi or pl extension as CGI + programs:

+ +

+ AddHandler cgi-script .cgi .pl +

+ + +

.htaccess files

+ + +

The .htaccess tutorial + shows how to activate CGI programs if you do not have + access to httpd.conf.

+ + +

User Directories

+ + +

To allow CGI program execution for any file ending in + .cgi in users' directories, you can use the + following configuration.

+ +

+ <Directory /home/*/public_html>
+ + Options +ExecCGI
+ AddHandler cgi-script .cgi
+
+ </Directory> +

+ +

If you wish designate a cgi-bin subdirectory of + a user's directory where everything will be treated as a CGI + program, you can use the following.

+ +

+ <Directory /home/*/public_html/cgi-bin>
+ + Options ExecCGI
+ SetHandler cgi-script
+
+ </Directory> +

+ + + +
top
+
+

Writing a CGI program

+ + +

There are two main differences between ``regular'' + programming, and CGI programming.

+ +

First, all output from your CGI program must be preceded by + a MIME-type header. This is HTTP header that tells the client + what sort of content it is receiving. Most of the time, this + will look like:

+ +

+ Content-type: text/html +

+ +

Secondly, your output needs to be in HTML, or some other + format that a browser will be able to display. Most of the + time, this will be HTML, but occasionally you might write a CGI + program that outputs a gif image, or other non-HTML + content.

+ +

Apart from those two things, writing a CGI program will look + a lot like any other program that you might write.

+ +

Your first CGI program

+ + +

The following is an example CGI program that prints one + line to your browser. Type in the following, save it to a + file called first.pl, and put it in your + cgi-bin directory.

+ +

+ #!/usr/bin/perl
+ print "Content-type: text/html\n\n";
+ print "Hello, World."; +

+ +

Even if you are not familiar with Perl, you should be able + to see what is happening here. The first line tells Apache + (or whatever shell you happen to be running under) that this + program can be executed by feeding the file to the + interpreter found at the location /usr/bin/perl. + The second line prints the content-type declaration we + talked about, followed by two carriage-return newline pairs. + This puts a blank line after the header, to indicate the end + of the HTTP headers, and the beginning of the body. The third + line prints the string "Hello, World.". And that's the end + of it.

+ +

If you open your favorite browser and tell it to get the + address

+ +

+ http://www.example.com/cgi-bin/first.pl +

+ +

or wherever you put your file, you will see the one line + Hello, World. appear in your browser window. + It's not very exciting, but once you get that working, you'll + have a good chance of getting just about anything working.

+ +
top
+
+

But it's still not working!

+ + +

There are four basic things that you may see in your browser + when you try to access your CGI program from the web:

+ +
+
The output of your CGI program
+
Great! That means everything worked fine. If the output is correct, + but the browser is not processing it correctly, make sure you have the + correct Content-Type set in your CGI program.
+ +
The source code of your CGI program or a "POST Method Not + Allowed" message
+
That means that you have not properly configured Apache + to process your CGI program. Reread the section on + configuring + Apache and try to find what you missed.
+ +
A message starting with "Forbidden"
+
That means that there is a permissions problem. Check the + Apache error log and the section below on + file permissions.
+ +
A message saying "Internal Server Error"
+
If you check the + Apache error log, you will probably + find that it says "Premature end of + script headers", possibly along with an error message + generated by your CGI program. In this case, you will want to + check each of the below sections to see what might be + preventing your CGI program from emitting the proper HTTP + headers.
+
+ +

File permissions

+ + +

Remember that the server does not run as you. That is, + when the server starts up, it is running with the permissions + of an unprivileged user - usually nobody, or + www - and so it will need extra permissions to + execute files that are owned by you. Usually, the way to give + a file sufficient permissions to be executed by nobody + is to give everyone execute permission on the file:

+ +

+ chmod a+x first.pl +

+ +

Also, if your program reads from, or writes to, any other + files, those files will need to have the correct permissions + to permit this.

+ + + +

Path information and environment

+ + +

When you run a program from your command line, you have + certain information that is passed to the shell without you + thinking about it. For example, you have a PATH, + which tells the shell where it can look for files that you + reference.

+ +

When a program runs through the web server as a CGI program, + it may not have the same PATH. Any programs that you + invoke in your CGI program (like sendmail, for + example) will need to be specified by a full path, so that the + shell can find them when it attempts to execute your CGI + program.

+ +

A common manifestation of this is the path to the script + interpreter (often perl) indicated in the first + line of your CGI program, which will look something like:

+ +

+ #!/usr/bin/perl +

+ +

Make sure that this is in fact the path to the + interpreter.

+ +

In addition, if your CGI program depends on other environment variables, you will need to + assure that those variables are passed by Apache.

+ + + +

Program errors

+ + +

Most of the time when a CGI program fails, it's because of + a problem with the program itself. This is particularly true + once you get the hang of this CGI stuff, and no longer make + the above two mistakes. The first thing to do is to make + sure that your program runs from the command line before + testing it via the web server. For example, try:

+ +

+ cd /usr/local/apache2/cgi-bin
+ ./first.pl +

+ +

(Do not call the perl interpreter. The shell + and Apache should find the interpreter using the path information on the first line of + the script.)

+ +

The first thing you see written by your program should be + a set of HTTP headers, including the Content-Type, + followed by a blank line. If you see anything else, Apache will + return the Premature end of script headers error if + you try to run it through the server. See Writing a CGI program above for more + details.

+ + +

Error logs

+ + +

The error logs are your friend. Anything that goes wrong + generates message in the error log. You should always look + there first. If the place where you are hosting your web site + does not permit you access to the error log, you should + probably host your site somewhere else. Learn to read the + error logs, and you'll find that almost all of your problems + are quickly identified, and quickly solved.

+ + +

Suexec

+ + +

The suexec support program + allows CGI programs to be run under different user permissions, + depending on which virtual host or user home directory they are + located in. Suexec has very strict permission checking, and any + failure in that checking will result in your CGI programs + failing with Premature end of script headers.

+ +

To check if you are using suexec, run apachectl + -V and check for the location of SUEXEC_BIN. + If Apache finds an suexec binary there on startup, + suexec will be activated.

+ +

Unless you fully understand suexec, you should not be using it. + To disable suexec, simply remove (or rename) the suexec + binary pointed to by SUEXEC_BIN and then restart the + server. If, after reading about suexec, + you still wish to use it, then run suexec -V to find + the location of the suexec log file, and use that log file to + find what policy you are violating.

+ +
top
+
+

What's going on behind the scenes?

+ + +

As you become more advanced in CGI programming, it will + become useful to understand more about what's happening behind + the scenes. Specifically, how the browser and server + communicate with one another. Because although it's all very + well to write a program that prints "Hello, World.", it's not + particularly useful.

+ +

Environment variables

+ + +

Environment variables are values that float around you as + you use your computer. They are useful things like your path + (where the computer searches for the actual file + implementing a command when you type it), your username, your + terminal type, and so on. For a full list of your normal, + every day environment variables, type + env at a command prompt.

+ +

During the CGI transaction, the server and the browser + also set environment variables, so that they can communicate + with one another. These are things like the browser type + (Netscape, IE, Lynx), the server type (Apache, IIS, WebSite), + the name of the CGI program that is being run, and so on.

+ +

These variables are available to the CGI programmer, and + are half of the story of the client-server communication. The + complete list of required variables is at + http://hoohoo.ncsa.uiuc.edu/cgi/env.html.

+ +

This simple Perl CGI program will display all of the + environment variables that are being passed around. Two + similar programs are included in the + cgi-bin + + directory of the Apache distribution. Note that some + variables are required, while others are optional, so you may + see some variables listed that were not in the official list. + In addition, Apache provides many different ways for you to + add your own environment variables + to the basic ones provided by default.

+ +

+ #!/usr/bin/perl
+ print "Content-type: text/html\n\n";
+ foreach $key (keys %ENV) {
+ + print "$key --> $ENV{$key}<br>";
+
+ } +

+ + +

STDIN and STDOUT

+ + +

Other communication between the server and the client + happens over standard input (STDIN) and standard + output (STDOUT). In normal everyday context, + STDIN means the keyboard, or a file that a + program is given to act on, and STDOUT + usually means the console or screen.

+ +

When you POST a web form to a CGI program, + the data in that form is bundled up into a special format + and gets delivered to your CGI program over STDIN. + The program then can process that data as though it was + coming in from the keyboard, or from a file

+ +

The "special format" is very simple. A field name and + its value are joined together with an equals (=) sign, and + pairs of values are joined together with an ampersand + (&). Inconvenient characters like spaces, ampersands, and + equals signs, are converted into their hex equivalent so that + they don't gum up the works. The whole data string might look + something like:

+ +

+ name=Rich%20Bowen&city=Lexington&state=KY&sidekick=Squirrel%20Monkey +

+ +

You'll sometimes also see this type of string appended to + a URL. When that is done, the server puts that string + into the environment variable called + QUERY_STRING. That's called a GET + request. Your HTML form specifies whether a GET + or a POST is used to deliver the data, by setting the + METHOD attribute in the FORM tag.

+ +

Your program is then responsible for splitting that string + up into useful information. Fortunately, there are libraries + and modules available to help you process this data, as well + as handle other of the aspects of your CGI program.

+ +
top
+
+

CGI modules/libraries

+ + +

When you write CGI programs, you should consider using a + code library, or module, to do most of the grunt work for you. + This leads to fewer errors, and faster development.

+ +

If you're writing CGI programs in Perl, modules are + available on CPAN. The most + popular module for this purpose is CGI.pm. You might + also consider CGI::Lite, which implements a minimal + set of functionality, which is all you need in most programs.

+ +

If you're writing CGI programs in C, there are a variety of + options. One of these is the CGIC library, from + http://www.boutell.com/cgic/.

+
top
+
+

For more information

+ + +

There are a large number of CGI resources on the web. You + can discuss CGI problems with other users on the Usenet group + comp.infosystems.www.authoring.cgi. And the -servers mailing + list from the HTML Writers Guild is a great source of answers + to your questions. You can find out more at + http://www.hwg.org/lists/hwg-servers/.

+ +

And, of course, you should probably read the CGI + specification, which has all the details on the operation of + CGI programs. You can find the original version at the + NCSA and there is an updated draft at the + Common Gateway + Interface RFC project.

+ +

When you post a question about a CGI problem that you're + having, whether to a mailing list, or to a newsgroup, make sure + you provide enough information about what happened, what you + expected to happen, and how what actually happened was + different, what server you're running, what language your CGI + program was in, and, if possible, the offending code. This will + make finding your problem much simpler.

+ +

Note that questions about CGI problems should never + be posted to the Apache bug database unless you are sure you + have found a problem in the Apache source code.

+
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/cgi.html.ja.euc-jp b/docs/manual/howto/cgi.html.ja.euc-jp new file mode 100644 index 00000000..6740c653 --- /dev/null +++ b/docs/manual/howto/cgi.html.ja.euc-jp @@ -0,0 +1,549 @@ + + + +Apache Tutorial: CGI による動的コンテンツ - Apache HTTP サーバ + + + + + +
<-
+
+Apache > HTTP サーバ > ドキュメンテーション > バージョン 2.2 > How-To / チュートリアル

Apache Tutorial: CGI による動的コンテンツ

+
+

Available Languages:  en  | + ja  | + ko 

+
+
This translation may be out of date. Check the + English version for recent changes.
+
+ +
top
+
+

はじめに

+ + + + +

CGI (Common Gateway Interface) は、ウェブサーバが + コンテンツ生成をする外部プログラムと協調して動作するための方法を + 定義しています。そのプログラムはしばしば CGI プログラムや + CGI スクリプトと呼ばれます。CGI は、ウェブサイトに動的な + コンテンツを置くための最も簡単で一般的な方法です。このドキュメントは、 + Apache ウェブサーバで CGI を設定し、 + CGI プログラムを書き始めるための入門書となるでしょう。

+
top
+
+

CGI を許可するように Apache を設定する

+ + +

CGI プログラムを正しく動作させるには、CGI を許可するように + Apache の設定を行う必要があります。 + これを行なうための方法がいくつかあります。

+ +

ScriptAlias

+ + +

ScriptAlias + ディレクティブを使用して、 + CGI プログラム用の特別な別ディレクトリを Apache に設定します。 + Apache は、このディレクトリ中の全てのファイルを CGI + プログラムであると仮定します。 + そして、この特別なリソースがクライアントから要求されると、 + そのプログラムの実行を試みます。

+ +

ScriptAlias + ディレクティブは以下のように使用します:

+ +

+ ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ +

+ +

デフォルト位置に Apache をインストールしたならば、 + この例はデフォルト状態の httpd.conf + 設定ファイルに含まれています。 + ScriptAlias + ディレクティブは、URL の前に付加するディレクトリを定義する + Alias + ディレクティブとかなり似ています。 + AliasScriptAlias + は通常、DocumentRoot + ディレクトリ外のディレクトリのために使用されます。 + AliasScriptAlias + との差は、ScriptAlias が接頭辞で始まるすべての + URL は CGI プログラムとみなされるという追加の意味を含んでいることです。 + 従って、上記の例では、/cgi-bin/ + で始まるリソースへのあらゆるリクエストに対して、ディレクトリ + /usr/local/apache2/cgi-bin/ から提供し、それらを + CGI プログラムとして扱うよう Apache に示します。

+ +

例えば、URL http://www.example.com/cgi-bin/test.pl + が要求された場合、Apache は ファイル + /usr/local/apache2/cgi-bin/test.pl + を実行し、その出力を返すことを試みます。 + もちろん、ファイルが存在し、実行可能であり、決められた方法で出力を返します。 + そうでなければ、Apache はエラーメッセージを返します。

+ + +

ScriptAlias ディレクトリ外の CGI

+ + +

CGI プログラムは、セキュリティ上の理由から + ScriptAlias + されたディレクトリに制限されることがしばしばあります。この方法により、 + CGI プログラムを使用できるユーザを管理者が厳しく制御することができます。 + しかしながら、適切なセキュリティ事前対策がとられるならば、CGI + プログラムを任意のディレクトリで実行できないようにする理由はありません。 + 例えば、ユーザに UserDir + ディレクティブで彼らのホームディレクトリ配下にウェブコンテンツを持たせたいとします。 + もし、彼らが CGI プログラムを持つことを望んでいても、メインの + cgi-bin ディレクトリへのアクセスができない場合、 + CGI プログラムを実行することができる他の場所が必要になります。

+ +

任意のディレクトリで CGI の実行を許可するには二段階の設定が必要です。 + まず、AddHandlerSetHandler ディレクティブによって + cgi-script ハンドラが可能になっている必要があります。 + 次に、Options ディレクティブで + ExecCGI が指定されていなければなりません。

+ + +

CGI の実行を可能にするために Options を明示的に使用する

+ + +

サーバのメインの設定ファイル中で Options + ディレクティブを明示的に使用することで、特定のディレクトリ配下で + CGI の実行を許可するように指定することができます:

+ +

+ <Directory /usr/local/apache2/htdocs/somedir>
+ + Options +ExecCGI
+
+ </Directory> +

+ +

上記ディレクティブは、CGI ファイルの実行を可能にするよう + Apache に伝えます。また、どのファイルが CGI ファイルかを + サーバに伝える必要があります。次の + AddHandler + ディレクティブの例では、cgi または pl + を拡張子に持つすべてのファイルを CGI + プログラムとしてみなすことをサーバに伝えます:

+ +

+ AddHandler cgi-script .cgi .pl +

+ + +

.htaccess ファイル

+ + +

.htaccess チュートリアル + は httpd.conf を変更できない場合にどうやって CGI プログラムを + 使えるようにするかを説明しています。

+ + +

User ディレクトリ

+ + +

.cgi で終わるすべてのファイルに対して CGI プログラムの + 実行を許可するには、以下の設定を使用できます。

+ +

+ <Directory /home/*/public_html>
+ + Options +ExecCGI
+ AddHandler cgi-script .cgi
+
+ </Directory> +

+ +

ユーザディレクトリの cgi-bin サブディレクトリの + すべてのファイルを CGI プログラムとして指定したい場合には + 以下のようなものを使います。

+ +

+ <Directory /home/*/public_html/cgi-bin>
+ + Options ExecCGI
+ SetHandler cgi-script
+
+ </Directory> +

+ + +
top
+
+

CGI プログラムを書く

+ + +

「通常の」プログラミングと CGI + プログラミングの間には主に二つの違いがあります。

+ +

一つは、CGI プログラムのすべての出力には MIME-type + ヘッダを付けなければなりません。 + これはどのような種類のコンテンツを受け取っているかをクライアントに示す + HTTP ヘッダです。ほとんどの場合では、次のように出力します:

+ +

+ Content-type: text/html +

+ +

もう一つは、出力を HTML + か、ブラウザが表示することができる何か他の形式にする必要があります。 + 大抵の場合は HTML でしょうが、GIF イメージや他の非 HTML + コンテンツを出力する CGI プログラムを書くこともあるでしょう。

+ +

これら二点以外では、CGI プログラムを書くことは、 + あなたが書いている他のプログラムとよく似ているでしょう。

+ +

最初の CGI プログラム

+ + +

次に示すのは、ブラウザに 1 行印字する CGI + プログラムの例です。以下を入力し、first.pl + というファイルに保存し、それを cgi-bin + ディレクトリに置いてください。

+ +

+ #!/usr/bin/perl
+ print "Content-type: text/html\n\n";
+ print "Hello, World."; +

+ +

Perl に精通していなくても、 + 何が起こるかを理解することはできるでしょう。1 行目は、 + /usr/bin/perl で見つけられるインタプリタに + このファイルを供給することでこのプログラムが実行されることを + Apache に (シェル上で実行しようとしているならば、そのシェルに ) + 示します。2 行目は、前述したとおり content-type の定義を印字します。 + これには復帰改行の二つの組を後に付加します。 + これにより、ヘッダの終りに空行が置かれ、HTTP + ヘッダの終りとボディの始まりを示します。3 行目は、"Hello, World." + という文字列を印字し、これで終りとなります。

+ +

好みのブラウザを開き、アドレス

+ +

+ http://www.example.com/cgi-bin/first.pl +

+ +

あるいはファイルを置いたロケーションを指定すると、 + Hello, World. + という 1 行がブラウザウィンドに現れるでしょう。 + それはあまりエキサイティングなことではありません。 + しかし、これがうまく動けば、 + 他のどのようなものでも動かすことができるようになります。

+ +
top
+
+

しかし、まだ動かない !

+ + +

ウェブから CGI プログラムへのアクセスを行なったとき、 + ブラウザで見る可能性がある四つの基本的なことがあります:

+ +
+
CGI プログラムの出力
+
素晴らしい ! それはすべてがうまく動いたことを意味します。 + 出力が正常だけれども、ブラウザが正常に処理してくれない場合は、 + 正しい Content-Type を CGI プログラム内で + セットしたかを確認してください。
+ +
CGI プログラムのソースコード、または "POST Method Not Allowed" + というメッセージ
+
これは、CGI プログラムを処理できるよう Apache + を適切に設定していなかったことを意味します。「CGI を許可するように + Apache を設定する」の章を読み直し、 + あなたが何を間違えたかを探してみてください。 +
+ +
メッセージが "Forbidden" で始まっている
+
これはパーミッションの問題ということを意味します。 + Apache のエラーログと、後述の「ファイルのパーミッション」 + の章をチェックしてください。 +
+ +
"Internal Server Error" というメッセージ
+
Apache + のエラーログをチェックすると、"Premature end of script headers" + というログが記録されていると思います。そして、おそらく CGI + プログラムによって生成されたエラーメッセージも記録されているでしょう。 + この場合、CGI プログラムが適切な + HTTP ヘッダを出力できない原因を知るために、 + 以下の各章でチェックしてみてください。
+
+ +

ファイルのパーミッション

+ + +

サーバはあなたの権限で実行されていないのを忘れないように。 + つまり、起動するとき、サーバは特権をもたないユーザ - 通常 nobody + や www の権限で実行されます。したがって、あなたが所有する + ファイルを実行するには別のパーミッションが必要となります。 + 通常、nobody が実行するのに十分なパーミッションを与える方法は、 + ファイルに誰でも実行可能とするパーミッションを与えることです:

+ +

+ chmod a+x first.pl +

+ +

また、もしあなたのプログラムが他のファイルを読み書きするならば、 + それらのファイルは、これが可能となる正しいパーミッション + を持っている必要があります。

+ + + +

パス情報と環境

+ + +

コマンドラインからプログラムを実行するとき、 + 意識しなくてもシェルに渡される情報があります。 + 例えば、参照するファイルのためにどこを検索したらよいかを + シェルに伝える PATH があります。

+ +

プログラムが CGI プログラムとしてウェブサーバによって実行されるとき、 + それは同じ PATH ではないかもしれません。 + CGI プログラム内で呼び出すあらゆるプログラム + (例えば、sendmail のようなもの) は、 + フルパスで指定する必要があるでしょう。それにより、CGI + プログラムを実行しようとしたとき、 + シェルはそのようなプログラムを見つけることができます。

+ +

同様なことは、スクリプトのインタプリタ (しばしば perl) + へのパスで、CGI プログラムの 1 行目に次のように示されます:

+ +

+ #!/usr/bin/perl +

+ +

これがインタープリタへの実際のパスであることを確認しておきます。

+ + +

また、CGI プログラムが他の環境変数に依存している場合は、その環境変数が + Apache から渡されるようにする必要があります。

+ +

プログラムエラー

+ + +

CGI + プログラムが失敗するのは大抵、プログラム自身に問題がある場合です。 + 一度 CGI の使い方を理解し、前述の二つの誤りを犯していないならば、 + まず間違いなくそうでしょう。ブラウザを使ってテストする前に + まず確認することは、コマンドラインからプログラムが実行できることです。 + 例えば、以下を実行してみてください:

+ +

+ cd /usr/local/apache2/cgi-bin
+ ./first.pl +

+ +

(perl インタプリタは呼ばないでください。 + シェルと Apache がスクリプトの最初の行の パス情報 を使って見つけます。)

+ +

最初にプログラムから出力されるのは Content-Type を含み、 + 後に空行の続く HTTP ヘッダでなければなりません。他のものが出力されている + 場合は、Apache はこのプログラムをサーバ経由で実行しようとしたときには + Premature end of script headers エラーを出力します。詳細は + 上記の CGI プログラムを書く を読んでください。

+ + +

エラーログ

+ + +

エラーログは友達です。 + 全てのうまくいかないことは、エラーログにメッセージを生成します。 + 必ずそれを最初に見るべきです。 + もし、あなたがウェブサイトを主催している場所が + エラーログの参照を許していないならば、きっと他のサイトで主催するべきです。 + エラーログの読み方を学ぶことで、ほとんど全ての問題が迅速に確認され、 + 迅速に解決されるということが分かるでしょう。

+ + +

Suexec

+ + +

suexec サポートプログラムは + バーチャルホストやユーザのホームディレクトリの場所に依って + CGI プログラムを違うユーザ権限の下で走らせることを可能にします。 + Suexec の権限のチェックは非常に厳しく、それを満たさない場合は + CGI プログラムが Premature end of script headers エラーで + 実行されません。

+ +

suexec を使っているかどうかを調べためには apachectl + -V を実行して、SUEXEC_BIN の場所を調べてください。 + Apache がそこに suexec のバイナリを発見した場合は、suexec が + 使用されます。

+ +

suexec を完全に理解していない限り、使うべきではありません。 + suexec を無効にするには、SUEXEC_BIN から指されている + suexec バイナリを削除 (か名前を変更) するだけです。 + suexec を読んだ後で、まだそれを + 使いたいのであれば、suexec -V を実行して suexec の + ログファイルの位置を調べ、そのログファイルを使ってポリシー違反を + 見つけてください。

+ +
top
+
+

裏で何が起こっているのか?

+ + +

CGI プログラミングに習熟すると、 + 裏で起こっていることについて更に理解することの役に立ちます。 + ブラウザとサーバがどのように相互通信するかについては特にそうです。 + なぜなら、"Hello, World." + を印字するプログラムを書くことはおおいに結構ですが、 + それは特に有益ではありません。

+ +

環境変数

+ + +

環境変数は、 + あなたがコンピュータを使うときに辺りに存在している値です。 + それらは、パス + (コマンドをタイプしたときに実行する実際のファイルを探し出すところ)、 + ユーザ名、端末型などのような便利なものです。 + 通常、普段使用している環境変数の完全なリストを調べるには、 + コマンドプロンプトで env を入力します。

+ +

CGI の処理中、サーバとブラウザも環境変数を設定し、 + それにより相互に通信することができるようになります。 + その環境変数は、ブラウザタイプ (Netscape, IE, Lynx)、サーバタイプ + (Apache, IIS, WebSite)、実行されている CGI + プログラムの名前などです。

+ +

これらの変数は CGI プログラマが使用できます。 + そして、それはクライアントとサーバの通信の話の半分です。 + 必要な変数の完全なリストは http://hoohoo.ncsa.uiuc.edu/cgi/env.html にあります。

+ +

以下の単純な Perl CGI + プログラムは、渡される全ての環境変数を表示します。同様のプログラムは、 + Apache ディストリビューションの cgi-bin + ディレクトリに二つ含まれています。 + いくつかの変数が必須であり、いくつかは任意であることに注意してください。 + そして、公式のリストにはないいくつかの変数が表示されているかもしれません。 + さらに、Apache はデフォルトで用意されている基本的なものに + あなた自身の環境変数を加えるための、 + 多くの異なる方法を用意してします。

+ +

+ #!/usr/bin/perl
+ print "Content-type: text/html\n\n";
+ foreach $key (keys %ENV) {
+ + print "$key --> $ENV{$key}<br>";
+
+ } +

+ + +

STDIN と STDOUT

+ + +

サーバとクライアント間のもう一つの通信は、標準入力 + (STDIN)と標準出力 (STDOUT) + を通じて行なわれます。通常の文脈において、STDIN + はキーボードやプログラムが動作するために与えられるファイルを意味し、 + STDOUT は通常コンソールまたはスクリーンを意味します。

+ +

ウェブフォームから CGI プログラムへPOST + したとき、フォームのデータは特別なフォーマットで束ねられ、 + STDIN を通して、CGI プログラムに引き渡されます。 + プログラムはデータがキーボード + もしくはファイルから来ていたかのように処理することができます。

+ +

「特別なフォーマット」はとても単純です。フィールド名と値はイコール + (=) で結ばれます。そして値の組はアンパサンド (&) で結ばれます。 + スペース、アンパサンド、イコールのような面倒な文字は、 + それらが動作を駄目にしないようにその文字に相当する 16 進に変換されます。 + 全データ文字列は、以下のようになります: +

+ +

+ name=Rich%20Bowen&city=Lexington&state=KY&sidekick=Squirrel%20Monkey +

+ +

時々、このような文字列が URL + に付加されるのを見るでしょう。その場合、サーバは + QUERY_STRING という環境変数にその文字列を入れます。それは + GET リクエストと呼ばれます。 + HTML フォームでは、データを渡すために GET と + POST のどちらを使用するかを、FORM タグの + METHOD 属性の設定で指定します。

+ +

CGI プログラムは、その文字列を役に立つ情報に分割する責任があります。 + 幸いにも、そのデータ処理を助けるライブラリやモジュールが存在します。 + これらは、CGI プログラムの他の面でも同様に役に立ちます。

+ +
top
+
+

CGI モジュール/ライブラリ

+ + +

CGI プログラムを書くとき、面倒な仕事の大部分をしてくれる + コードライブラリまたはモジュールを使うことを検討すべきです。 + これはエラーを減らし、早い開発につながります。

+ +

Perl で CGI プログラムを書いているなら、モジュールは CPAN で提供されています。 + この目的のための最も普及しているモジュールは CGI.pm です。 + CGI::Lite も検討しましょう。これは、ほとんどのプログラム + において必要とするすべての機能の最小セットの実装です。

+ +

C で CGI プログラムを書いているなら、いろいろな + オプションがあります。これらの内の一つは http://www.boutell.com/cgic/ + で提供されている CGIC ライブラリです。

+
top
+
+

更なる情報

+ + +

CGI に関する情報はウェブで数多く提供されています。CGI + の問題については Usenet の comp.infosystems.www.authoring.cgi で、 + 他のユーザと論議することができます。HTML Writers Guide の + -servers メーリングリストは、あなたの質問に回答してくれる偉大なリソースです。 + http://www.hwg.org/lists/hwg-servers/ + で更に多くを探し出すことができます。

+ +

そしてもちろん、おそらく CGI + プログラムの動作に関する詳細の全てが記述されている + CGI の仕様を読むべきです。オリジナルバージョンを + NCSA + で、アップデートされたドラフトを + Common Gateway Interface RFC + プロジェクトで参照することができます。

+ +

CGI の問題について、加わっているメーリングリストまたはニュース + グループに質問を送るとき、起こったもの、起こってほしいこと、 + 実際に起こったことがどう違うか、使用しているサーバ、 + CGI プログラムを記述している言語に関する十分な情報と、 + 可能であれば問題のコードを提供するようにしてください。 + そうすることで、問題がより間単に見つかるようになります。

+ +

Apache のソースコードにおいて問題を発見したことを確信していない限り、 + CGI の問題に関する質問を Apache + バグデータベースに送るべきでない + ことに注目してください。

+
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/cgi.html.ko.euc-kr b/docs/manual/howto/cgi.html.ko.euc-kr new file mode 100644 index 00000000..da8c9bad --- /dev/null +++ b/docs/manual/howto/cgi.html.ko.euc-kr @@ -0,0 +1,503 @@ + + + +焼督帖 燈塘軒杖: CGI研 紫遂廃 疑旋 凪戚走 持失 - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

焼督帖 燈塘軒杖: CGI研 紫遂廃 疑旋 凪戚走 持失

+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+
戚 庚辞澗 置重毒 腰蝕戚 焼鑑艦陥. + 置悦拭 痕井吉 鎧遂精 慎嬢 庚辞研 凧壱馬室推.
+
+ +
top
+
+

社鯵

+ + + + +

CGI (Common Gateway Interface)澗 瀬辞獄亜 左搭 CGI 覗稽益轡 + 箸精 CGI 什滴験闘虞壱 採牽澗, (瀬凪戚走 鎧遂聖 幻球澗) 須採 + 覗稽益轡引 搭重馬澗 号狛聖 舛税廃陥. 瀬紫戚闘拭辞 疑旋昔 + 凪戚走研 幻球澗 亜舌 泌馬壱 娃舘廃 号狛戚陥. 戚 庚辞澗 焼督帖 + 瀬辞獄拭 CGI研 姥失馬澗 号狛聖 社鯵馬壱, CGI 覗稽益轡聖 + 拙失背沙陥.

+
top
+
+

CGI研 買遂馬亀系 焼督帖 竺舛馬奄

+ + +

CGI 覗稽益轡戚 臣郊稽 疑拙馬形檎 CGI 叔楳戚 亜管馬亀系 + 焼督帖研 竺舛背醤 廃陥. 竺舛馬澗 号狛精 食君亜走陥.

+ +

ScriptAlias

+ + +

ScriptAlias + 走獣嬢研 紫遂馬檎 焼督帖澗 働舛 巨刑塘軒研 CGI 覗稽益轡遂生稽 + 黍陥. 焼督帖澗 戚 巨刑塘軒拭 赤澗 乞窮 督析戚 CGI + 覗稽益轡戚虞壱 亜舛馬食 適虞戚情闘亜 切据聖 推短馬檎 切据聖 + 叔楳馬形壱 獣亀廃陥.

+ +

ScriptAlias + 走獣嬢澗 陥製引 旭戚 紫遂廃陥.

+ +

+ ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ +

+ +

是 森薦澗 焼督帖研 奄沙 舌社拭 竺帖廃 井酔 + httpd.conf 竺舛督析拭 赤澗 鎧遂戚陥. ScriptAlias 走獣嬢澗 Alias 走獣嬢人 旭戚 URL + 蒋採歳聖 働舛 巨刑塘軒稽 企誓廃陥. + Alias人 + ScriptAlias澗 左搭 DocumentRoot 巨刑塘軒 鉱拭 赤澗 + 巨刑塘軒拭 紫遂廃陥. Alias人 + ScriptAlias税 託戚繊精 + ScriptAlias亜 蓄亜稽 URL 蒋採歳生稽 + 獣拙馬澗 乞窮 督析聖 CGI 覗稽益轡生稽 昼厭馬澗 繊戚陥. + 益掘辞 是税 竺舛精 焼督帖拭惟 /cgi-bin/生稽 + 獣拙馬澗 切据聖 推短馬檎 + /usr/local/apache2/cgi-bin/ 巨刑塘軒拭辞 + 達焼辞 CGI 覗稽益轡生稽 坦軒馬虞壱 硝鍵陥.

+ +

森研 級嬢, URL + http://www.example.com/cgi-bin/test.pl聖 + 推短馬檎 焼督帖澗 + /usr/local/apache2/cgi-bin/test.pl 督析聖 + 叔楳馬食 衣引研 鋼発廃陥. 弘経 督析戚 糎仙馬壱 叔楳亜管馬悟 + 嬢恐 号狛生稽窮 窒径聖 背醤 廃陥. 益係走 省生檎 焼督帖澗 + 神嫌庚聖 左浬陥.

+ + +

ScriptAlias 巨刑塘軒 鉱拭 赤澗 CGI

+ + +

左搭 左照雌 戚政凶庚拭 CGI 覗稽益轡精 ScriptAlias廃 巨刑塘軒拭 + 廃舛廃陥. 益掘辞 淫軒切澗 刊亜 CGI 覗稽益轡聖 紫遂拝 呪 + 赤澗走 畳維備 姶偽拝 呪 赤陥. 益君蟹 旋雁廃 左照繕帖研 + 昼梅陥檎 焼巷 巨刑塘軒拭辞蟹 CGI 覗稽益轡聖 叔楳馬走 省聖 + 戚政亜 蒸陥. 森研 級嬢, UserDir 走獣嬢研 紫遂馬食 + 紫遂切亜 切重税 幡巨刑塘軒拭 瀬凪戚走研 亜走澗 井酔研 + 亜舛馬切. 紫遂切亜 切重税 CGI 覗稽益轡聖 紫遂馬壱 粛精汽 + cgi-bin 巨刑塘軒拭 羨悦映廃戚 蒸陥檎, 陥献 + 員拭辞虞亀 CGI 覗稽益轡聖 叔楳馬壱 粛聖 依戚陥.

+ +

焼巷 巨刑塘軒拭辞蟹 CGI 叔楳聖 買遂馬形檎 砧 引舛戚 + 琶推馬陥. 胡煽, AddHandlerSetHandler 走獣嬢研 紫遂馬食 + cgi-script 輩級君研 拙疑背醤 廃陥. 砧腰属稽, + Options 走獣嬢拭 + ExecCGI研 走舛背醤 廃陥.

+ + +

Options研 紫遂馬食 誤獣旋生稽 CGI 叔楳聖 買遂馬奄

+ + +

辞獄税 爽竺舛督析拭 送羨 Options 走獣嬢研 紫遂馬食 働舛 + 巨刑塘軒拭辞 CGI 叔楳聖 買遂拝 呪 赤陥.

+ +

+ <Directory /usr/local/apache2/htdocs/somedir>
+ + Options +ExecCGI
+
+ </Directory> +

+ +

是 走獣嬢稽 焼督帖澗 CGI 督析税 叔楳聖 買遂廃陥. 嬢恐 + 督析戚 CGI 督析昔走亀 辞獄拭惟 硝形醤 廃陥. 陥製 AddHandler 走獣嬢澗 辞獄拭惟 + 溌舌切亜 cgipl昔 督析精 乞砧 + CGI 覗稽益轡戚虞壱 硝鍵陥.

+ +

+ AddHandler cgi-script .cgi .pl +

+ + +

.htaccess 督析

+ + +

.htaccess 燈塘軒杖精 + httpd.conf拭 羨悦映廃戚 蒸澗 井酔拭 CGI 覗稽益轡聖 + 紫遂拝 呪 赤澗 号狛聖 硝形層陥.

+ + +

紫遂切 巨刑塘軒

+ + +

焼掘 竺舛聖 紫遂馬檎 紫遂切 巨刑塘軒拭辞 .cgi稽 + 魁蟹澗 督析聖 CGI 覗稽益轡生稽 叔楳廃陥.

+ +

+ <Directory /home/*/public_html>
+ + Options +ExecCGI
+ AddHandler cgi-script .cgi
+
+ </Directory> +

+ +

陥製聖 紫遂馬檎 紫遂切 巨刑塘軒税 cgi-bin + 馬是巨刑塘軒拭 赤澗 乞窮 督析聖 CGI 覗稽益轡生稽 昔縦廃陥.

+ +

+ <Directory /home/*/public_html/cgi-bin>
+ + Options ExecCGI
+ SetHandler cgi-script
+
+ </Directory> +

+ + + +
top
+
+

CGI 覗稽益轡 拙失馬奄

+ + +

``析鋼旋昔'' 覗稽益掘講引 CGI 覗稽益掘講 紫戚拭澗 砧亜走 + 爽吉 託戚繊戚 赤陥.

+ +

湛腰属 託戚澗 CGI 覗稽益轡精 陥献 窒径聖 馬奄穿拭 胡煽 + MIME-type 伯希研 窒径背醤 廃陥澗 繊戚陥. HTTP 伯希澗 + 適虞戚情闘拭惟 適虞戚情闘亜 嬢恐 鎧遂聖 閤惟吃走 耕軒 硝鍵陥. + 左搭 陥製引 旭陥.

+ +

+ Content-type: text/html +

+ +

砧腰属 託戚澗 HTML 箸精 崎虞酔煽亜 左食匝 呪 赤澗 莫縦生稽 + 窒径背醤 廃陥澗 繊戚陥. 企採歳税 井酔 HTML聖 窒径馬走幻, + 凶凶稽 gif 益顕引 旭戚 HTML戚 焼観 鎧遂聖 窒径馬澗 CGI + 覗稽益轡聖 拙失馬澗 井酔亀 赤陥.

+ +

砧亜走研 薦須馬壱澗 CGI 覗稽益轡 拙失精 戚耕 幻級嬢 左紹聖 + 陥献 覗稽益轡級引 古酔 搾汁馬陥.

+ +

坦製生稽 幻窮 CGI 覗稽益轡

+ + +

陥製精 崎虞酔煽拭 廃 匝聖 啄澗 CGI 覗稽益轡 森薦陥. + 益企稽 first.pl戚虞澗 督析拭 煽舌馬壱, + cgi-bin 巨刑塘軒拭 差紫廃陥.

+ +

+ #!/usr/bin/perl
+ print "Content-type: text/html\n\n";
+ print "Hello, World."; +

+ +

Perl拭 斥寿馬走 省希虞亀 巷充 析戚 析嬢蟹澗走 硝 呪 + 赤陥. 湛腰属 匝精 焼督帖(箸精 紫遂馬澗 秋)拭惟 + /usr/bin/perl 是帖拭 赤澗 昔斗覗軒斗聖 紫遂馬食 + 戚 覗稽益轡 督析聖 叔楳馬虞壱 硝鍵陥. 砧腰属 匝精 号榎 + 源廃 content-type 識情聖 窒径馬壱 carriage-return 匝郊嘩聖 + 砧腰 窒径廃陥. 益君檎 伯希 及拭 HTTP 伯希税 魁聖 倶馬澗 + 朔匝戚 持奄壱, 沙庚戚 獣拙廃陥. 室腰属 匝精 "Hello, World." + 庚切伸聖 窒径廃陥. 戚依生稽 魁戚陥.

+ +

崎虞酔煽研 叔楳馬壱 爽社研 脊径廃陥

+ +

+ http://www.example.com/cgi-bin/first.pl +

+ +

督析 舌社研 脊径馬檎, 崎虞酔煽但拭 Hello, World. + 廃 匝戚 左昔陥. 被歳鞠走澗 省走幻, 廃腰 疑拙馬澗 依聖 + 左紹生艦 戚薦 陥献 依聖 獣亀背 瑳 呪 赤陥.

+ +
top
+
+

益君蟹 焼送 疑拙馬走 省焼推!

+ + +

瀬拭辞 CGI 覗稽益轡拭 羨悦拝凶 崎虞酔煽拭 蟹臣 呪 赤澗 + 鎧遂精 奄沙旋生稽 革亜走陥.

+ +
+
CGI 覗稽益轡税 窒径
+
疏陥! 乞窮 依戚 設 疑拙廃陥澗 倶戚陥. 窒径精 舛溌馬走幻 + 崎虞酔煽亜 臣郊稽 坦軒馬走 公廃陥檎, CGI 覗稽益轡拭辞 + 臣郊献 Content-Type聖 竺舛馬心澗走 溌昔廃陥.
+ +
CGI 覗稽益轡 社什坪球 箸精 "POST Method Not Allowed" + 庚姥
+
CGI 覗稽益轡聖 叔楳馬亀系 焼督帖研 旋箭備 竺舛馬走 + 省紹陥澗 倶戚陥. 焼督帖 竺舛馬奄 + 箭聖 陥獣 石壱 皐股精 採歳戚 赤澗走 達焼坐虞.
+ +
"Forbidden"生稽 獣拙馬澗 庚姥
+
映廃 庚薦亜 赤陥澗 倶戚陥. 焼督帖 + 神嫌 稽益人 焼掘 督析映廃 + 箭聖 溌昔馬虞.
+ +
"Internal Server Error"虞澗 庚姥
+
焼督帖 神嫌 稽益研 左檎 焼原亀 + CGI 覗稽益轡戚 窒径廃 神嫌庚引 敗臆 "Premature end of + script headers"亜 左析 依戚陥. 戚 井酔 焼掘 鎧遂級聖 馬蟹梢 + 溌昔馬食 嬢恐 戚政稽 CGI 覗稽益轡戚 旋箭廃 HTTP 伯希研 + 窒径馬走 公梅澗走 硝焼沙陥.
+
+ +

督析映廃

+ + +

辞獄澗 雁重引 疑析廃 域舛生稽 疑拙馬走 省製聖 誤宿馬虞. + 聡, 辞獄亜 獣拙馬檎 辞獄澗 搾働映 紫遂切 映廃(左搭 + nobodywww)生稽 疑拙廃陥. + 益掘辞 雁重戚 社政廃 督析聖 叔楳馬形檎 映廃戚 琶推馬陥. + 督析拭 nobody亜 叔楳馬奄拭 中歳廃 映廃聖 + 爽奄是背 左搭 乞砧拭惟 督析税 叔楳 映廃聖 層陥.

+ +

+ chmod a+x first.pl +

+ +

暁, 覗稽益轡戚 陥献 督析聖 石暗蟹 彰陥檎 戚 督析拭亀 + 旋箭廃 映廃戚 琶推馬陥.

+ + + +

井稽 舛左人 発井

+ + +

誤敬楳拭辞 覗稽益轡聖 叔楳馬檎 切疑生稽 嬢恐 舛左亜 + 秋稽 穿含吉陥. 森研 級嬢, PATH澗 秋拭惟 雁重戚 + 源廃 督析聖 達聖 舌社研 硝形層陥.

+ +

瀬辞獄亜 覗稽益轡聖 CGI 覗稽益轡生稽 叔楳拝凶澗 + PATH亜 陥研 呪 赤陥. (森研 級嬢, + sendmail 旭戚) CGI 覗稽益轡 照拭辞 叔楳馬澗 + 誤敬嬢澗 刃穿廃 井稽稽 誤獣背醤 秋戚 誤敬嬢研 達聖 呪 + 赤陥.

+ +

井稽 庚薦澗 陥製引 旭戚 CGI 覗稽益轡 湛腰属 匝拭 蟹神澗 + 什滴験闘 昔斗覗軒斗 (左搭 perl) 井稽拭辞 + 切爽 降持廃陥.

+ +

+ #!/usr/bin/perl +

+ +

叔薦稽 昔斗覗軒斗税 井稽昔走 溌昔廃陥.

+ +

暁, CGI 覗稽益轡戚 陥献 発井痕呪研 + 紫遂廃陥檎 焼督帖亜 戚 痕呪級聖 覗稽益轡拭惟 穿含背醤 + 廃陥.

+ + + +

覗稽益轡 神嫌

+ + +

CGI 覗稽益轡戚 叔鳶馬澗 井酔 企採歳 覗稽益轡 切端 + 庚薦凶庚戚陥. 働備 是税 砧亜走 叔呪研 馬走 省紹壱 戚 越聖 + 域紗 左壱 赤陥檎 希希錐 益係陥. 胡煽 瀬辞獄拭辞 叔楳馬奄 + 穿拭 誤敬楳拭辞 覗稽益轡聖 叔楳背沙陥. 森研 級嬢, 陥製引 + 旭戚 叔楳廃陥.

+ +

+ cd /usr/local/apache2/cgi-bin
+ ./first.pl +

+ +

(perl 昔斗覗軒斗研 叔楳馬走 原虞. 秋引 + 焼督帖澗 什滴験闘 湛腰属 匝拭 赤澗 井稽 舛左研 紫遂馬食 昔斗覗軒斗研 + 達焼醤 廃陥.)

+ +

覗稽益轡精 薦析 胡煽 Content-Type聖 匂敗廃 + HTTP 伯希級聖 窒径馬壱 朔 匝聖 窒径背醤 廃陥. 陥献 依聖 + 窒径廃陥檎 瀬辞獄拭辞 叔楳拝 井酔 焼督帖澗 Premature + end of script headers研 鋼発廃陥. 切室廃 鎧遂精 + 是税 CGI 覗稽益轡 拙失馬奄研 凧壱馬虞.

+ + +

神嫌 稽益

+ + +

神嫌 稽益澗 雁重 畷戚陥. 巷情亜 設公鞠檎 神嫌 稽益拭 + 庚姥亜 持延陥. 神嫌 稽益研 薦析 胡煽 詞縄坐醤 廃陥. 瀬紫戚闘研 + 硲什特馬澗 員拭辞 神嫌 稽益研 左走 公馬惟 廃陥檎, 焼原亀 + 陥献 穣端研 硝焼坐醤 廃陥. 神嫌 稽益研 左澗 号狛聖 斥備檎, + 企採歳税 庚薦研 察軒 督焦馬食 背衣拝 呪 赤陥.

+ + +

Suexec

+ + +

suexec 走据 覗稽益轡聖 + 紫遂馬檎 嬢恐 亜雌硲什闘 箸精 嬢恐 紫遂切 巨刑塘軒拭 赤澗走拭 + 魚虞 CGI 覗稽益轡聖 陥献 紫遂切 映廃生稽 叔楳拝 呪 赤陥. + Suexec澗 古酔 畳維馬惟 映廃聖 伊紫馬悟, 伊紫研 馬蟹虞亀 + 搭引馬走 公馬檎 CGI 覗稽益轡聖 叔楳馬走 省壱 Premature + end of script headers研 鋼発廃陥.

+ +

suexec研 紫遂馬壱 赤澗走 硝形檎 apachectl -V研 + 叔楳馬食 SUEXEC_BIN 是帖研 溌昔廃陥. 焼督帖亜 + 獣拙拝凶 益 舌社拭辞 suexec 叔楳督析聖 降胃馬檎, suexec研 + 紫遂拝 呪 赤陥.

+ +

suexec研 刃穿備 戚背馬走 公梅陥檎 紫遂背辞澗 照吉陥. + suexec研 紫遂馬走 省生形檎 SUEXEC_BIN 是帖拭 + 赤澗 suexec 叔楳督析聖 走酔壱 (箸精 督析誤聖 + 郊荷壱) 辞獄研 仙獣拙馬檎 吉陥. suexec拭 企背 石精 陥製 益掘亀 + 紫遂馬壱 粛陥檎, suexec -V研 叔楳馬食 suexec + 稽益督析 是帖研 硝焼鎧壱 稽益督析拭辞 雁重戚 嬢恐 鋭帳聖 + 嬢奄壱 赤澗走 達澗陥.

+ +
top
+
+

及拭辞澗 巷充 析戚 忽嬢走澗亜?

+ + +

CGI 覗稽益掘講拭 斥寿背霜呪系 及拭辞 忽嬢走澗 析聖 戚背馬檎 + 亀崇戚 吉陥. 姥端旋生稽 崎虞酔煽人 辞獄亜 辞稽 搭重馬澗 + 号狛聖 源馬澗 依戚陥. 侯虞亀 "Hello, World."研 窒径馬澗 + 覗稽益轡聖 拙失拝 呪 赤走幻 戚訓 覗稽益轡精 紺稽 承乞亜 + 蒸奄凶庚戚陥.

+ +

発井痕呪

+ + +

発井痕呪澗 雁重戚 陳濃斗研 紫遂馬澗 疑照 雁重 爽是研 + 彊陥艦澗 葵戚陥. 発井痕呪澗 path (陳濃斗亜 雁重戚 脊径廃 + 誤敬嬢拭 背雁馬澗 叔薦 督析聖 達澗 舌社), 紫遂切誤, 斗耕確 + 曽嫌人 旭戚 政遂廃 舛左陥. 析鋼旋昔 発井痕呪研 乞砧 左形檎 + 誤敬楳 覗繋覗闘拭辞 env研 脊径廃陥.

+ +

CGI研 叔楳拝凶亀 辞獄人 崎虞酔煽澗 唖切税 発井痕呪研 + 辞稽 嘘発廃陥. 戚 舛左拭澗 崎虞酔煽 曽嫌 (Netscape, IE, + Lynx), 辞獄 曽嫌 (焼督帖, IIS, WebSite), 叔楳馬澗 CGI + 覗稽益轡誤 去戚 赤陥.

+ +

CGI 覗稽益掘袴澗 戚訓 痕呪級聖 紫遂拝 呪 赤壱, + 発井痕呪澗 適虞戚情闘-辞獄 搭重拭澗 析採歳聖 託走廃陥. + 穿端 琶呪 痕呪 鯉系精 http://hoohoo.ncsa.uiuc.edu/cgi/env.html拭 赤陥.

+ +

焼掘 娃舘廃 Perl CGI 覗稽益轡精 切重拭惟 穿含吉 乞窮 + 発井痕呪研 左食層陥. 焼督帖 壕匂沙税 cgi-bin + 巨刑塘軒拭 戚人 搾汁廃 覗稽益轡戚 砧鯵 赤陥. 護護 痕呪澗 + 琶呪戚壱 蟹袴走澗 識澱旋戚陥. 益掘辞 因縦 鯉系拭 蒸澗 + 痕呪亀 左昔陥. 暁, 焼督帖澗 奄沙旋生稽 薦因馬澗 発井痕呪 + 須拭 食君亜走 号狛生稽 送羨 発井痕呪研 + 蓄亜拝 呪 赤陥.

+ +

+ #!/usr/bin/perl
+ print "Content-type: text/html\n\n";
+ foreach $key (keys %ENV) {
+ + print "$key --> $ENV{$key}<br>";
+
+ } +

+ + +

STDIN引 STDOUT

+ + +

暁, 辞獄人 適虞戚情闘澗 妊層脊径(STDIN)引 + 妊層窒径(STDOUT)生稽 搭重廃陥. 析雌旋昔 井酔 + STDIN精 徹左球蟹 覗稽益轡戚 坦軒馬澗 督析聖 + 蟹展鎧壱, STDOUT精 左搭 嬬車戚蟹 鉢檎聖 倶廃陥.

+ +

CGI 覗稽益轡拭惟 瀬 丞縦(form)聖 POST馬檎 + 丞縦拭 脊径廃 切戟研 働紺廃 莫縦生稽 広嬢辞 CGI 覗稽益轡税 + STDIN生稽 穿含廃陥. 益君檎 覗稽益轡精 徹左球蟹 + 督析拭辞 条精 切戟研 坦軒馬牛戚 切戟研 坦軒拝 呪 赤陥.

+ +

"働紺廃 莫縦"精 古酔 娃舘馬陥. 牌鯉 戚硯引 葵聖 去硲(=)稽 + 尻衣馬壱, 牌鯉 戚硯引 葵税 瞬級聖 辞稽 裳遁似球(&)稽 + 尻衣廃陥. 因拷, 証遁似球, 去硲 旭精 採切尻什君錘 庚切澗 + 肇疑馬走 省亀系 16遭呪稽 痕発廃陥. 刃穿廃 切戟 庚切伸精 + 陥製引 旭戚 持医陥.

+ +

+ name=Rich%20Bowen&city=Lexington&state=KY&sidekick=Squirrel%20Monkey +

+ +

曽曽 URL 及拭辞 戚訓 庚切伸聖 左惟 吉陥. 戚 井酔 辞獄澗 + 庚切伸聖 QUERY_STRING戚虞澗 発井痕呪拭 煽舌廃陥. + 戚研 GET 推短戚虞壱 廃陥. FORM + 殿益税 METHOD 紗失聖 走舛馬食 HTML 丞縦(form)戚 + 切戟研 GET拝走 POST拝走 衣舛廃陥.

+ +

戚薦 覗稽益轡精 戚訓 庚切伸聖 政遂廃 舛左稽 舵鯵醤 + 廃陥. 陥楳備亀 戚訓 切戟 坦軒研 欺壱 CGI 覗稽益轡税 陥献 + 食君 檎聖 詞杷澗 虞戚崎君軒人 乞汲級戚 赤陥.

+ +
top
+
+

CGI 乞汲/虞戚崎君軒

+ + +

CGI 覗稽益轡聖 拙失拝凶 走欠廃 拙穣聖 企重背爽澗 坪球 + 虞戚崎君軒 箸精 乞汲聖 紫遂拝走 壱形背坐醤 廃陥. 戚訓 依聖 + 紫遂馬檎 獄益亜 匝壱 希 察軒 覗稽益轡聖 鯵降拝 呪 赤陥.

+ +

Perl稽 CGI 覗稽益轡聖 拙失廃陥檎 CPAN拭辞 淫恵 乞汲級聖 達聖 + 呪 赤陥. CGI 鯵降拭 亜舌 確軒 紫遂鞠澗 乞汲精 + CGI.pm戚陥. 企採歳税 覗稽益轡拭 中歳廃 置社 + 奄管聖 姥薄廃 CGI::Lite亀 壱形背 瑳 呪 赤陥.

+ +

C稽 CGI 覗稽益轡聖 拙失廃陥檎 識澱税 食走亜 弦陥. 戚掻 + 馬蟹亜 http://www.boutell.com/cgic/拭 + 赤澗 CGIC 虞戚崎君軒陥.

+
top
+
+

希 弦精 舛左...

+ + +

瀬拭 古酔 弦精 CGI 舛左亜 赤陥. 敢什益血 comp.infosystems.www.authoring.cgi拭辞 食君 紫寓級引 + CGI 庚薦研 轄税拝 呪 赤陥. HTML Writers Guild税 -servers + 五析元軒什闘澗 霜庚拭 企廃 岩聖 達奄拭 版権廃 舌社陥. http://www.hwg.org/lists/hwg-servers/拭辞 希 弦精 依聖 + 硝 呪 赤陥.

+ +

益軒壱 弘経 CGI 覗稽益轡 疑拙拭 企廃 乞窮 鎧遂聖 竺誤廃 + CGI 鋭鉦聖 石嬢醤 拝走亀 乞献陥. NCSA拭 + 据沙 庚辞亜 赤壱, 呪舛廃 段照精 Common Gateway Interface + RFC 覗稽詮闘拭 赤陥.

+ +

五析元軒什闘蟹 敢什益血拭 薄仙 維壱 赤澗 CGI 庚薦拭 企背 + 霜庚拝凶澗 降持廃 薄雌引 据掘 奄企廃 衣引, 叔薦稽 降持廃 + 薄雌戚 嬢胸惟 陥献走, 紫遂馬澗 辞獄, CGI 覗稽益轡聖 拙失廃 + 情嬢, 亜管馬檎 背雁 坪球研 切室備 旋嬢虞. 益君檎 背衣奪聖 + 達奄 習趨遭陥.

+ +

焼督帖 社什坪球亜 設公鞠醸陥壱 溌重馬走 省澗 廃 CGI 霜庚聖 + 焼督帖 獄益 汽戚斗今戚什拭 臣軒檎 箭企稽 + 照吉陥.

+
+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/htaccess.html b/docs/manual/howto/htaccess.html new file mode 100644 index 00000000..9c6579d8 --- /dev/null +++ b/docs/manual/howto/htaccess.html @@ -0,0 +1,15 @@ +URI: htaccess.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: htaccess.html.ja.euc-jp +Content-Language: ja +Content-type: text/html; charset=EUC-JP + +URI: htaccess.html.ko.euc-kr +Content-Language: ko +Content-type: text/html; charset=EUC-KR + +URI: htaccess.html.pt-br +Content-Language: pt-br +Content-type: text/html; charset=ISO-8859-1 diff --git a/docs/manual/howto/htaccess.html.en b/docs/manual/howto/htaccess.html.en new file mode 100644 index 00000000..0ab4f5e9 --- /dev/null +++ b/docs/manual/howto/htaccess.html.en @@ -0,0 +1,385 @@ + + + +Apache Tutorial: .htaccess files - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

Apache Tutorial: .htaccess files

+
+

Available Languages:  en  | + ja  | + ko  | + pt-br 

+
+ +

.htaccess files provide a way to make configuration +changes on a per-directory basis.

+
+ +
top
+
top
+
+

What they are/How to use them

+ + +

.htaccess files (or "distributed configuration files") + provide a way to make configuration changes on a per-directory basis. A + file, containing one or more configuration directives, is placed in a + particular document directory, and the directives apply to that + directory, and all subdirectories thereof.

+ +

Note:

+

If you want to call your .htaccess file something + else, you can change the name of the file using the AccessFileName directive. For example, + if you would rather call the file .config then you + can put the following in your server configuration file:

+ +

+ AccessFileName .config +

+
+ +

In general, .htaccess files use the same syntax as + the main configuration + files. What you can put in these files is determined by the + AllowOverride directive. This + directive specifies, in categories, what directives will be + honored if they are found in a .htaccess file. If a + directive is permitted in a .htaccess file, the + documentation for that directive will contain an Override section, + specifying what value must be in AllowOverride in order for that + directive to be permitted.

+ +

For example, if you look at the documentation for the AddDefaultCharset + directive, you will find that it is permitted in .htaccess + files. (See the Context line in the directive summary.) The Override line reads + FileInfo. Thus, you must have at least + AllowOverride FileInfo in order for this directive to be + honored in .htaccess files.

+ +

Example:

+ + + + + + + + + +
Context:server config, virtual host, directory, .htaccess
Override:FileInfo
+ +

If you are unsure whether a particular directive is permitted in a + .htaccess file, look at the documentation for that + directive, and check the Context line for ".htaccess".

+
top
+
+

When (not) to use .htaccess files

+ +

In general, you should never use .htaccess files unless + you don't have access to the main server configuration file. There is, + for example, a prevailing misconception that user authentication should + always be done in .htaccess files. This is simply not the + case. You can put user authentication configurations in the main server + configuration, and this is, in fact, the preferred way to do + things.

+ +

.htaccess files should be used in a case where the + content providers need to make configuration changes to the server on a + per-directory basis, but do not have root access on the server system. + In the event that the server administrator is not willing to make + frequent configuration changes, it might be desirable to permit + individual users to make these changes in .htaccess files + for themselves. This is particularly true, for example, in cases where + ISPs are hosting multiple user sites on a single machine, and want + their users to be able to alter their configuration.

+ +

However, in general, use of .htaccess files should be + avoided when possible. Any configuration that you would consider + putting in a .htaccess file, can just as effectively be + made in a <Directory> section in your main server + configuration file.

+ +

There are two main reasons to avoid the use of + .htaccess files.

+ +

The first of these is performance. When AllowOverride + is set to allow the use of .htaccess files, Apache will + look in every directory for .htaccess files. Thus, + permitting .htaccess files causes a performance hit, + whether or not you actually even use them! Also, the + .htaccess file is loaded every time a document is + requested.

+ +

Further note that Apache must look for .htaccess files + in all higher-level directories, in order to have a full complement of + directives that it must apply. (See section on how + directives are applied.) Thus, if a file is requested out of a + directory /www/htdocs/example, Apache must look for the + following files:

+ +

+ /.htaccess
+ /www/.htaccess
+ /www/htdocs/.htaccess
+ /www/htdocs/example/.htaccess +

+ +

And so, for each file access out of that directory, there are 4 + additional file-system accesses, even if none of those files are + present. (Note that this would only be the case if + .htaccess files were enabled for /, which + is not usually the case.)

+ +

The second consideration is one of security. You are permitting + users to modify server configuration, which may result in changes over + which you have no control. Carefully consider whether you want to give + your users this privilege. Note also that giving users less + privileges than they need will lead to additional technical support + requests. Make sure you clearly tell your users what level of + privileges you have given them. Specifying exactly what you have set + AllowOverride to, and pointing them + to the relevant documentation, will save yourself a lot of confusion + later.

+ +

Note that it is completely equivalent to put a .htaccess + file in a directory /www/htdocs/example containing a + directive, and to put that same directive in a Directory section + <Directory /www/htdocs/example> in your main server + configuration:

+ +

.htaccess file in /www/htdocs/example:

+ +

Contents of .htaccess file in + /www/htdocs/example

+ AddType text/example .exm +

+ +

Section from your httpd.conf + file

+ <Directory /www/htdocs/example>
+ + AddType text/example .exm
+
+ </Directory> +

+ +

However, putting this configuration in your server configuration + file will result in less of a performance hit, as the configuration is + loaded once when Apache starts, rather than every time a file is + requested.

+ +

The use of .htaccess files can be disabled completely + by setting the AllowOverride + directive to none:

+ +

+ AllowOverride None +

+
top
+
+

How directives are applied

+ +

The configuration directives found in a .htaccess file + are applied to the directory in which the .htaccess file + is found, and to all subdirectories thereof. However, it is important + to also remember that there may have been .htaccess files + in directories higher up. Directives are applied in the order that they + are found. Therefore, a .htaccess file in a particular + directory may override directives found in .htaccess files + found higher up in the directory tree. And those, in turn, may have + overridden directives found yet higher up, or in the main server + configuration file itself.

+ +

Example:

+ +

In the directory /www/htdocs/example1 we have a + .htaccess file containing the following:

+ +

+ Options +ExecCGI +

+ +

(Note: you must have "AllowOverride Options" in effect + to permit the use of the "Options" directive in + .htaccess files.)

+ +

In the directory /www/htdocs/example1/example2 we have + a .htaccess file containing:

+ +

+ Options Includes +

+ +

Because of this second .htaccess file, in the directory + /www/htdocs/example1/example2, CGI execution is not + permitted, as only Options Includes is in effect, which + completely overrides any earlier setting that may have been in + place.

+ +

Merging of .htaccess with the main + configuration files

+ +

As discussed in the documentation on Configuration Sections, + .htaccess files can override the <Directory> sections for + the corresponding directory, but will be overriden by other types + of configuration sections from the main configuration files. This + fact can be used to enforce certain configurations, even in the + presence of a liberal AllowOverride setting. For example, to + prevent script execution while allowing anything else to be set in + .htaccess you can use:

+ +

+<Directory />
+ +Allowoverride All
+
+</Directory>
+
+<Location />
+ +Options +IncludesNoExec -ExecCGI
+
+</Location> +

+ + +
top
+
+

Authentication example

+ +

If you jumped directly to this part of the document to find out how + to do authentication, it is important to note one thing. There is a + common misconception that you are required to use + .htaccess files in order to implement password + authentication. This is not the case. Putting authentication directives + in a <Directory> + section, in your main server configuration file, is the preferred way + to implement this, and .htaccess files should be used only + if you don't have access to the main server configuration file. See above for a discussion of when you should and should + not use .htaccess files.

+ +

Having said that, if you still think you need to use a + .htaccess file, you may find that a configuration such as + what follows may work for you.

+ +

.htaccess file contents:

+ +

+ AuthType Basic
+ AuthName "Password Required"
+ AuthUserFile /www/passwords/password.file
+ AuthGroupFile /www/passwords/group.file
+ Require Group admins +

+ +

Note that AllowOverride AuthConfig must be in effect + for these directives to have any effect.

+ +

Please see the authentication tutorial for a + more complete discussion of authentication and authorization.

+
top
+
+

Server Side Includes example

+ +

Another common use of .htaccess files is to enable + Server Side Includes for a particular directory. This may be done with + the following configuration directives, placed in a + .htaccess file in the desired directory:

+ +

+ Options +Includes
+ AddType text/html shtml
+ AddHandler server-parsed shtml +

+ +

Note that AllowOverride Options and AllowOverride + FileInfo must both be in effect for these directives to have any + effect.

+ +

Please see the SSI tutorial for a more + complete discussion of server-side includes.

+
top
+
+

CGI example

+ +

Finally, you may wish to use a .htaccess file to permit + the execution of CGI programs in a particular directory. This may be + implemented with the following configuration:

+ +

+ Options +ExecCGI
+ AddHandler cgi-script cgi pl +

+ +

Alternately, if you wish to have all files in the given directory be + considered to be CGI programs, this may be done with the following + configuration:

+ +

+ Options +ExecCGI
+ SetHandler cgi-script +

+ +

Note that AllowOverride Options and AllowOverride + FileInfo must both be in effect for these directives to have any + effect.

+ +

Please see the CGI tutorial for a more + complete discussion of CGI programming and configuration.

+ +
top
+
+

Troubleshooting

+ +

When you put configuration directives in a .htaccess + file, and you don't get the desired effect, there are a number of + things that may be going wrong.

+ +

Most commonly, the problem is that AllowOverride is not + set such that your configuration directives are being honored. Make + sure that you don't have a AllowOverride None in effect + for the file scope in question. A good test for this is to put garbage + in your .htaccess file and reload. If a server error is + not generated, then you almost certainly have AllowOverride + None in effect.

+ +

If, on the other hand, you are getting server errors when trying to + access documents, check your Apache error log. It will likely tell you + that the directive used in your .htaccess file is not + permitted. Alternately, it may tell you that you had a syntax error, + which you will then need to fix.

+ +
+
+

Available Languages:  en  | + ja  | + ko  | + pt-br 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/htaccess.html.ja.euc-jp b/docs/manual/howto/htaccess.html.ja.euc-jp new file mode 100644 index 00000000..5a93ad8d --- /dev/null +++ b/docs/manual/howto/htaccess.html.ja.euc-jp @@ -0,0 +1,383 @@ + + + +Apache チュートリアル: .htaccess ファイル - Apache HTTP サーバ + + + + + +
<-
+
+Apache > HTTP サーバ > ドキュメンテーション > バージョン 2.2 > How-To / チュートリアル

Apache チュートリアル: .htaccess ファイル

+
+

Available Languages:  en  | + ja  | + ko  | + pt-br 

+
+ +

.htaccess ファイルはディレクトリ毎に設定を変更する方法を +提供します。

+
+ +
top
+
top
+
+

.htaccess ファイルとは何か/その使い方

+ + +

.htaccess ファイル (「分散設定ファイル」) は + ディレクトリ毎に設定を変更する方法を提供します。ディレクティブの + 書かれたファイルをディレクトリに置くことで、そのディレクトリとその + サブディレクトリすべてにディレクティブを適用させることができます。

+ +

注:

+

.htaccess ファイルを別の名前にしたい場合は、 + AccessFileName ディレクティブを + 使って変更することができます。例えば、そのファイルを .config + という名前にしたい場合は、以下の設定をサーバ設定ファイルに入れることが + できます:

+ +

+ AccessFileName .config +

+
+ +

一般に、.htaccess ファイルの構文は + 主設定ファイル + と同じです。これらのファイルに書くことのできるディレクティブは AllowOverride ディレクティブにより決まります。 + このディレクティブは、.htaccess ファイルに + 書かれたディレクティブの中で、、 + どのディレクティブが適用されるかをカテゴリー単位で指定します。 + .htaccess に書くことのできるディレクティブであれば、 + 説明文書には「上書き」という項目があり、.htaccess に書くことができるように + なるための AllowOverride の値が指定されています。

+ +

例えば、AddDefaultCharset ディレクティブの説明を + 見ると、.htaccess ファイルでの使用が許可されていることが + わかります。 (ディレクティブの概要の所にある「コンテキスト」と書かれている + 行を見てください。) 上書きと書かれている行には + FileInfo とあります。ですから、.htaccess 中の + このディレクティブが有効になるためには、少なくとも + AllowOverride FileInfo が設定されている必要があります。

+ +

例:

+ + + + + + + + + +
コンテキスト:サーバ設定ファイル,バーチャルホスト,ディレクトリ,.htaccess
上書き:FileInfo
+ +

あるディレクティブを .htaccess ファイルに書くことができるか + どうかわからないときは、そのディレクティブの説明を探して、".htaccess" + のための「コンテキスト」の行を調べてください。

+
top
+
+

いつ .htaccess ファイルを使う(使わない)か。

+ +

一般的に、サーバの主設定ファイルにアクセスできない場合を除いて、 + .htaccess ファイルの使用は極力避けてください。 + 世の中には、例えば、ユーザ認証は常に .htaccess ファイルで + 行なわなければならない、という誤解が広まっていますが、まったくそんなことは + ありません。ユーザ認証の設定はサーバ主設定ファイルに書くことができ、 + 実際、その方がより良い設定方法です。

+ +

.htaccess ファイルはコンテンツ提供者がディレクトリ毎の + 設定を行ないたいけれど、サーバシステムの root アクセス権限を持っていない + という場合にのみ使うべきものです。サーバ管理者が頻繁に設定変更を行ないたくは + ない、というときには個々のユーザが .htaccess ファイルを使って + 自分で設定の変更を行なうことを許可した方が良いときもあるでしょう。 + これは特に、ISP が複数のユーザのサイトを一つのマシンでホストしていて、 + 各ユーザが設定の変更をできるようにしたいようなときにあてはまります。

+ +

しかし、普通は可能であれば .htaccess ファイルの使用は + 避けてください。.htaccess ファイルに書こうと考えるような + すべての設定は、サーバの主設定ファイルの <Directory> セクションで同じように行なうことが + できます。

+ +

.htaccess ファイルの使用を避ける理由は主に二つあります。

+ +

一つ目はサーバの性能の問題です。AllowOverride ディレクティブが + .htaccess ファイルの設定を許可している場合は、Apache は + 各ディレクトリで .htaccess ファイルを探します。 + ですから、.htaccess ファイルを許可すると、実際に使用しているか + どうかに関わらず、性能の低下を招くことになります! また、.htaccess + ファイルは文書がリクエストされる度に読み込まれます。

+ +

さらに、Apache は適用すべきディレクティブを集めるために、すべての + 上位のディレクトリの .htaccess ファイルを探す必要があることにも + 注意してください。(ディレクティブが適用される方法を + 参照してください。)ですから、/www/htdocs/example にある + ファイルがリクエストされたときは、Apache は以下のファイルを調べます。

+ +

+ /.htaccess
+ /www/.htaccess
+ /www/htdocs/.htaccess
+ /www/htdocs/example/.htaccess +

+ +

ですから、そのディレクトリのそれぞれのファイルへのアクセスに対して、 + 上の例のファイルがまったく存在しないときでも、追加のファイルシステムの + アクセスが行なわれることになります。(これは、.htaccess が + / に対して有効になっているときの場合で、普通はそうなって + いないことに注意してください。)

+ +

二つ目はセキュリティです。ユーザにサーバの設定を変更することを + 許可することになりますので、あなた自身が管理できない変更をされる + 恐れがあります。ユーザにこの特権を与えるのが良いのかどうか、十分 + 検討してください。また、ユーザに与える権限が必要なものよりも少なすぎると、 + 余分な技術サポート報告を受け取るようになる可能性が高いことにも + 注意してください。確実に、ユーザにどの程度の権限を与えたか明確に告げるように + してください。AllowOverride に + 何を設定したかということと、関連する文書を示すことで、 + 後々の混乱をぐっと減らすことが + できます。

+ +

ところで、ディレクティブの書かれた .htaccess を + /www/htdocs/example に置くことと、同じディレクティブを + 主サーバ設定の Directory セクション + <Directory /www/htdocs/example> に書くことは + 完全に等価です:

+ +

/www/htdocs/example.htaccess ファイル:

+ +

/www/htdocs/example の .htaccess ファイルの + 内容

+ AddType text/example .exm +

+ +

httpd.conf のセクション + file

+ <Directory /www/htdocs/example>
+ + AddType text/example .exm
+
+ </Directory> +

+ +

しかし、この設定はサーバ設定ファイルに書いた方がパフォーマンスの + 低下が少なくなります。ファイルがリクエストされる度に + 読み込まれる代わりに、Apache の起動時に 1 回だけ読み込めば + よくなるからです。

+ +

AllowOverride ディレクティブの + 値を none に設定することで .htaccess ファイル + の使用を完全に無効にすることができます。

+ +

+ AllowOverride None +

+
top
+
+

ディレクティブの適用のされ方

+ +

.htaccess ファイルの設定ディレクティブは .htaccess + ファイルの存在するディレクトリと、そのサブディレクトリすべてに適用されます。 + しかし、上の階層のディレクトリにも .htaccess ファイルが + 存在するかもしれないことを覚えておくことは大切です。ディレクティブは現れる + 順番に適用されます。ですから、あるディレクトリの .htaccess は + ディレクトリツリーのより上の階層の .htaccess ファイルの + 設定を上書きするかもしれません。そして、その .htaccess も + より上の階層で書かれたディレクティブを上書きしたり、主サーバ設定ファイル + そのものの設定を上書きしたりしているかもしれません。

+ +

例:

+ +

ディレクトリ /www/htdocs/example1 に以下の内容の + .htaccess ファイルがあります:

+ +

+ Options +ExecCGI +

+ +

(注: .htaccess + ファイルで "Options" ディレクティブが有効になるためには、 + "AllowOverride Options" を有効にする必要があります。)

+ +

ディレクトリ /www/htdocs/example1/example2 には + 以下のような .htaccess ファイルがあります:

+ +

+ Options Includes +

+ +

二つめの .htaccess により、ディレクトリ + /www/htdocs/example1/example2 では CGI の実行は + 許可されません。これは、Options Includes のみが + 効力を持ち、それがすべての以前の設定を上書きするからです。

+ +

メイン設定ファイルに対する + .htaccess のマージ

+ +

As discussed in the documentation on Configuration Sections, + .htaccess files can override the <Directory> sections for + the corresponding directory, but will be overriden by other types + of configuration sections from the main configuration files. This + fact can be used to enforce certain configurations, even in the + presence of a liberal AllowOverride setting. For example, to + prevent script execution while allowing anything else to be set in + .htaccess you can use:

+

セクションの設定 + に記載されているように、.htaccess ファイルを使って + <Directory> + セクションの設定をディレクトリ毎に上書きできますが、 + メイン設定ファイル中にある、他の種類の設定セクションによって + さらに上書きされることもあります。 + この特徴を使って、 + AllowOverride + で自由度の高い設定があったとしても、ある特定の設定が確実に + 反映されるようにできます。例えば、CGI スクリプトの実行は + 不許可に、かつ、.htaccess でその他の項目は + 設定できるように、という場合は次のようにできます :

+ +

+<Directory />
+ +Allowoverride All
+
+</Directory>
+
+<Location />
+ +Options +IncludesNoExec -ExecCGI
+
+</Location> +

+ + +
top
+
+

認証の例

+ +

もし認証の方法を知るためにこの部分に直接来たのであれば、次のことを + 知っておくことが重要です。よくある誤解に、パスワード認証を行なうためには + .htaccess ファイルを使う必要がある、というものがあります。 + これは正しくありません。主サーバ設定ファイルの <Directory> セクションに + 認証用のディレクティブを書く方が推奨される方法で、.htaccess + ファイルは主サーバ設定ファイルを変更できないときにのみ使用すべきです。 + いつ .htaccess ファイルを使うべきで、いつ使うべきではないかに + ついては を参照してください。

+ +

以上のことをふまえた上で、もし .htaccess の使用が + まだ必要だと思う場合は、次のようなものが望みのことをしてくれるかも + しれません。

+ +

.htaccess ファイルの内容:

+ +

+ AuthType Basic
+ AuthName "Password Required"
+ AuthUserFile /www/passwords/password.file
+ AuthGroupFile /www/passwords/group.file
+ Require Group admins +

+ +

これらのディレクティブが有効になるためには、 + AllowOverride AuthConfig が有効でなくてはならないことに + 注意してください。

+ +

認証と承認については 認証チュートリアルを + 参照してください。

+
top
+
+

SSI の例

+ +

もう一つの .htaccess ファイルのよくある利用法は + 特定のディレクトリで SSI を有効にすることです。これは、望みのディレクトリの + .htaccess ファイルに以下の設定ディレクティブを書くことで + 達成できます:

+ +

+ Options +Includes
+ AddType text/html shtml
+ AddHandler server-parsed shtml +

+ +

これらのディレクティブが有効になるためには、 + AllowOverride OptionsAllowOverride + FileInfo が有効になっている必要があることに注意してください。

+ +

よりまとまった SSI の説明は SSI チュートリアルを + 参照してください。

+
top
+
+

CGI の例

+ +

最後に、特定のディレクトリで CGI プログラムの実行を許可したいことが + あるでしょう。これは以下の設定で行なうことができます:

+ +

+ Options +ExecCGI
+ AddHandler cgi-script cgi pl +

+ +

もしくは、あるディレクトリのすべてのファイルが CGI プログラムと + みなされるようにしたいなら、以下の設定で実現することができます:

+ +

+ Options +ExecCGI
+ SetHandler cgi-script +

+ +

これらのディレクティブが有効になるためには、 + AllowOverride OptionsAllowOverride + FileInfo が有効である必要があることに注意してください。

+ +

CGI プログラムと設定のよりまとまった説明は CGI チュートリアルを参照してください。

+ +
top
+
+

問題解決

+ +

設定ディレクティブを .htaccess ファイルに書いたけれども、 + 期待した効果が得られないときには、いくつかの原因が考えられます。

+ +

一番よくあることは、設定ディレクティブが考慮されるようには + AllowOverride が設定されていない + というものです。該当のファイルのスコープに AllowOverride None + が設定されていないことを確認してください。これを調べるための良い方法は、 + .htaccess ファイルにごみを書いて、リロードすることです。 + サーバのエラーが生成されないときは、ほぼ確実に AllowOverride + None が設定されている状態になっています。

+ +

そうではなく、文書をアクセスしようとしたときにエラーが発生している + ときは、Apache のエラーログを調べてください。.htaccess ファイルで + 使用されたディレクティブが許可されていない、ということを知らせている + 可能性が高いです。または、構文の間違いがあることを述べているかもしれません。 + その場合にはまずそれを修正する必要があります。

+ +
+
+

Available Languages:  en  | + ja  | + ko  | + pt-br 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/htaccess.html.ko.euc-kr b/docs/manual/howto/htaccess.html.ko.euc-kr new file mode 100644 index 00000000..68f4172a --- /dev/null +++ b/docs/manual/howto/htaccess.html.ko.euc-kr @@ -0,0 +1,333 @@ + + + +焼督帖 燈塘軒杖: .htaccess 督析 - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

焼督帖 燈塘軒杖: .htaccess 督析

+
+

亜管廃 情嬢:  en  | + ja  | + ko  | + pt-br 

+
+
戚 庚辞澗 置重毒 腰蝕戚 焼鑑艦陥. + 置悦拭 痕井吉 鎧遂精 慎嬢 庚辞研 凧壱馬室推.
+ +

.htaccess 督析聖 紫遂馬食 巨刑塘軒紺稽 竺舛聖 +痕井拝 呪 赤陥.

+
+ +
top
+
top
+
+

巷譲戚悟/嬢胸惟 紫遂馬澗亜

+ + +

.htaccess 督析(箸精 "歳至 竺舛督析")聖 + 紫遂馬檎 巨刑塘軒紺稽 竺舛聖 痕井拝 呪 赤陥. 食君 竺舛 走獣嬢亜 + 赤澗 督析聖 働舛 庚辞 巨刑塘軒拭 砧檎, 益 巨刑塘軒人 乞窮 + 馬是巨刑塘軒拭 走獣嬢研 旋遂廃陥.

+ +

爽税:

+

.htaccess 督析誤聖 陥牽惟 紫遂馬壱 粛陥檎, + AccessFileName 走獣嬢研 + 紫遂馬食 痕井拝 呪 赤陥. 森研 級嬢, .config + 督析誤聖 紫遂馬形檎 辞獄 竺舛督析拭 陥製引 旭戚 蓄亜廃陥.

+ +

+ AccessFileName .config +

+
+ +

析鋼旋生稽 .htaccess 督析精 爽竺舛督析引 庚狛戚 + 旭陥. AllowOverride + 走獣嬢亜 戚 督析拭 蟹臣 呪 赤澗 鎧遂聖 衣舛廃陥. 戚 走獣嬢澗 + .htaccess 督析拭辞 買遂馬澗 走獣嬢 歳嫌研 走舛廃陥. + 走獣嬢研 .htaccess 督析拭辞 紫遂拝 呪 赤陥檎, + 背雁 走獣嬢 庚辞税 Override 牌鯉精 走獣嬢研 買遂馬奄是背 + AllowOverride拭 紫遂拝 + 葵聖 硝形層陥.

+ +

森研 級嬢, AddDefaultCharset + 走獣嬢 庚辞研 左檎 戚 走獣嬢研 .htaccess 督析拭辞 + 紫遂拝 呪 赤陥. (走獣嬢 推鉦拭辞 紫遂舌社 牌鯉聖 左虞.) + Override + 匝拭 FileInfo亜 赤陥. 益掘辞 戚 走獣嬢研 + .htaccess 督析拭辞 紫遂馬奄是背辞澗 置社廃 + AllowOverride FileInfo亜 琶推馬陥.

+ +

森薦:

+ + + + + + + + + +
紫遂舌社:爽辞獄竺舛, 亜雌硲什闘, directory, .htaccess
Override:FileInfo
+ +

働舛 走獣嬢研 .htaccess 督析拭辞 紫遂拝 + 呪 赤澗走 叡榎馬檎 走獣嬢 庚辞税 紫遂舌社 牌鯉拭 ".htaccess"亜 + 赤澗走 溌昔廃陥.

+
top
+
+

情薦 .htaccess 督析聖 紫遂馬蟹 + (箸精 紫遂馬走 省蟹)

+ +

析鋼旋生稽 爽辞獄督析拭 羨悦拝 呪 蒸澗 井酔亜 焼艦虞檎 + .htaccess 督析聖 紫遂馬檎 照吉陥. 森研 級嬢, + 紫遂切 昔装戚 牌雌 .htaccess 督析拭 赤嬢醤 + 廃陥澗 依精 設公 硝形遭 神背陥. 戚澗 紫叔戚 焼艦陥. 爽辞獄竺舛拭 + 紫遂切 昔装 竺舛聖 旋聖 呪 赤壱, 紫叔 戚君掩 映廃陥.

+ +

.htaccess 督析精 珍度苧 薦因切亜 巨刑塘軒紺稽 + 辞獄 竺舛聖 陥牽惟馬壱 粛走幻 辞獄 獣什奴拭 root 映廃戚 + 蒸澗 井酔拭 紫遂廃陥. 辞獄 淫軒切亜 竺舛聖 切爽 痕井馬壱 + 粛走 省精 井酔 析鋼 紫遂切亜 送羨 .htaccess + 督析聖 呪舛馬亀系 買遂馬澗 依戚 郊寓送馬陥. 森研 級嬢, 廃 + 陳濃斗拭 食君 紫遂切 紫戚闘研 辞搾什馬澗 ISP拭辞 紫遂切亜 + 切重税 竺舛聖 痕井馬壱 粛精 井酔亜 益君馬陥.

+ +

益君蟹 析鋼旋生稽 .htaccess 督析精 亜厭旋 + 杷背醤 廃陥. .htaccess 督析拭辞 買遂馬澗 走獣嬢澗 + 爽竺舛督析税 <Directory> 悉芝引 旭精 反引亜 + 赤陥.

+ +

陥製 砧亜走 笛 戚政凶庚拭 .htaccess 督析 + 紫遂聖 杷背醤 廃陥.

+ +

湛腰属澗 失管戚陥. AllowOverride.htaccess + 督析聖 紫遂馬亀系 買遂馬檎, 焼督帖澗 巨刑塘軒原陥 + .htaccess 督析聖 達澗陥. 益掘辞 + .htaccess 督析聖 買遂馬檎 叔薦稽 督析聖 紫遂馬走 + 省澗 井酔拭亀 失管戚 恭嬢遭陥! 暁, .htaccess + 督析精 庚辞研 推短拝凶原陥 石嬢級昔陥.

+ +

惟陥亜 旋遂背醤 馬澗 穿端 走獣嬢研 乞生奄是背 焼督帖澗 + 乞窮 雌是 巨刑塘軒拭辞 .htaccess 督析聖 達澗陥. + (嬢胸惟 走獣嬢研 旋遂馬蟹 箭聖 凧壱.) + 益掘辞 /www/htdocs/example 巨刑塘軒拭 赤澗 + 督析聖 推短馬檎, 焼督帖澗 陥製 督析級聖 達焼醤 廃陥.

+ +

+ /.htaccess
+ /www/.htaccess
+ /www/htdocs/.htaccess
+ /www/htdocs/example/.htaccess +

+ +

益掘辞 益 巨刑塘軒拭 赤澗 督析聖 羨悦拝 凶原陥 竺舛督析戚 + 穿粕 蒸嬢亀 督析獣什奴聖 4腰 希 羨悦背醤 廃陥. + (/拭辞亀 .htaccess 督析聖 買遂廃 + 井酔研 源廃陥. 左搭精 買遂馬走 省澗陥.)

+ +

砧腰属 戚政澗 左照戚陥. 紫遂切拭惟 辞獄竺舛 痕井 映廃聖 + 爽檎 雁重戚 姶雁拝 呪 蒸澗 痕鉢亜 析嬢劾 呪 赤陥. 紫遂切拭惟 + 戚訓 映廃聖 匝走 印印戚 持唖馬虞. 暁, 紫遂切亜 据馬澗 依左陥 + 旋精 映廃聖 爽檎 奄綬走据推短戚 級嬢紳陥. 紫遂切拭惟 亜管廃 + 映廃 呪層聖 誤溌備 硝形虞. 紫遂切拭惟 AllowOverride研 嬢胸惟 竺舛馬心澗走 + 舛溌備 硝軒壱 淫恵 庚辞研 薦因馬檎 蒋生稽 肇空聖 杷拝 呪 + 赤陥.

+ +

走獣嬢研 /www/htdocs/example 巨刑塘軒税 + .htaccess 督析聖 砧澗 依引 爽辞獄竺舛税 + <Directory /www/htdocs/example> Directory + 竺舛拭 砧澗 依精 刃穿備 旭陥.

+ +

/www/htdocs/example拭 赤澗 + .htaccess 悉芝:

+ +

/www/htdocs/example拭 赤澗 + .htaccess 督析 鎧遂

+ AddType text/example .exm +

+ +

httpd.conf 督析拭 赤澗 悉芝

+ <Directory /www/htdocs/example>
+ + AddType text/example .exm
+
+ </Directory> +

+ +

益君蟹 督析聖 推短拝 凶原陥 竺舛聖 石走省壱 焼督帖亜 + 獣拙拝凶 廃腰幻 竺舛聖 石奄凶庚拭 旭精 竺舛聖 辞獄竺舛督析拭 + 紫遂馬檎 失管戚 希 匙牽陥.

+ +

AllowOverride 走獣嬢研 + none生稽 竺舛馬檎 .htaccess 督析聖 + 刃穿備 紫遂拝 呪 蒸陥.

+ +

+ AllowOverride None +

+
top
+
+

嬢胸惟 走獣嬢研 旋遂馬蟹

+ +

.htaccess 督析聖 降胃廃 巨刑塘軒人 益 巨刑塘軒税 + 乞窮 馬是巨刑塘軒拭 .htaccess 督析拭 赤澗 竺舛 + 走獣嬢研 旋遂廃陥. 益掘辞 雌是巨刑塘軒税 .htaccess + 督析聖 爽税背醤 廃陥. 降胃廃 授辞稽 走獣嬢研 旋遂廃陥. 働舛 + 巨刑塘軒拭 赤澗 .htaccess 督析精 雌是巨刑塘軒拭 + 赤澗 .htaccess 督析税 走獣嬢研 巷反稽 幻級 + 呪 赤壱, 雌是巨刑塘軒拭 赤澗 走獣嬢澗 希 雌是巨刑塘軒 箸精 + 爽竺舛督析拭 赤澗 走獣嬢研 巷反稽 幻級 呪 赤陥.

+ +

森薦:

+ +

/www/htdocs/example1 巨刑塘軒拭 陥製引 旭精 + .htaccess 督析戚 赤陥.

+ +

+ Options +ExecCGI +

+ +

(爽税: .htaccess 督析拭 "Options" 走獣嬢研 紫遂馬形檎 + "AllowOverride Options"亜 琶推馬陥.)

+ +

/www/htdocs/example1/example2 巨刑塘軒拭澗 + 陥製引 旭精 .htaccess 督析戚 赤陥.

+ +

+ Options Includes +

+ +

戚 砧腰属 .htaccess 督析税 + Options Includes亜 戚穿 竺舛聖 刃穿備 巷反稽 + 幻級奄凶庚拭 /www/htdocs/example1/example2 + 巨刑塘軒澗 CGI 叔楳聖 買遂馬走 省澗陥.

+
top
+
+

昔装 森薦

+ +

昔装 号狛聖 硝奄是背 郊稽 戚員採斗 石澗陥檎 爽税拝 依戚 + 赤陥. 章硲 昔装聖 馬形檎 .htaccess 督析戚 + 琶推馬陥澗 神背亜 確軒 遁閃赤陥. 戚澗 紫叔戚 焼艦陥. + 爽竺舛督析税 <Directory> 悉芝拭 昔装 走獣嬢研 + 砧澗 依戚 希 映舌馬澗 号狛戚壱, 辞獄税 爽竺舛督析聖 呪舛拝 + 呪 蒸澗 井酔拭幻 .htaccess 督析聖 紫遂背醤 + 廃陥. 情薦 .htaccess 督析聖 紫遂背醤 馬澗走人 + 紫遂馬走 源焼醤 馬澗走澗 是拭辞 + 竺誤馬心陥.

+ +

蒋拭辞 源梅走幻 焼送亀 .htaccess 督析戚 + 琶推馬陥壱 持唖鞠檎 焼掘 竺舛戚 亀崇戚 吃 依戚陥.

+ +

.htaccess 督析 鎧遂.

+ +

+ AuthType Basic
+ AuthName "Password Required"
+ AuthUserFile /www/passwords/password.file
+ AuthGroupFile /www/passwords/group.file
+ Require Group admins +

+ +

戚 走獣嬢亜 疑拙馬奄是背辞澗 + AllowOverride AuthConfig 走獣嬢亜 琶推敗聖 + 誤宿馬虞.

+ +

昔装引 映廃採食拭 企廃 切室廃 竺誤精 昔装 + 燈塘軒杖聖 左掩 郊空陥.

+
top
+
+

Server Side Includes 森薦

+ +

暁陥献 析鋼旋昔 .htaccess 督析税 遂亀澗 + 働舛 巨刑塘軒拭辞 Server Side Includes研 亜管馬惟 幻球澗 + 依戚陥. 据馬澗 巨刑塘軒税 .htaccess 督析拭 + 陥製引 旭精 竺舛 走獣嬢研 紫遂馬檎 吉陥.

+ +

+ Options +Includes
+ AddType text/html shtml
+ AddHandler server-parsed shtml +

+ +

戚 走獣嬢亜 疑拙馬形檎 AllowOverride Options人 + AllowOverride FileInfo亜 乞砧 琶推敗聖 誤宿馬虞.

+ +

server-side includes拭 企廃 切室廃 竺誤精 SSI 燈塘軒杖聖 左掩 郊空陥.

+
top
+
+

CGI 森薦

+ +

原走厳生稽 .htaccess 督析聖 紫遂馬食 働舛 + 巨刑塘軒拭辞 CGI 覗稽益轡 叔楳聖 買遂馬壱 粛陥檎, 陥製引 + 旭精 竺舛聖 紫遂廃陥.

+ +

+ Options +ExecCGI
+ AddHandler cgi-script cgi pl +

+ +

箸精 戚 巨刑塘軒拭 赤澗 乞窮 督析聖 CGI 覗稽益轡生稽 + 坦軒馬壱 粛陥檎 陥製引 旭精 竺舛亀 亜管馬陥.

+ +

+ Options +ExecCGI
+ SetHandler cgi-script +

+ +

戚 走獣嬢亜 疑拙馬形檎 AllowOverride Options人 + AllowOverride FileInfo亜 乞砧 琶推敗聖 誤宿馬虞.

+ +

CGI 覗稽益掘講引 竺舛拭 企廃 切室廃 竺誤精 CGI 燈塘軒杖聖 左掩 郊空陥.

+ +
top
+
+

庚薦背衣

+ +

.htaccess 督析拭 黍 竺舛 走獣嬢亜 据馬澗 + 奄管聖 馬走 省澗 井酔 食君亜走 戚政亜 赤聖 呪 赤陥.

+ +

亜舌 析鋼旋昔 庚薦澗 竺舛 走獣嬢研 亜管馬惟 幻球澗 AllowOverride研 竺舛馬走 省精 + 井酔陥. 庚薦亜 鞠澗 督析 慎蝕拭 AllowOverride None戚 + 蒸澗走 溌昔廃陥. .htaccess 督析聖 焼巷係惟蟹 + 旋精 陥製 凪戚走研 陥獣 羨悦馬食 襲惟 伊紫背瑳 呪 赤陥. + 辞獄 神嫌亜 蟹神走 省生檎 暗税 溌叔備 + AllowOverride None聖 紫遂廃 井酔陥.

+ +

鋼企稽 庚辞拭 羨悦拝凶 辞獄 神嫌亜 降持馬檎 焼督帖 神嫌稽益研 + 詞縄坐虞. 焼原亀 .htaccess 督析拭 赤澗 走獣嬢研 + 買遂馬走 省澗陥壱 拝 依戚陥. 焼艦壱 庚狛 神嫌亜 赤陥檎 神嫌研 + 壱庁陥.

+ +
+
+

亜管廃 情嬢:  en  | + ja  | + ko  | + pt-br 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/htaccess.html.pt-br b/docs/manual/howto/htaccess.html.pt-br new file mode 100644 index 00000000..f48691a6 --- /dev/null +++ b/docs/manual/howto/htaccess.html.pt-br @@ -0,0 +1,375 @@ + + + +Tutorial do Apache: arquivos .htaccess - Servidor HTTP Apache + + + + + +
<-
+
+Apache > Servidor HTTP > Documenta艫o > Verso 2.2 > How-To / Tutoriais

Tutorial do Apache: arquivos .htaccess

+
+

Lnguas Disponveis:  en  | + ja  | + ko  | + pt-br 

+
+ +

Arquivos .htaccess oferecem um meio de fazer mudanas + nas configura苺es por-diretrio.

+
+ +
top
+
top
+
+

O que eles so/Como us-los

+ + +

Os arquivos .htaccess (ou "arquivos de + configura艫o distribuda") oferecem um meio de fazer mudanas nas + configura苺es por-diretrio. Um arquivo, contendo uma ou mais + diretrizes de configura苺es, colocado em um diretrio + em particular, e as diretrizes se aplicam para aquele diretrio e todos + os seu subdiretrios subseqentes.

+ +

Nota:

+

Se voc quiser renomear o seu arquivo .htaccess + para outro nome, voc deve usar a diretriz AccessFileName. Por exemplo, se voc + prefere que o arquivo se chame .config, ento voc + pode adicionar a seguinte linha ao seu arquivo de configura艫o + do servidor:

+ +

+ AccessFileName .config +

+
+ +

No geral, arquivos .htaccess usam a mesma sintaxe + que os arquivos de + configura艫o principal. O que voc pode colocar nesses + arquivos determinado pele diretriz AllowOverride. Essa diretriz especifica, + em categorias, quais diretrizes sero aceitas caso sejam + encontradas em um arquivo .htaccess. Se uma diretriz + for permitida em um arquivo .htaccess, a documenta艫o + para essa diretriz ir conter uma se艫o Override, + especificando que valor precisa estar em AllowOverride para que esta diretriz + seja permitida.

+ +

Por exemplo, se voc procurar na documenta艫o pela diretriz + AddDefaultCharset, voc + achar que ela permitida nos arquivos .htaccess. + (Veja a linha Contexto no sumrio das diretivas.) A + linha Override l + FileInfo. Ento, voc deve ao menos ter + AllowOverride FileInfo para que essa diretriz seja + aceita nos arquivos .htaccess.

+ +

Exemplo:

+ + + + + + + + + +
Contexto:configura艫o do servidor, hospedeiros virtuais, diretrio, .htaccess
Override:FileInfo
+ +

Se voc estiver incerto se uma diretriz em particular + aceita em um arquivo .htaccess, procure na + documenta艫o por essa diretriz, e verifique a linha de + Contexto por ".htaccess".

top
+
+

Quando (no) usar arquivos .htaccess

+ +

No geral, voc nunca deve usar arquivos .htaccess + a no ser que voc no tenha acesso ao arquivo de configura艫o + principal do servidor. Existe, por exemplo, um erro de concep艫o + que dita que a autentica艫o de usurios sempre deve + ser feita usando os arquivos .htaccess. Esse + simplesmente no o caso. Voc pode usar as configura苺es de + autentica艫o de usurio no arquivo de configura艫o principal do + servidor, e isso , de fato, a maneira mais adequada de se fazer + as coisas.

+ +

Arquivos .htaccess devem ser usados em casos onde + os provedores de contedo do site precisem fazer mudanas na + configura艫o do servidor por-diretrio, mas no tem + acesso root ao sistema do servidor. Caso o administrador do + servidor no esteja disposto a fazer mudanas freqentes nas + configura苺es do servidor, desejvel permitir que os + usurios possam fazer essas mudanas atravs de arquivos + .htaccess eles mesmos. Isso particularmente + verdade, por exemplo, em casos onde provedores esto fornecendo + mltiplos sites para usurios em apenas uma mquina, e querem que + seus usurios possam alterar suas configura苺es.

+ +

No entanto, de modo geral, o uso de arquivos .htaccess + deve ser evitado quando possvel. Quaisquer configura苺es + que voc considerar acrescentar em um arquivo .htaccess, podem + ser efetivamente colocadas em uma se艫o <Directory> no arquivo principal de + configura艫o de seu servidor.

+ +

Existem duas razes principais para evitar o uso de arquivos + .htaccess.

+ +

A primeira delas a performance. Quando AllowOverride configurado para + permitir o uso de arquivos .htaccess, o Apache procura + em todos diretrios por arquivos .htaccess. + Logo, permitir arquivos .htaccess causa um impacto na + performance, mesmo sem voc us-los de fato! Alm disso, + o arquivo .htaccess carregado toda vez que um documento + requerido.

+ +

Alm disso, note que o Apache precisa procurar pelos arquivos + .htaccess em todos os diretrios superiores, para ter + o complemento total de todas as diretivas que devem ser + aplicadas. (Veja a se艫o como as diretrizes so + aplicadas.) Ento, se um arquivo de um diretrio + /www/htdocs/example requerido, o Apache precisa + procurar pelos seguintes arquivos:

+ +

+ /.htaccess
+ /www/.htaccess
+ /www/htdocs/.htaccess
+ /www/htdocs/example/.htaccess +

+ +

Assim, para cada acesso de arquivo fora desse diretrio, + existem 4 acessos ao sistema de arquivos adicionais, mesmo + que nenhum desses arquivos estejam presentes. (Note que esse + s ser o caso se os arquivos .htaccess + estiverem habilitados para /, o que + normalmente no o verdade.)

+ +

A segunda considera艫o relativa segurana. + Voc est permitindo que os usurios modifiquem as + configura苺es do servidor, o que pode resultar em mudanas + que podem fugir ao seu controle. Considere com cuidado se voc quer + ou no dar aos seus usurios esses privilgios. Note tambm + que dar aos usurios menos privilgios que eles precisam, acarreta em + pedidos de suporte tcnico adicionais. Tenha certeza que voc comunicou + aos usurios que nvel de privilgios voc os deu. + Especificar exatamente o que voc configurou na diretriz AllowOverride, e direcion-los para a + documenta艫o relevante, ir poup-lo de muita confuso + depois.

+ +

Perceba que exatamente equivalente colocar o arquivo + .htaccess em um diretrio + /www/htdocs/example contendo uma diretriz, e + adicionar a mesma diretriz em uma se艫o Directory + <Directory /www/htdocs/example> na configura艫o + principal do seu servidor:

+ +

Arquivo .htaccess em /www/htdocs/example:

+ +

Contedo de um arquivo .htaccess em + /www/htdocs/example

+ AddType text/example .exm +

+ +

Se艫o do seu arquivo httpd.conf

+ <Directory /www/htdocs/example>
+ + AddType text/example .exm
+
+ </Directory> +

+ +

No entanto, adicionando isso ao seu arquivo de configura艫o do + servidor resultar em uma menor perda de performance, na medida que + a configura艫o carregada no momento da inicializa艫o do + servidor, ao invs de toda que que um arquivo requerido.

+ +

O uso de arquivos .htaccess pode ser totalmente + desabilitado, ajustando a diretriz AllowOverride para none:

+ +

+ AllowOverride None +

+
top
+
+

Como as diretrizes so aplicadas

+ +

As diretrizes de configura艫o que se encontram em um arquivo + .htaccess so aplicadas para o diretrio no qual o + arquivo .htaccess se encontra, e para todos os + subdiretrios ali presentes. Mas, importante lembrar tambm que + podem existir arquivos .htaccess no diretrios + superiores. As diretrizes so aplicadas na ordem que so + achadas. Logo, um arquivo .htaccess em um diretrio + em particular, pode sobrescrever as diretrizes encontradas em um + diretrio acima deste em sua respectiva rvore. Estes, por sua vez, + podem ter suas diretrizes sobrescritas por diretrizes ainda mais + acima, ou no prprio arquivo de configura艫o principal do + servidor.

+ +

Exemplo:

+ +

No diretrio /www/htdocs/example1 ns temos + um arquivo .htaccess contendo o seguinte:

+ +

+ Options +ExecCGI +

+ +

(Nota: voc deve ter "AllowOverride Options" para + permitir o uso da diretriz "Options" nos arquivos + .htaccess .)

+ +

No diretrio /www/htdocs/example1/example2 ns temos + um arquivo .htaccess contendo:

+ +

+ Options Includes +

+ +

Devido a esse segundo arquivo .htaccess, no + diretrio /www/htdocs/example1/example2, a execu艫o + de scripts CGI no permitida, pois somente Options + Includes est em efeito, o que sobrescreve completamente + quaisquer outros ajustes previamente configurados.

+
top
+
+

Exemplo de Autentica艫o

+ +

Se voc veio diretamente esta parte do documento para + aprender como fazer autentica艫o, importante notar uma + coisa. Existe uma concep艫o errada, mas muito comum, de que + necessrio o uso de arquivos .htaccess para implementar + a autentica艫o por senha. Este no o caso. Colocar + diretrizes de senha em uma se艫o <Directory>, no seu arquivo principal de + configura艫o do servidor, a melhor maneira de se implementar + isto, e os arquivos .htaccess devem ser usados apenas + se voc no tem acesso ao arquivo principal de configura艫o do + servidor. Veja acima a discusso sobre quando + voc deve e quando no deve usar os arquivos + .htaccess.

+ +

Dito isso, se voc ainda acredita que precisa usar um arquivo + .htaccess, a configura艫o a seguir provavelmente + funcionar para voc.

+ +

Contedo de um arquivo .htaccess:

+ +

+ AuthType Basic
+ AuthName "Password Required"
+ AuthUserFile /www/passwords/password.file
+ AuthGroupFile /www/passwords/group.file
+ Require Group admins +

+ +

Note que AllowOverride AuthConfig precisa estar + habilitado para que estas diretrizes tenham efeito.

+ +

Por favor veja o tutorial de + autentica艫o para uma discusso mais completa sobre + autentica艫o e autoriza艫o.

+
top
+
+

Exemplo de Server Side Includes

+ +

Outro uso comum de arquivos .htaccess ativar o + Server Side Includes para um diretrio em particular. Isto pode + ser feito com as seguintes diretrizes de configura艫o, colocadas em + um arquivo .htaccess no diretrio desejado:

+ +

+ Options +Includes
+ AddType text/html shtml
+ AddHandler server-parsed shtml +

+ +

Note que ambos AllowOverride Options e + AllowOverride FileInfo precisam estar habilitados + para essas diretrizes terem efeito.

+ +

Por favor veja o tutorial de SSI para + uma discusso mais completa sobre server-side includes.

+
top
+
+

Exemplo de CGI

+ +

Finalmente, voc pode querer que um arquivo + .htaccess permita a execu艫o de programas CGI em um + diretrio em particular. Isto pode ser implementado com as + seguintes configura苺es:

+ +

+ Options +ExecCGI
+ AddHandler cgi-script cgi pl +

+ +

Alternativamente, se voc desejar que todos os arquivos de um + dado diretrio, sejam considerados programas CGI, isso pode ser + feito com a seguinte configura艫o:

+ +

+ Options +ExecCGI
+ SetHandler cgi-script +

+ +

Note que ambos AllowOverride Options e + AllowOverride FileInfo precisam estar habilitados + para que essas diretrizes tenham quaisquer efeito.

+ +

Por favor veja o tutorial de CGI + tutorial para uma discusso mais completa sobre programa艫o + e configura艫o CGI.

+
top
+
+

Resolvendo Problemas

+ +

Quando voc adiciona diretrizes de configura艫o em um arquivo + .htaccess, e no obtm o efeito desejado, existe uma + srie de pontos que podem estar errados.

+ +

Mais comumente, o problema que a diretriz AllowOverride no est habilitada + corretamente para que as suas diretrizes de configura苺es sejam + honradas. Verifique se voc no possui AllowOverride + None ajustado para o escopo do arquivo em questo. Um bom + meio de testar isso colocar "lixo" em seu arquivo + .htaccess e recarreg-lo. Se no for gerado nenhum + erro do servidor, certamente voc tem AllowOverride + None habilitado.

+ +

Se, por outro lado, voc est obtendo erros do servidor ao + tentar acessar documentos, verifique o registro de erros do + Apache. Ele provavelmente ir indicar que a diretriz usada em + seu arquivo .htaccess no permitida. + Alternativamente, ele pode acusar erros de sintaxe que voc ter + que corrigir.

+ +
+
+

Lnguas Disponveis:  en  | + ja  | + ko  | + pt-br 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/index.html b/docs/manual/howto/index.html new file mode 100644 index 00000000..9ee33086 --- /dev/null +++ b/docs/manual/howto/index.html @@ -0,0 +1,11 @@ +URI: index.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: index.html.ja.euc-jp +Content-Language: ja +Content-type: text/html; charset=EUC-JP + +URI: index.html.ko.euc-kr +Content-Language: ko +Content-type: text/html; charset=EUC-KR diff --git a/docs/manual/howto/index.html.en b/docs/manual/howto/index.html.en new file mode 100644 index 00000000..5e918118 --- /dev/null +++ b/docs/manual/howto/index.html.en @@ -0,0 +1,117 @@ + + + +How-To / Tutorials - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2

How-To / Tutorials

+
+

Available Languages:  en  | + ja  | + ko 

+
+
+
top
+
+

How-To / Tutorials

+ + + +
+
Authentication and Authorization
+
+

Authentication is any process by which you verify that + someone is who they claim they are. Authorization is any + process by which someone is allowed to be where they want to + go, or to have information that they want to have.

+ +

See: Authentication, Authorization

+
+
+ +
+
Access Control
+
+

Access control refers to the process of restricting, or + granting access to a resource based on arbitrary criteria. There + are a variety of different ways that this can be + accomplished.

+ +

See: Access Control

+
+
+ +
+
Dynamic Content with CGI
+
+

The CGI (Common Gateway Interface) defines a way for a web + server to interact with external content-generating programs, + which are often referred to as CGI programs or CGI scripts. It + is the simplest, and most common, way to put dynamic content on + your web site. This document will be an introduction to setting + up CGI on your Apache web server, and getting started writing + CGI programs.

+ +

See: CGI: Dynamic Content

+
+
+ +
+
.htaccess files
+
+

.htaccess files provide a way to make configuration + changes on a per-directory basis. A file, containing one or more + configuration directives, is placed in a particular document directory, + and the directives apply to that directory, and all subdirectories thereof.

+ +

See: .htaccess files

+
+
+ +
+
Introduction to Server Side Includes
+
+

SSI (Server Side Includes) are directives that are placed in + HTML pages, and evaluated on the server while the pages are + being served. They let you add dynamically generated content to + an existing HTML page, without having to serve the entire page + via a CGI program, or other dynamic technology.

+ +

See: Server Side Includes (SSI)

+
+
+ +
+
Per-user web directories
+
+

On systems with multiple users, each user can be permitted to have a + web site in their home directory using the UserDir directive. Visitors + to a URL http://example.com/~username/ will get content + out of the home directory of the user "username", out of + the subdirectory specified by the UserDir directive.

+ +

See: User web directories (public_html)

+
+
+ +
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/index.html.ja.euc-jp b/docs/manual/howto/index.html.ja.euc-jp new file mode 100644 index 00000000..ef8cf41f --- /dev/null +++ b/docs/manual/howto/index.html.ja.euc-jp @@ -0,0 +1,104 @@ + + + +How-To / チュートリアル - Apache HTTP サーバ + + + + + +
<-
+
+Apache > HTTP サーバ > ドキュメンテーション > バージョン 2.2

How-To / チュートリアル

+
+

Available Languages:  en  | + ja  | + ko 

+
+
This translation may be out of date. Check the + English version for recent changes.
+
+
top
+
+

How-To / チュートリアル

+ + + +
+
認証
+
+

認証とは、誰かが自分は誰であるかを名乗っているものを検証する + 処理のことです。承認とは、誰かが望みの場所に辿り着けたり、 + 望みの情報を手に入れたりすることを許可する処理のことです。

+ +

参照: 認証、承認、アクセス制御

+
+
+ +
+
CGI による動的コンテンツ
+
+

CGI (Common Gateway Interface) はウェブサーバが外部のコンテンツ + 生成プログラムとどのように相互動作をするかを定義します。 + その外部プログラムは通常 CGI プログラムや CGI スクリプトと呼ばれます。 + CGI はウェブサイトに動的なコンテンツを追加するための、 + 一番単純でよく使われている方法です。この文書は Apache ウェブサーバに + CGI を設定し、CGI プログラムを書き始めるためのイントロダクションです。

+ +

参照: CGI: 動的コンテンツ

+
+
+ +
+
.htaccess ファイル
+
+

.htaccess ファイルはディレクトリ毎に設定を変更するための + 方法を提供します。設定ディレクティブが書かれたファイルが、あるドキュメント + ディレクトリに置かれると、ディレクティブはそのディレクトリと + すべてのサブディレクトリに適用されます。

+ +

参照: .htaccess ファイル

+
+
+ +
+
Server Side Includes イントロダクション
+
+

SSI (Server Side Includes) は HTML ページ中に書かれるディレクティブで、 + ページが送られる時にサーバにより評価されます。これにより、ページ全体を + CGI プログラムで生成したり、他の動的な技術を使うことなく、既存の HTML + ページに動的に生成された内容を付加することができます。

+ +

参照: Server Side Includes (SSI)

+
+
+ +
+
ユーザ毎のウェブディレクトリ
+
+

複数ユーザの存在するシステムでは、それぞれのユーザは UserDir ディレクティブを使うことによって + ホームディレクトリ上にウェブサイトを作成することができます。 + URL http://example.com/~username/ を訪れた人は + ユーザ "username" のホームディレクトリの、UserDir ディレクティブで指定された + サブディレクトリからコンテンツを得ることになります。

+ +

参照: ユーザウェブディレクトリ (public_html)

+
+
+ +
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/index.html.ko.euc-kr b/docs/manual/howto/index.html.ko.euc-kr new file mode 100644 index 00000000..53410a64 --- /dev/null +++ b/docs/manual/howto/index.html.ko.euc-kr @@ -0,0 +1,109 @@ + + + +How-To / 燈塘軒杖 - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2

How-To / 燈塘軒杖

+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+
戚 庚辞澗 置重毒 腰蝕戚 焼鑑艦陥. + 置悦拭 痕井吉 鎧遂精 慎嬢 庚辞研 凧壱馬室推.
+
+
top
+
+

How-To / 燈塘軒杖

+ + + +
+
昔装
+
+

昔装(authentication)精 切重戚 刊姥虞壱 爽舌馬澗 紫寓聖 + 溌昔馬澗 箭託戚陥. 映廃採食(authorization)澗 亜壱 粛精 + 員生稽 亜亀系 箸精 据馬澗 舛左研 条亀系 買遂馬澗 引舛戚陥.

+ +

凧壱: 昔装, 映廃採食, 羨悦薦嬢

+
+
+ +
+
CGI研 紫遂廃 疑旋 凪戚走 持失
+
+

CGI (Common Gateway Interface)澗 瀬辞獄亜 左搭 CGI + 覗稽益轡 箸精 CGI 什滴験闘馬壱 採牽澗, (瀬凪戚走 鎧遂聖 + 幻球澗) 須採 覗稽益轡引 雌硲拙遂馬澗 号狛聖 舛税廃陥. + 瀬紫戚闘拭辞 疑旋昔 凪戚走研 幻球澗 亜舌 泌馬壱 娃舘廃 + 号狛戚陥. 戚 庚辞澗 焼督帖 瀬辞獄拭 CGI研 姥失馬澗 号狛聖 + 社鯵馬壱, CGI 覗稽益轡聖 拙失背沙陥.

+ +

凧壱: CGI: 疑旋 凪戚走 持失

+
+
+ +
+
.htaccess 督析
+
+

.htaccess 督析聖 紫遂馬食 巨刑塘軒紺稽 + 竺舛聖 痕井拝 呪 赤陥. 食君 竺舛 走獣嬢亜 赤澗 督析聖 + 働舛 庚辞 巨刑塘軒拭 砧檎, 益 巨刑塘軒人 乞窮 馬是巨刑塘軒拭 + 走獣嬢研 旋遂廃陥.

+ +

凧壱: .htaccess + 督析

+
+
+ +
+
Server Side Includes 社鯵
+
+

SSI (Server Side Includes)澗 HTML 凪戚走拭 紫遂馬澗 + 走獣嬢稽, 凪戚走研 辞搾什拝凶 辞獄亜 坦軒廃陥. SSI研 + 紫遂馬檎 CGI 覗稽益轡戚蟹 陥献 疑旋昔 奄綬稽 凪戚走 + 穿端研 幻級嬢辞 辞搾什馬走 省壱亀 HTML 凪戚走拭 疑旋生稽 + 持失廃 鎧遂聖 蓄亜拝 呪 赤陥.

+ +

凧壱: Server Side Includes (SSI)

+
+
+ +
+
紫遂切紺 瀬巨刑塘軒
+
+

食君 紫遂切亜 赤澗 獣什奴拭辞 UserDir 走獣嬢研 紫遂馬檎 + 唖 紫遂切澗 切重税 幡巨刑塘軒 照拭 瀬紫戚闘研 幻級 呪 + 赤陥. URL http://example.com/~username/拭 + 羨悦馬檎 紫遂切 "username"税 幡巨刑塘軒拭辞 + UserDir + 走獣嬢稽 走舛廃 馬是巨刑塘軒拭 赤澗 凪戚走研 亜閃神惟 + 吉陥.

+ +

凧壱: 紫遂切 瀬巨刑塘軒 + (public_html)

+
+
+ +
+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/public_html.html b/docs/manual/howto/public_html.html new file mode 100644 index 00000000..690c35b2 --- /dev/null +++ b/docs/manual/howto/public_html.html @@ -0,0 +1,11 @@ +URI: public_html.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: public_html.html.ja.euc-jp +Content-Language: ja +Content-type: text/html; charset=EUC-JP + +URI: public_html.html.ko.euc-kr +Content-Language: ko +Content-type: text/html; charset=EUC-KR diff --git a/docs/manual/howto/public_html.html.en b/docs/manual/howto/public_html.html.en new file mode 100644 index 00000000..b227be48 --- /dev/null +++ b/docs/manual/howto/public_html.html.en @@ -0,0 +1,161 @@ + + + +Per-user web directories - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

Per-user web directories

+
+

Available Languages:  en  | + ja  | + ko 

+
+ +

On systems with multiple users, each user can be permitted to have a + web site in their home directory using the UserDir directive. Visitors + to a URL http://example.com/~username/ will get content + out of the home directory of the user "username", out of + the subdirectory specified by the UserDir directive.

+ +
+ +
top
+
top
+
+

Setting the file path with UserDir

+ + +

The UserDir + directive specifies a directory out of which per-user + content is loaded. This directive may take several different forms.

+ +

If a path is given which does not start with a leading slash, it is + assumed to be a directory path relative to the home directory of the + specified user. Given this configuration:

+ +

+ UserDir public_html +

+ +

the URL http://example.com/~rbowen/file.html will be + translated to the file path + /home/rbowen/public_html/file.html

+ +

If a path is given starting with a slash, a directory path will be + constructed using that path, plus the username specified. Given this + configuration:

+ +

+ UserDir /var/html +

+ +

the URL http://example.com/~rbowen/file.html will be + translated to the file path /var/html/rbowen/file.html

+ +

If a path is provided which contains an asterisk (*), a path is used + in which the asterisk is replaced with the username. Given this + configuration:

+ +

+ UserDir /var/www/*/docs +

+ +

the URL http://example.com/~rbowen/file.html will be + translated to the file path + /var/www/rbowen/docs/file.html

+ +
top
+
+

Restricting what users are permitted to use this + feature

+ + +

Using the syntax shown in the UserDir documentation, you can restrict + what users are permitted to use this functionality:

+ +

+ UserDir enabled
+ UserDir disabled root jro fish +

+ +

The configuration above will enable the feature for all users + except for those listed in the disabled statement. + You can, likewise, disable the feature for all but a few users by + using a configuration like the following:

+ +

+ UserDir disabled
+ UserDir enabled rbowen krietz +

+ +

See UserDir + documentation for additional examples.

+ +
top
+
+

Enabling a cgi directory for each user

+ + +

In order to give each user their own cgi-bin directory, you can use + a <Directory> + directive to make a particular subdirectory of a user's home directory + cgi-enabled.

+ +

+ <Directory /home/*/public_html/cgi-bin/>
+ Options ExecCGI
+ SetHandler cgi-script
+ </Directory> +

+ +

Then, presuming that UserDir is set to + public_html, a cgi program example.cgi + could be loaded from that directory as:

+ +

+ http://example.com/~rbowen/cgi-bin/example.cgi +

+ +
top
+
+

Allowing users to alter configuration

+ + +

If you want to allows users to modify the server configuration in + their web space, they will need to use .htaccess files to + make these changed. Ensure that you have set AllowOverride to a + value sufficient for the directives that you want to permit the users + to modify. See the .htaccess tutorial for + additional details on how this works.

+ +
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/public_html.html.ja.euc-jp b/docs/manual/howto/public_html.html.ja.euc-jp new file mode 100644 index 00000000..ea621c6a --- /dev/null +++ b/docs/manual/howto/public_html.html.ja.euc-jp @@ -0,0 +1,155 @@ + + + +ユーザ毎のウェブディレクトリ - Apache HTTP サーバ + + + + + +
<-
+
+Apache > HTTP サーバ > ドキュメンテーション > バージョン 2.2 > How-To / チュートリアル

ユーザ毎のウェブディレクトリ

+
+

Available Languages:  en  | + ja  | + ko 

+
+ +

複数のユーザのいるシステムでは、UserDir ディレクティブを使って + 各ユーザがホームディレクトリにウェブサイトを構築できるように設定することが + 可能です。URL http://example.com/~username/ を訪れた人は + "username" というユーザの UserDir ディレクティブで指定された + サブディレクトリからコンテンツを得ることになります。

+
+ +
top
+
+

ユーザ毎のウェブディレクトリ

+ + +
top
+
+

UserDir を使ってファイルのパスを設定する

+ + +

UserDir ディレクティブは + ユーザ毎のコンテンツが読み込まれるディレクトリを指定します。 + このディレクティブはいろいろ違った形式を取ることができます。

+ +

スラッシュで始まらないパスが与えられたときは、ユーザのホームディレクトリ + からの相対パスとみなされます。次の設定があったときに:

+ +

+ UserDir public_html +

+ +

URL http://example.com/~rbowen/file.html は + パス /home/rbowen/public_html/file.html へ + 変換されます。

+ +

パスがスラッシュで始まるときは、ディレクトリパスはそのパスに + ユーザ名を加えたものからなります。次の設定のとき:

+ +

+ UserDir /var/html +

+ +

URL http://example.com/~rbowen/file.html は + パス /var/html/rbowen/file.html へ変換されます。

+ +

アスタリスク (*) を含むパスが指定されたときは、アスタリスクを + ユーザ名で置換したものが使用されます。このような設定だと:

+ +

+ UserDir /var/www/*/docs +

+ +

URL http://example.com/~rbowen/file.html は + パス /var/www/rbowen/docs/file.html へ変換されます。

+ +
top
+
+

この機能を使用できるユーザを制限する

+ + +

UserDir のドキュメントに示されている構文を使うことで、 + どのユーザがこの機能を使うことができるかを制限することができます:

+ +

+ UserDir enabled
+ UserDir disabled root jro fish +

+ +

上の設定は dissabled 文のユーザ以外のすべてのユーザに + 対して UserDir の機能を有効にします。同様にして、以下のように + 数名のユーザ以外に対してこの機能を無効にすることもできます:

+ +

+ UserDir disabled
+ UserDir enabled rbowen krietz +

+ +

他の例は UserDir + の説明を参照してください。

+ +
top
+
+

ユーザ毎の CGI ディレクトリ

+ + +

それぞれのユーザに専用の cgi-bin ディレクトリを与えるために、 + <Directory> + を使ってユーザのホームディレクトリの指定された領域に対して CGI を有効に + することができます。

+ +

+ <Directory /home/*/public_html/cgi-bin/>
+ Options ExecCGI
+ SetHandler cgi-script
+ </Directory> +

+ +

そして、UserDir が + public_html に設定されていると仮定すると、 + そのディレクトリの CGI プログラム example.cgi + は以下の様に呼び出されることができます:

+ +

+ http://example.com/~rbowen/cgi-bin/example.cgi +

+ +
top
+
+

ユーザによる設定変更を許可

+ + +

ユーザに彼らのウェブ空間でのサーバの設定の変更を許可する場合、 + ユーザは .htaccess ファイルを使って設定を変更する必要があります。 + AllowOverride の値を + ユーザが変更することを許可したいディレクティブに対して十分なものに + 設定していることを確認してください。この機能がどのようにして動作しているか + の詳細は .htaccess チュートリアル を読んで + ください。

+ +
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/public_html.html.ko.euc-kr b/docs/manual/howto/public_html.html.ko.euc-kr new file mode 100644 index 00000000..359e5d74 --- /dev/null +++ b/docs/manual/howto/public_html.html.ko.euc-kr @@ -0,0 +1,156 @@ + + + +紫遂切紺 瀬巨刑塘軒 - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

紫遂切紺 瀬巨刑塘軒

+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+ +

食君 紫遂切亜 赤澗 獣什奴拭辞 UserDir 走獣嬢研 紫遂馬檎 + 唖 紫遂切澗 切重税 幡巨刑塘軒 照拭 瀬紫戚闘研 幻級 呪 赤陥. + URL http://example.com/~username/拭 羨悦馬檎 + 紫遂切 "username"税 幡巨刑塘軒拭辞 UserDir 走獣嬢稽 走舛廃 + 馬是巨刑塘軒拭 赤澗 凪戚走研 亜閃神惟 吉陥.

+ +
+ +
top
+
top
+
+

UserDir稽 督析井稽 走舛馬奄

+ + +

UserDir + 走獣嬢澗 紫遂切紺 凪戚走研 亜閃臣 巨刑塘軒研 走舛廃陥. 戚 + 走獣嬢税 紫遂狛精 食君亜走陥.

+ +

十掘習稽 獣拙馬走省澗 井稽研 走舛馬檎 唖 紫遂切税 + 幡巨刑塘軒拭 雌企旋昔 巨刑塘軒 井稽稽 坦軒廃陥. 森研 級嬢, + 焼掘 竺舛税 井酔:

+ +

+ UserDir public_html +

+ +

URL http://example.com/~rbowen/file.html精 + 督析 井稽 /home/rbowen/public_html/file.html聖 + 倶廃陥.

+ +

十掘習稽 獣拙馬澗 井稽研 走舛馬檎 走舛廃 巨刑塘軒拭 + 紫遂切誤聖 希廃 巨刑塘軒 井稽研 紫遂廃陥. 森研 級嬢, 焼掘 + 竺舛税 井酔:

+ +

+ UserDir /var/html +

+ +

URL http://example.com/~rbowen/file.html精 + 督析 井稽 /var/html/rbowen/file.html聖 倶廃陥.

+ +

紺妊 (*)研 匂敗廃 井稽研 走舛馬檎 紺妊研 紫遂切誤生稽 + 企端廃 井稽研 紫遂廃陥. 森研 級嬢, 焼掘 竺舛税 井酔:

+ +

+ UserDir /var/www/*/docs +

+ +

URL http://example.com/~rbowen/file.html精 + 督析 井稽 /var/www/rbowen/docs/file.html聖 + 倶廃陥.

+ +
top
+
+

奄管聖 戚遂拝 紫遂切 薦廃馬奄

+ + +

UserDir 庚辞拭 赤澗 庚狛聖 紫遂馬食 紫遂切紺 瀬巨刑塘軒 + 奄管聖 戚遂拝 呪 赤澗 紫遂切研 薦廃拝 呪 赤陥:

+ +

+ UserDir enabled
+ UserDir disabled root jro fish +

+ +

是 竺舛精 disabled 庚舌拭 伸暗廃 紫寓聖 + 薦須馬壱 乞窮 紫遂切拭惟 瀬巨刑塘軒 奄管聖 買喰廃陥. 暁, + 陥製引 旭戚 護護 紫遂切研 薦須馬壱 奄管聖 買喰馬走 省聖 + 呪亀 赤陥:

+ +

+ UserDir disabled
+ UserDir enabled rbowen krietz +

+ +

UserDir + 庚辞拭 赤澗 陥献 森級亀 凧壱馬虞.

+ +
top
+
+

唖 紫遂切紺 cgi 巨刑塘軒 走舛馬奄

+ + +

紫遂切原陥 cgi-bin 巨刑塘軒研 採食馬形檎 <Directory> 走獣嬢研 + 紫遂馬食 紫遂切 幡巨刑塘軒税 働舛 馬是巨刑塘軒研 cgi 亜管馬惟 + 幻窮陥.

+ +

+ <Directory /home/*/public_html/cgi-bin/>
+ Options ExecCGI
+ SetHandler cgi-script
+ </Directory> +

+ +

UserDirpublic_html戚虞壱 + 亜舛馬檎, 陥製引 旭戚 益 照拭 赤澗 cgi 覗稽益轡 + example.cgi研 叔楳拝 呪 赤陥.

+ +

+ http://example.com/~rbowen/cgi-bin/example.cgi +

+ +
top
+
+

紫遂切亜 竺舛聖 痕井拝 呪 赤亀系 幻級奄

+ + +

紫遂切亜 切重税 瀬因娃拭 企廃 瀬辞獄 竺舛聖 呪舛馬形檎, + .htaccess 督析聖 紫遂拝 呪 赤嬢醤 廃陥. AllowOverride研 紫遂切亜 呪舛拝 + 呪 赤澗 走獣嬢拭 旋杯廃 葵生稽 竺舛馬虞. 嬢胸惟 疑拙馬澗走拭 + 企廃 切室廃 全左澗 .htaccess + 燈塘軒杖聖 凧壱馬虞.

+ +
+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/ssi.html b/docs/manual/howto/ssi.html new file mode 100644 index 00000000..6142aec8 --- /dev/null +++ b/docs/manual/howto/ssi.html @@ -0,0 +1,11 @@ +URI: ssi.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: ssi.html.ja.euc-jp +Content-Language: ja +Content-type: text/html; charset=EUC-JP + +URI: ssi.html.ko.euc-kr +Content-Language: ko +Content-type: text/html; charset=EUC-KR diff --git a/docs/manual/howto/ssi.html.en b/docs/manual/howto/ssi.html.en new file mode 100644 index 00000000..4401f26c --- /dev/null +++ b/docs/manual/howto/ssi.html.en @@ -0,0 +1,486 @@ + + + +Apache Tutorial: Introduction to Server Side Includes - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

Apache Tutorial: Introduction to Server Side Includes

+
+

Available Languages:  en  | + ja  | + ko 

+
+ +

Server-side includes provide a means to add dynamic content to +existing HTML documents.

+
+ +
top
+
+

Introduction

+ + +

This article deals with Server Side Includes, usually called + simply SSI. In this article, I'll talk about configuring your + server to permit SSI, and introduce some basic SSI techniques + for adding dynamic content to your existing HTML pages.

+ +

In the latter part of the article, we'll talk about some of + the somewhat more advanced things that can be done with SSI, + such as conditional statements in your SSI directives.

+ +
top
+
+

What are SSI?

+ +

SSI (Server Side Includes) are directives that are placed in + HTML pages, and evaluated on the server while the pages are + being served. They let you add dynamically generated content to + an existing HTML page, without having to serve the entire page + via a CGI program, or other dynamic technology.

+ +

The decision of when to use SSI, and when to have your page + entirely generated by some program, is usually a matter of how + much of the page is static, and how much needs to be + recalculated every time the page is served. SSI is a great way + to add small pieces of information, such as the current time. + But if a majority of your page is being generated at the time + that it is served, you need to look for some other + solution.

+
top
+
+

Configuring your server to permit SSI

+ + +

To permit SSI on your server, you must have the following + directive either in your httpd.conf file, or in a + .htaccess file:

+

+ Options +Includes +

+ +

This tells Apache that you want to permit files to be parsed + for SSI directives. Note that most configurations contain + multiple Options directives + that can override each other. You will probably need to apply the + Options to the specific directory where you want SSI + enabled in order to assure that it gets evaluated last.

+ +

Not just any file is parsed for SSI directives. You have to + tell Apache which files should be parsed. There are two ways to + do this. You can tell Apache to parse any file with a + particular file extension, such as .shtml, with + the following directives:

+

+ AddType text/html .shtml
+ AddOutputFilter INCLUDES .shtml +

+ +

One disadvantage to this approach is that if you wanted to + add SSI directives to an existing page, you would have to + change the name of that page, and all links to that page, in + order to give it a .shtml extension, so that those + directives would be executed.

+ +

The other method is to use the XBitHack directive:

+

+ XBitHack on +

+ +

XBitHack + tells Apache to parse files for SSI + directives if they have the execute bit set. So, to add SSI + directives to an existing page, rather than having to change + the file name, you would just need to make the file executable + using chmod.

+

+ chmod +x pagename.html +

+ +

A brief comment about what not to do. You'll occasionally + see people recommending that you just tell Apache to parse all + .html files for SSI, so that you don't have to + mess with .shtml file names. These folks have + perhaps not heard about XBitHack. The thing to + keep in mind is that, by doing this, you're requiring that + Apache read through every single file that it sends out to + clients, even if they don't contain any SSI directives. This + can slow things down quite a bit, and is not a good idea.

+ +

Of course, on Windows, there is no such thing as an execute + bit to set, so that limits your options a little.

+ +

In its default configuration, Apache does not send the last + modified date or content length HTTP headers on SSI pages, + because these values are difficult to calculate for dynamic + content. This can prevent your document from being cached, and + result in slower perceived client performance. There are two + ways to solve this:

+ +
    +
  1. Use the XBitHack Full configuration. This + tells Apache to determine the last modified date by looking + only at the date of the originally requested file, ignoring + the modification date of any included files.
  2. + +
  3. Use the directives provided by + mod_expires to set an explicit expiration + time on your files, thereby letting browsers and proxies + know that it is acceptable to cache them.
  4. +
+
top
+
+

Basic SSI directives

+ +

SSI directives have the following syntax:

+

+ <!--#element attribute=value attribute=value ... --> +

+ +

It is formatted like an HTML comment, so if you don't have + SSI correctly enabled, the browser will ignore it, but it will + still be visible in the HTML source. If you have SSI correctly + configured, the directive will be replaced with its + results.

+ +

The element can be one of a number of things, and we'll talk + some more about most of these in the next installment of this + series. For now, here are some examples of what you can do with + SSI

+ +

Today's date

+ +

+ <!--#echo var="DATE_LOCAL" --> +

+ +

The echo element just spits out the value of a + variable. There are a number of standard variables, which + include the whole set of environment variables that are + available to CGI programs. Also, you can define your own + variables with the set element.

+ +

If you don't like the format in which the date gets printed, + you can use the config element, with a + timefmt attribute, to modify that formatting.

+ +

+ <!--#config timefmt="%A %B %d, %Y" -->
+ Today is <!--#echo var="DATE_LOCAL" --> +

+ + +

Modification date of the file

+ +

+ This document last modified <!--#flastmod file="index.html" --> +

+ +

This element is also subject to timefmt format + configurations.

+ + +

Including the results of a CGI program

+ +

This is one of the more common uses of SSI - to output the + results of a CGI program, such as everybody's favorite, a ``hit + counter.''

+ +

+ <!--#include virtual="/cgi-bin/counter.pl" --> +

+ + +
top
+
+

Additional examples

+ + +

Following are some specific examples of things you can do in + your HTML documents with SSI.

+ +

When was this document +modified?

+ +

Earlier, we mentioned that you could use SSI to inform the + user when the document was most recently modified. However, the + actual method for doing that was left somewhat in question. The + following code, placed in your HTML document, will put such a + time stamp on your page. Of course, you will have to have SSI + correctly enabled, as discussed above.

+

+ <!--#config timefmt="%A %B %d, %Y" -->
+ This file last modified <!--#flastmod file="ssi.shtml" --> +

+ +

Of course, you will need to replace the + ssi.shtml with the actual name of the file that + you're referring to. This can be inconvenient if you're just + looking for a generic piece of code that you can paste into any + file, so you probably want to use the + LAST_MODIFIED variable instead:

+

+ <!--#config timefmt="%D" -->
+ This file last modified <!--#echo var="LAST_MODIFIED" --> +

+ +

For more details on the timefmt format, go to + your favorite search site and look for strftime. The + syntax is the same.

+ + +

Including a standard footer

+ + +

If you are managing any site that is more than a few pages, + you may find that making changes to all those pages can be a + real pain, particularly if you are trying to maintain some kind + of standard look across all those pages.

+ +

Using an include file for a header and/or a footer can + reduce the burden of these updates. You just have to make one + footer file, and then include it into each page with the + include SSI command. The include + element can determine what file to include with either the + file attribute, or the virtual + attribute. The file attribute is a file path, + relative to the current directory. That means that it + cannot be an absolute file path (starting with /), nor can it + contain ../ as part of that path. The virtual + attribute is probably more useful, and should specify a URL + relative to the document being served. It can start with a /, + but must be on the same server as the file being served.

+

+ <!--#include virtual="/footer.html" --> +

+ +

I'll frequently combine the last two things, putting a + LAST_MODIFIED directive inside a footer file to be + included. SSI directives can be contained in the included file, + and includes can be nested - that is, the included file can + include another file, and so on.

+ + +
top
+
+

What else can I config?

+ + +

In addition to being able to config the time + format, you can also config two other things.

+ +

Usually, when something goes wrong with your SSI directive, + you get the message

+

+ [an error occurred while processing this directive] +

+ +

If you want to change that message to something else, you + can do so with the errmsg attribute to the + config element:

+

+ <!--#config errmsg="[It appears that you don't know how to use SSI]" --> +

+ +

Hopefully, end users will never see this message, because + you will have resolved all the problems with your SSI + directives before your site goes live. (Right?)

+ +

And you can config the format in which file + sizes are returned with the sizefmt attribute. You + can specify bytes for a full count in bytes, or + abbrev for an abbreviated number in Kb or Mb, as + appropriate.

+
top
+
+

Executing commands

+ + +

I expect that I'll have an article some time in the coming + months about using SSI with small CGI programs. For now, here's + something else that you can do with the exec + element. You can actually have SSI execute a command using the + shell (/bin/sh, to be precise - or the DOS shell, + if you're on Win32). The following, for example, will give you + a directory listing.

+

+ <pre>
+ <!--#exec cmd="ls" -->
+ </pre> +

+ +

or, on Windows

+

+ <pre>
+ <!--#exec cmd="dir" -->
+ </pre> +

+ +

You might notice some strange formatting with this directive + on Windows, because the output from dir contains + the string ``<dir>'' in it, which confuses + browsers.

+ +

Note that this feature is exceedingly dangerous, as it will + execute whatever code happens to be embedded in the + exec tag. If you have any situation where users + can edit content on your web pages, such as with a + ``guestbook'', for example, make sure that you have this + feature disabled. You can allow SSI, but not the + exec feature, with the IncludesNOEXEC + argument to the Options directive.

+
top
+
+

Advanced SSI techniques

+ + +

In addition to spitting out content, Apache SSI gives you + the option of setting variables, and using those variables in + comparisons and conditionals.

+ +

Caveat

+ +

Most of the features discussed in this article are only + available to you if you are running Apache 1.2 or later. Of + course, if you are not running Apache 1.2 or later, you need to + upgrade immediately, if not sooner. Go on. Do it now. We'll + wait.

+ + +

Setting variables

+ +

Using the set directive, you can set variables + for later use. We'll need this later in the discussion, so + we'll talk about it here. The syntax of this is as follows:

+

+ <!--#set var="name" value="Rich" --> +

+ +

In addition to merely setting values literally like that, you + can use any other variable, including environment variables or the variables + discussed above (like LAST_MODIFIED, for example) to + give values to your variables. You will specify that something is + a variable, rather than a literal string, by using the dollar sign + ($) before the name of the variable.

+ +

<!--#set var="modified" value="$LAST_MODIFIED" --> +

+ +

To put a literal dollar sign into the value of your + variable, you need to escape the dollar sign with a + backslash.

+

+ <!--#set var="cost" value="\$100" --> +

+ +

Finally, if you want to put a variable in the midst of a + longer string, and there's a chance that the name of the + variable will run up against some other characters, and thus be + confused with those characters, you can place the name of the + variable in braces, to remove this confusion. (It's hard to + come up with a really good example of this, but hopefully + you'll get the point.)

+

+ <!--#set var="date" value="${DATE_LOCAL}_${DATE_GMT}" --> +

+ + +

Conditional expressions

+ + +

Now that we have variables, and are able to set and compare + their values, we can use them to express conditionals. This + lets SSI be a tiny programming language of sorts. + mod_include provides an if, + elif, else, endif + structure for building conditional statements. This allows you + to effectively generate multiple logical pages out of one + actual page.

+ +

The structure of this conditional construct is:

+

+ <!--#if expr="test_condition" -->
+ <!--#elif expr="test_condition" -->
+ <!--#else -->
+ <!--#endif --> +

+ +

A test_condition can be any sort of logical + comparison - either comparing values to one another, or testing + the ``truth'' of a particular value. (A given string is true if + it is nonempty.) For a full list of the comparison operators + available to you, see the mod_include + documentation. Here are some examples of how one might use this + construct.

+ +

In your configuration file, you could put the following + line:

+

+ BrowserMatchNoCase macintosh Mac
+ BrowserMatchNoCase MSIE InternetExplorer +

+ +

This will set environment variables ``Mac'' and + ``InternetExplorer'' to true, if the client is running Internet + Explorer on a Macintosh.

+ +

Then, in your SSI-enabled document, you might do the + following:

+

+ <!--#if expr="${Mac} && ${InternetExplorer}" -->
+ Apologetic text goes here
+ <!--#else -->
+ Cool JavaScript code goes here
+ <!--#endif --> +

+ +

Not that I have anything against IE on Macs - I just + struggled for a few hours last week trying to get some + JavaScript working on IE on a Mac, when it was working + everywhere else. The above was the interim workaround.

+ +

Any other variable (either ones that you define, or normal + environment variables) can be used in conditional statements. + With Apache's ability to set environment variables with the + SetEnvIf directives, and other related directives, + this functionality can let you do some pretty involved dynamic + stuff without ever resorting to CGI.

+ +
top
+
+

Conclusion

+ +

SSI is certainly not a replacement for CGI, or other + technologies used for generating dynamic web pages. But it is a + great way to add small amounts of dynamic content to pages, + without doing a lot of extra work.

+
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/ssi.html.ja.euc-jp b/docs/manual/howto/ssi.html.ja.euc-jp new file mode 100644 index 00000000..e1d56b97 --- /dev/null +++ b/docs/manual/howto/ssi.html.ja.euc-jp @@ -0,0 +1,481 @@ + + + +Apache チュートリアル: Server Side Includes 入門 - Apache HTTP サーバ + + + + + +
<-
+
+Apache > HTTP サーバ > ドキュメンテーション > バージョン 2.2 > How-To / チュートリアル

Apache チュートリアル: Server Side Includes 入門

+
+

Available Languages:  en  | + ja  | + ko 

+
+ +

サーバサイドインクルードによって、既存の HTML +ドキュメントに動的なコンテンツを追加することができます。

+
+ +
top
+
+

はじめに

+ + +

この記事は、通常は単に SSI と呼ばれる Server Side Includes + を扱います。この記事においては、サーバでの SSI を許可するための設定と、 + 現在の HTML ページに動的なコンテンツを加えるためのいくつかの基本的な + SSI 技術を紹介します。

+ +

記事の後半では、SSI ディレクティブで SSI + と共に実行することができる条件文のような + 幾分高度な事柄について述べています。

+ +
top
+
+

SSI とは ?

+ +

SSI (Server Side Includes) は、HTML + ページ中に配置されるディレクティブであり、 + サーバでページを提供する時に評価されます。SSI は、CGI + プログラムやその他の動的な技術で全てのページを提供せずに、 + 動的に生成されたコンテンツを現在の HTML ページに加えます。

+ +

どういう場合に SSI を使い、どういう場合にプログラムで + ページを完全に生成するかは、ページのうちどの程度が静的であり、 + ページが提供されるたびに再計算する必要がどの程度あるかで通常は決定します。 + SSI は現在時刻のような小さい情報を加えるにはうってつけの方法です。 + しかし、そのページのほとんどの部分が提供時に生成される場合は、 + 他の方法を探す必要があります。

+
top
+
+

SSI を許可するためのサーバの設定

+ + +

サーバで SSI を許可するには、httpd.conf + ファイルまたは .htaccess + ファイルに次のディレクティブを指定する必要があります:

+

+ Options +Includes +

+ +

この指定は、ファイルを SSI + ディレクティブで解析させることを許可するということを Apache + に伝えます。ほとんどの設定ではお互いを上書きできる、複数の + Options があることに + 注意してください。おそらく、設定が最後に評価されることを + 保証されるために、SSI を使用したいディレクトリに Options + ディレクティブを適用する必要があるでしょう。

+ +

全てのファイルが SSI + ディレクティブで解析されるというわけではありません。 + どのファイルが解析されるかを Apache に伝える必要があります。 + これを行なうには二つ方法があります。 + 次のディレクティブを使うことで、例えば .shtml + のような特別なファイル拡張子を持つファイルを解析するよう + Apache に伝えることができます:

+

+ AddType text/html .shtml
+ AddOutputFilter INCLUDES .shtml +

+ +

この方法の欠点は、もし現在のページに SSI ディレクティブを加えたい場合、 + それらのディレクティブが実行されるように + .shtml 拡張子にするため、そのページの名前と、 + そのページへの全てのリンクを変更しなければならないことです。

+ +

もう一つの方法は、XBitHack + ディレクティブを使用することです:

+

+ XBitHack on +

+ +

XBitHack + は、ファイルの実行ビットが立っている場合、 + SSI ディレクティブにより解析することを Apache に伝えます。 + 従って、SSI ディレクティブを現在のページに加えるためには、 + ファイル名を変更しなくてもよく、単に chmod + を使用してファイルを実行可能にするだけで済みます。

+

+ chmod +x pagename.html +

+ +

行なうべきではないことに関する短いコメント。時々誰かが、全ての + .html ファイルを SSI で解析するよう Apache に伝えれば、 + わざわざ .shtml というファイル名にする必要がないといって + 薦めるのを見ることでしょう。こういう人たちは、おそらく + XBitHack + について聞いたことがないのでしょう。 + この方法について注意することは、たとえ SSI + ディレクティブを全く含まない場合でも、Apache がクライアントに + 送る全てのファイルを最後まで読み込ませることになります。 + この方法はかなり処理を遅くするものであり、良くないアイデアです。

+ +

もちろん、Windows ではそのような実行ビットをセット + するようなものはありませんのでオプションが少し制限されています。

+ +

デフォルトの設定では、Apache は SSI ページについて最終変更時刻や + コンテンツの長さを HTTP ヘッダに送りません。 + 動的なコンテンツであるため、それらの値を計算するのが難しいからです。 + このためドキュメントがキャッシュされなくなり、 + 結果としてクライアントの性能が遅くなったように感じさせることになります。 + これを解決する方法が二つあります:

+ +
    +
  1. XBitHack Full 設定を使用する。 + この設定により、もともと要求されたファイルの時刻を参照し、 + 読み込まれるファイルの変更時刻を無視して最終変更時刻を決定するよう + Apache に伝えます。
  2. + +
  3. mod_expires + で提供されているディレクティブを使用して、 + ファイルが無効になる時刻を明示します。これにより、 + ブラウザとプロキシにキャッシュが有効であることを通知します。
  4. +
+
top
+
+

基本的な SSI ディレクティブ

+ +

SSI ディレクティブは以下の文法で記述します:

+

+ <!--#element attribute=value attribute=value ... --> +

+ +

HTML のコメントのような書式をしているので、もし SSI + を正しく動作可能にしなければ、ブラウザはそれを無視するでしょう。 + しかし、HTML ソース中では見えます。もし SSI を正しく設定したなら、 + ディレクティブはその結果と置き換えられます。

+ +

element はたくさんあるものから一つ指定することができます。 + 指定できるものの大多数については、次回もう少し詳しく説明します。 + ここでは、SSI で行なうことができる例をいくつか示します。

+ +

今日の日付

+ +

+ <!--#echo var="DATE_LOCAL" --> +

+ +

echo 要素は単に変数の値を出力します。 + CGI プログラムに利用可能な環境変数の全ての + セットを含む多くの標準変数があります。また、set + 要素を用いることで、独自の変数を定義することができます。 +

+ +

出力される日付の書式が好きではない場合、その書式を修正するために、 + config 要素に timefmt + 属性を使用することができます。

+ +

+ <!--#config timefmt="%A %B %d, %Y" -->
+ Today is <!--#echo var="DATE_LOCAL" --> +

+ + +

ファイルの変更日

+ +

+ This document last modified <!--#flastmod file="index.html" --> +

+ +

この要素も timefmt + フォーマットの設定に従います。

+ + +

CGI プログラムの結果を取り込む

+ +

これは、全ての人のお気に入りである ``ヒットカウンタ'' のような + CGI プログラムの結果を出力する SSI + のより一般的な使用のうちの一つです。

+ +

+ <!--#include virtual="/cgi-bin/counter.pl" --> +

+ + +
top
+
+

追加の例

+ + +

以下は、SSI を使用して HTML + ドキュメントにおいてできることのいくつかの特別な例です。

+ +

いつこのドキュメントは修正されたのか +?

+ +

先に、ドキュメントが最後に変更されたのはいつかを + ユーザに通知するために SSI を使用することができることを述べました。 + しかしながら、実際の方法は、いくぶん問題のままにしておきました。 + HTML ドキュメントに配置された次のコードは、ページにそのような + タイムスタンプを入れるでしょう。もちろん、上述のように、 + SSI を正しく動作可能にしておく必要があります。

+

+ <!--#config timefmt="%A %B %d, %Y" -->
+ This file last modified <!--#flastmod file="ssi.shtml" --> +

+ +

もちろん、ssi.shtml + の部分を実際の当該ファイル名と置き換える必要があります。 + もし、あらゆるファイルに張ることができる一般的なコードを探しているなら、 + これは不便であるかもしれません。おそらくその場合は、 + そうする代わりに変数 LAST_MODIFIED + を使用したいと考えるでしょう:

+

+ <!--#config timefmt="%D" -->
+ This file last modified <!--#echo var="LAST_MODIFIED" --> +

+ +

timefmt + 書式についてのより詳細については、お好みの検索サイトに行き、 + strftime で検索してみてください。文法は同じです。

+ + +

標準のフッタを挿入する

+ + +

もし数ページを超えるページを持つサイトを管理しているならば、 + 全ページに対して変更を行なうことが本当に苦痛となり得ることが + 分かるでしょう。全てのページに渡ってある種の標準的な外観を + 維持しようとしているならば特にそうでしょう。

+ +

ヘッダやフッタ用の挿入用ファイルを使用することで、 + このような更新にかかる負担を減らすことができます。 + 一つのフッタファイルを作成し、それを include + SSI コマンドで各ページに入れるだけで済みます。include + 要素は、file 属性または virtual + 属性のいずれかを使用してどのファイルを挿入するかを決めることができます。 + file 属性は、カレントディレクトリからの相対パスで示された + ファイルパスです。 + それは / で始まる絶対ファイルパスにはできず、また、そのパスの一部に ../ + を含むことができないことを意味します。virtual + 属性は、おそらくより便利だと思いますが、提供するドキュメントからの相対 + URL で指定すべきです。それは / で始めることができますが、 + 提供するファイルと同じサーバ上に存在しなくてはなりません。

+

+ <!--#include virtual="/footer.html" --> +

+ +

私は最後の二つを組み合わせて、LAST_MODIFIED + ディレクティブをフッタファイルの中に置くことがよくあります。 + SSI ディレクティブは、挿入用のファイルに含ませたり、 + 挿入ファイルのネストをしたりすることができます。すなわち、 + 挿入用のファイルは他のファイルを再帰的に挿入することができます。

+ + +
top
+
+

他に何が設定できるのか ?

+ + +

時刻書式を config で設定できることに加えて、 + 更に二つ config で設定することができます。

+ +

通常、SSI ディレクティブで何かがうまくいかないときは、 + 次のメッセージが出力されます。

+

+ [an error occurred while processing this directive] +

+ +

このメッセージを他のものにしたい場合、config + 要素の errmsg 属性で変更することができます:

+

+ <!--#config errmsg="[It appears that you don't know how to use SSI]" --> +

+ +

おそらく、エンドユーザはこのメッセージを決して見ることはありません。 + なぜなら、そのサイトが生きた状態になる前に SSI ディレクティブに関する + 全ての問題を解決しているはずだからです。(そうですよね?)

+ +

そして、config において sizefmt + 属性を使用することで、 + 返されるファイルサイズの書式を設定することができます。 + バイト数には bytes を、適当に Kb や Mb + に短縮させるには abbrev を指定することができます。

+
top
+
+

コマンドの実行

+ + +

今後数ヶ月のうちに、小さな CGI プログラムと SSI + を使用する記事を出したいと考えています。ここではそれとは別に、 + exec 要素によって行なうことができることを示します。 + SSI にシェル (正確には /bin/sh。Win32 ならば DOS シェル) + を使用してコマンドを実行させることができます。 + 下記の例では、ディレクトリリスト出力を行ないます。

+

+ <pre>
+ <!--#exec cmd="ls" -->
+ </pre> +

+ +

Windows 上では、

+

+ <pre>
+ <!--#exec cmd="dir" -->
+ </pre> +

+ +

Windows 上では、このディレクティブによっていくつかの奇妙な + 書式に気づくでしょう。なぜなら dir の出力が文字列 + ``<dir>'' を含み、ブラウザを混乱させるからです。

+ +

この機能は非常に危険であり、どんなコードでも exec + タグに埋め込まれてしまえば実行することに注意してください。例えば + `` ゲストブック '' のように、もし、 + ユーザがページの内容を編集できる状況にあるならば、 + この機能を確実に抑制してください。Options + ディレクティブの IncludesNOEXEC 引数を指定することで、 + SSI は許可するけれど exec + 機能は許可しないようにすることができます。

+
top
+
+

高度な SSI テクニック

+ + +

コンテンツを出力することに加え、Apache SSI は変数を設定し、 + そして比較と条件分岐にその変数を使用できる機能を提供しています。 +

+ +

警告

+ +

この記事で述べた大部分の機能は、Apache 1.2 + 以降を使用している場合のみ利用可能です。もちろん、もし Apache 1.2 + 以降を使用してない場合、直ちにアップグレードする必要があります。 + さぁ、今それを行ないなさい。それまで待っています。

+ + +

変数を設定する

+ +

set ディレクティブを使用して、 + 後で使用するために変数を設定することができます。 + これは後の説明で必要になるので、ここでそれについて述べています。 + 文法は以下のとおりです:

+

+ <!--#set var="name" value="Rich" --> +

+ +

このように単純に文字どおりに設定することに加え、 + 環境変数や上記の変数 + (例えば LAST_MODIFIED のような) + を含む他のあらゆる変数を値を設定するのに使用することができます。 + 変数名の前にドル記号 ($) を使用することで、 + それがリテラル文字列ではなくて変数であることを示します。

+

+ <!--#set var="modified" value="$LAST_MODIFIED" --> +

+ +

ドル記号 ($) を文字として変数の値に入れるには、 + バックスラッシュによってドル記号をエスケープする必要があります。

+

+ <!--#set var="cost" value="\$100" --> +

+ +

最後になりますが、長い文字列の中に変数を置きたい場合で、 + 変数名が他の文字とぶつかる可能性があり、 + それらの文字について混乱してしまう場合、この混乱を取り除くため、 + 変数名を中括弧で囲むことができます + (これについての良い例を示すのは難しいのですが、 + おそらく分かっていただけるでしょう)。 +

+

+ <!--#set var="date" value="${DATE_LOCAL}_${DATE_GMT}" --> +

+ + +

条件式

+ + +

さて、変数を持っていて、 + それらの値を設定して比較することができるのですから、 + 条件を表すためにそれらを使用することができます。これにより + SSI はある種の小さなプログラミング言語になっています。 + mod_include は条件を表現するために if, + elif, else, endif + 構造を提供しています。これによって、 + 一つの実際のページから複数の論理ページを効果的に生成することができます。

+ +

条件構造は以下のとおりです:

+

+ <!--#if expr="test_condition" -->
+ <!--#elif expr="test_condition" -->
+ <!--#else -->
+ <!--#endif --> +

+ +

test_condition + はあらゆる種類の論理的比較をすることができます。 + 値を比較したり、その値が ``真'' かどうかを評価します + (空でないなら与えられた文字列は真です)。 + 利用可能な比較演算子の全てのリストについては、 + mod_include ドキュメンテーションを参照してください。 + ここでは、この構造をどう使用するかの例をいくつか示します。

+ +

設定ファイルで次の行を記述します:

+

+ BrowserMatchNoCase macintosh Mac
+ BrowserMatchNoCase MSIE InternetExplorer +

+ +

これはクライアントが Macintosh + 上でインターネットエクスプローラが動いている場合、環境変数 + ``Mac'' と ``InternetExplorer'' を真と設定します。

+ +

次に、SSI が可能になったドキュメントで以下を行ないます: +

+

+ <!--#if expr="${Mac} && ${InternetExplorer}" -->
+ Apologetic text goes here
+ <!--#else -->
+ Cool JavaScript code goes here
+ <!--#endif --> +

+ +

Mac 上の IE に対して何か思うところがあるわけでありません。 + 他では実行できているいくつかの JavaScript を Mac 上の IE + で実行させるのに、先週数時間苦労したというだけのことです。 + 上の例はその暫定的な対処方法です。

+ +

他のどんな変数 (あなたが定義するもの、 + または普通の環境変数のいずれか) も、条件文に使用することができます。 + Apache は SetEnvIf ディレクティブや他の関連 + ディレクティブを使用して環境変数を設定することができます。 + この機能により、CGI + に頼ることなくかなり複雑な動的なことをさせることができます。

+ +
top
+
+

終わりに

+ +

SSI は確かに CGI + や動的なウェブページを生成する他の技術に代わるものではありません。 + しかし、たくさんの余分な作業をせずに、 + 少量の動的なコンテンツを加えるにはすぐれた方法です。

+
+
+

Available Languages:  en  | + ja  | + ko 

+
+ \ No newline at end of file diff --git a/docs/manual/howto/ssi.html.ko.euc-kr b/docs/manual/howto/ssi.html.ko.euc-kr new file mode 100644 index 00000000..27696bd2 --- /dev/null +++ b/docs/manual/howto/ssi.html.ko.euc-kr @@ -0,0 +1,426 @@ + + + +焼督帖 燈塘軒杖: Server Side Includes 社鯵 - Apache HTTP Server + + + + + +
<-
+
+Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

焼督帖 燈塘軒杖: Server Side Includes 社鯵

+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+ +

Server-side includes研 紫遂馬食 HTML 庚辞拭 疑旋昔 鎧遂聖 +蓄亜拝 呪 赤陥.

+
+ +
top
+
+

社鯵

+ + +

戚 越精 左搭 SSI虞壱 採牽澗 Server Side Includes研 竺誤廃陥. + SSI亜 亜管馬亀系 辞獄研 竺舛馬澗 号狛引 HTML 凪戚走拭 疑旋昔 + 鎧遂聖 蓄亜馬澗 奄沙旋昔 SSI 紫遂狛聖 社鯵廃陥.

+ +

戚 越税 急採歳精 SSI 走獣嬢 繕闇庚引 旭精 壱厭奄狛聖 + 竺誤廃陥.

+ +
top
+
+

SSI亜 巷譲昔亜?

+ +

SSI (Server Side Includes)澗 HTML 凪戚走拭 紫遂馬澗 走獣嬢稽, + 凪戚走研 辞搾什拝凶 辞獄亜 坦軒廃陥. SSI研 紫遂馬檎 CGI + 覗稽益轡戚蟹 陥献 疑旋昔 奄綬稽 凪戚走 穿端研 幻級嬢辞 + 辞搾什馬走 省壱亀 HTML 凪戚走拭 疑旋生稽 持失廃 鎧遂聖 蓄亜拝 + 呪 赤陥.

+ +

SSI研 紫遂拝走 焼艦檎 覗稽益轡生稽 凪戚走 穿端研 持失拝走 + 衣舛精 凪戚走拭辞 舛旋昔 採歳戚 弦精走人 凪戚走研 辞搾什拝 + 凶原陥 嬢汗舛亀研 陥獣 域至背醤拝走拭 含携陥. SSI澗 薄仙 + 獣娃引 旭戚 旋精 舛左研 蓄亜馬澗汽 疏陥. 益君蟹 凪戚走研 + 辞搾什拝凶 凪戚走税 企採歳聖 持失背醤 廃陥檎 陥献 号狛聖 + 達焼坐醤 廃陥.

+
top
+
+

SSI亜 亜管馬亀系 辞獄 竺舛馬奄

+ + +

辞獄亜 SSI研 坦軒馬形檎 httpd.conf 督析戚蟹 + .htaccess 督析拭辞 陥製 走獣嬢研 紫遂背醤 廃陥.

+

+ Options +Includes +

+ +

益君檎 焼督帖澗 督析拭辞 SSI 走獣嬢研 坦軒廃陥. 竺舛拭澗 + 左搭 食君 Options 走獣嬢亜 + 赤壱, 戚 走獣嬢級精 辞稽 気嬢潤辞 巷反稽 幻級陥. 益掘辞 + 走獣嬢研 固原走厳拭 坦軒馬奄是背 左搭 SSI研 据馬澗 働舛 + 巨刑塘軒拭辞 Options研 紫遂廃陥.

+ +

乞窮 督析拭辞 SSI 走獣嬢研 坦軒馬澗 依精 焼艦陥. 焼督帖拭惟 + 嬢恐 督析聖 坦軒拝走 硝形操醤 廃陥. 砧亜走 号狛戚 赤陥. + 馬蟹澗 陥製引 旭精 走獣嬢稽 .shtml引 旭精 働舛 + 督析 溌舌切研 亜遭 督析聖 坦軒馬澗 号狛戚陥.

+

+ AddType text/html .shtml
+ AddOutputFilter INCLUDES .shtml +

+ +

戚 号狛税 舘繊精 戚耕 赤澗 凪戚走拭 SSI 走獣嬢研 蓄亜馬澗 + 井酔 SSI 走獣嬢研 坦軒馬奄是背 .shtml 溌舌切研 + 採食馬奄凶庚拭 督析誤引 戚 凪戚走税 乞窮 元滴研 痕井背醤 + 馬澗 繊戚陥.

+ +

陥献 号狛精 XBitHack + 走獣嬢研 紫遂馬澗 号狛戚陥.

+

+ XBitHack on +

+ +

XBitHack澗 + 叔楳映廃戚 赤澗 督析拭辞 SSI 走獣嬢研 坦軒廃陥. 益掘辞 戚耕 + 赤澗 凪戚走拭 SSI 走獣嬢研 蓄亜廃陥檎 督析誤聖 痕井馬走 + 省壱 chmod稽 督析拭 叔楳映廃聖 爽檎 吉陥.

+

+ chmod +x pagename.html +

+ +

馬走 源焼醤 拝 依 馬蟹. 亜懐 .shtml 督析誤拭 + 茨帖研 称走源壱 乞窮 .html 督析聖 SSI 坦軒馬虞壱 + 中壱馬澗 紫寓戚 赤陥. 戚 紫寓級精 焼原亀 XBitHack拭 企背 乞牽澗 + 依 旭陥. 誤宿拝 繊精 戚係惟 馬檎 焼督帖澗 督析拭 SSI 走獣嬢亜 + 蒸希虞亀 適虞戚情闘稽 左鎧澗 乞窮 督析聖 詞縄坐醤 廃陥澗 + 依戚陥. 失管戚 古酔 汗形霜 呪 赤生悟, 疏精 持唖戚 焼艦陥.

+ +

弘経 制亀酔綜拭辞澗 叔楳映廃戚空 依戚 蒸奄凶庚拭 板切研 + 紫遂拝 呪 蒸陥.

+ +

鎧遂戚 疑旋戚食辞 域至馬奄 嬢憩奄凶庚拭 焼督帖 奄沙 竺舛精 + SSI 凪戚走税 置悦呪舛析引 content length HTTP 伯希研 左鎧走 + 省澗陥. 益掘辞 庚辞研 蝶習馬走 公馬壱 適虞戚情闘亜 汗晦澗 + 失管戚 恭嬢遭陥. 砧亜走 背衣号狛戚 赤陥.

+ +
    +
  1. XBitHack Full 竺舛精 紫遂廃陥. 益君檎 + 焼督帖澗 匂敗馬澗(include) 督析級税 呪舛析精 巷獣廃端 + 据掘 推短廃 督析税 劾促幻 左壱 置悦呪舛析聖 硝焼浬陥.
  2. + +
  3. mod_expires拭 赤澗 走獣嬢研 紫遂馬食 + 督析拭 送羨 幻奄析聖 竺舛馬檎 崎虞酔煽人 覗系獣亜 庚辞研 + 蝶習拝 呪 赤陥.
  4. +
+
top
+
+

奄沙 SSI 走獣嬢

+ +

SSI 走獣嬢税 紫遂狛精 陥製引 旭陥.

+

+ <!--#element attribute=value attribute=value ... --> +

+ +

HTML 爽汐旭戚 持医奄凶庚拭 SSI 奄管聖 亜疑馬走 省焼亀 + HTML 社什拭澗 蟹神走幻 崎虞酔煽澗 巷獣廃陥. SSI研 臣郊稽 + 竺舛馬檎 走獣嬢研 衣引葵生稽 郊菓陥.

+ +

element澗 陥製掻 馬蟹陥. 陥製 噺拭 希 切室備 竺誤拝 依戚陥. + 走榎精 SSI稽 拝 呪 赤澗 護亜走 森研 左昔陥

+ +

神潅 劾促

+ +

+ <!--#echo var="DATE_LOCAL" --> +

+ +

echo element澗 痕呪葵聖 益企稽 窒径廃陥. + CGI 覗稽益轡拭 薦因馬澗 発井痕呪級 須拭亀 食君 妊層 痕呪亜 + 赤陥. 暁, set element研 紫遂馬食 送羨 痕呪研 + 舛税拝 呪亀 赤陥.

+ +

劾促 窒径 莫縦戚 原製拭 級走 省澗陥檎, 陥製引 旭戚 + config element税 timefmt attribute研 + 紫遂廃陥.

+ +

+ <!--#config timefmt="%A %B %d, %Y" -->
+ Today is <!--#echo var="DATE_LOCAL" --> +

+ + +

督析税 呪舛析

+ +

+ 戚 庚辞澗 <!--#flastmod file="index.html" -->拭 原走厳生稽 呪舛鞠醸陥 +

+ +

戚 element亀 timefmt 莫縦 竺舛拭 含携陥.

+ + +

CGI 覗稽益轡 衣引研 匂敗馬奄

+ +

析鋼旋昔 SSI 紫遂狛掻 馬蟹稽, 弦戚級 蕉遂馬澗 ``号庚呪 + 朝錘斗'' 旭精 CGI 覗稽益轡 衣引研 窒径廃陥.

+ +

+ <!--#include virtual="/cgi-bin/counter.pl" --> +

+ + +
top
+
+

蓄亜 森薦

+ + +

陥製精 HTML 庚辞拭 紫遂拝 呪 赤澗 護亜走 SSI 森薦陥.

+ +

戚 庚辞亜 情薦 原走厳生稽 +呪舛鞠醸蟹?

+ +

蒋拭辞 SSI研 紫遂馬食 紫遂切拭惟 庚辞税 置悦呪舛析聖 + 硝険 呪 赤陥壱 源梅陥. 益君蟹 叔薦 号狛精 硝形爽走 省紹陥. + 陥製 坪球研 HTML 庚辞拭 紫遂馬檎 凪戚走拭 獣娃 奄系聖 害延陥. + 弘経 是拭辞 竺誤廃企稽 SSI亜 臣郊稽 拙疑背醤 廃陥.

+

+ <!--#config timefmt="%A %B %d, %Y" -->
+ 戚 庚辞澗 <!--#flastmod file="ssi.shtml" -->拭 原走厳生稽 呪舛鞠醸陥; +

+ +

弘経 ssi.shtml企重 据馬澗 叔薦 督析誤聖 + 紫遂廃陥. 焼巷 凪戚走拭虞亀 細食隔聖 呪 赤澗 骨遂坪球研 + 据廃陥檎, 督析誤 企重 LAST_MODIFIED 痕呪研 + 紫遂廃陥.

+

+ <!--#config timefmt="%D" -->
+ This file last modified <!--#echo var="LAST_MODIFIED" --> +

+ +

timefmt 莫縦拭 企廃 切室廃 舛左澗 伊事殖遭拭辞 + strftime聖 達焼坐虞. 庚狛精 旭陥.

+ + +

妊層 凪戚走 馬舘聖 匂敗馬奄

+ + +

食君 凪戚走亜 赤澗 紫戚闘研 淫軒廃陥檎 凪戚走 穿端研 + 呪舛馬澗 依精, 働備 凪戚走級戚 妊層 須淫聖 亜走亀系 呪舛馬澗 + 依精 舛源稽 雨罫陥.

+ +

凪戚走 雌舘(header)引 馬舘(footer)聖 督析稽 匂敗馬食 + 戚訓 呪舛税 採眼聖 旗 呪 赤陥. 乞窮 凪戚走拭辞 + include SSI 誤敬嬢研 紫遂馬食 凪戚走 馬舘 督析 + 馬蟹研 匂敗馬檎 吉陥. include element税 + file attribute蟹 virtual attribute稽 + 匂敗拝 督析聖 走舛廃陥. file attribute澗 薄仙 + 巨刑塘軒拭 雌企旋昔 督析井稽陥. 聡, (/稽 獣拙馬澗) + 箭企督析井稽蟹 井稽 照拭 ../研 紫遂拝 呪 蒸陥. 焼原亀 辞搾什馬澗 + 庚辞税 雌企 URL聖 走舛拝 呪 赤澗 virtual attribute亜 + 希 政遂拝 依戚陥. 井稽研 /稽 獣拙拝 呪 赤走幻, 匂敗馬形澗 + 督析戚 辞搾什馬澗 督析引 旭精 辞獄拭 赤嬢醤 廃陥.

+

+ <!--#include virtual="/footer.html" --> +

+ +

蟹澗 左搭 戚 砧亜走研 杯団辞 匂敗拝 凪戚走 馬舘 督析拭 + LAST_MODIFIED 走獣嬢研 隔澗陥. 匂敗馬形澗 督析拭亀 + SSI 走獣嬢亜 蟹臣 呪 赤生悟, 戚係惟 匂敗廃 督析戚 陥献 督析聖 + 匂敗馬澗 縦生稽 食君腰 域紗 匂敗拝 呪亀 赤陥.

+ + +
top
+
+

戚須拭 竺舛拝 呪 赤澗 依精?

+ + +

獣娃 莫縦 config(竺舛) 須拭 砧亜走研 希 + config(竺舛)拝 呪 赤陥.

+ +

左搭 SSI 走獣嬢亜 設公鞠檎 陥製引 旭精 庚姥亜 蟹紳陥

+

+ [an error occurred while processing this directive] +

+ +

戚 庚姥研 痕井馬壱 粛陥檎 config element税 + errmsg attribute研 紫遂馬食 痕井廃陥.

+

+ <!--#config errmsg="[It appears that you don't know how to use SSI]" --> +

+ +

紫戚闘研 辞搾什馬奄 穿拭 乞窮 SSI 走獣嬢 庚薦研 背衣馬食 + 紫遂切亜 戚訓 庚姥研 左走 省掩 郊空陥. (益係走?)

+ +

益軒壱 sizefmt attribute亜 鋼発馬澗 督析滴奄 + 莫縦聖 config(竺舛)拝 呪 赤陥. 郊戚闘稽 滴奄研 + 左食爽形檎 bytes, 旋箭備 Kb蟹 Mb稽 滴奄研 + 左食爽形檎 abbrev研 紫遂廃陥.

+
top
+
+

誤敬嬢 叔楳馬奄

+ + +

蟹澗 陥製 含拭 拙精 CGI 覗稽益轡引 SSI研 旭戚 紫遂馬澗 + 越聖 承 森舛戚陥. 走榎精 exec element稽 拝 + 呪 赤澗 陥献 依級聖 竺誤拝 依戚陥. SSI澗 叔薦 秋聖 (舛溌備澗 + /bin/sh蟹 Win32研 紫遂廃陥檎 DOS 秋) 紫遂馬食 + 誤敬嬢研 叔楳廃陥. 森研 級嬢, 陥製精 巨刑塘軒 鯉系聖 左食層陥.

+

+ <pre>
+ <!--#exec cmd="ls" -->
+ </pre> +

+ +

or, on Windows

+

+ <pre>
+ <!--#exec cmd="dir" -->
+ </pre> +

+ +

dir 窒径拭 崎虞酔煽亜 肇疑拝 + ``<dir>'' 庚切伸戚 匂敗鞠赤奄凶庚拭, + 制亀酔綜拭辞 戚 走獣嬢研 紫遂馬檎 衣引亜 繕榎 戚雌拝 依戚陥.

+ +

戚 奄管精 exec 殿益拭 紫遂廃 嬢恐 誤敬嬢虞亀 + 叔楳拝 呪 赤奄凶庚拭 古酔 是蝿馬陥. ``号誤系''引 旭戚 紫遂切亜 + 瀬凪戚走 鎧遂聖 呪舛拝 呪 赤澗 発井戚虞檎, 戚 奄管聖 箭企稽 + 紫遂背識 照吉陥. Options 走獣嬢拭 + IncludesNOEXEC 焼鋭胡闘研 紫遂馬食 SSI研 買遂馬走幻 + exec 奄管聖 厳聖 呪 赤陥.

+
top
+
+

壱厭 SSI 奄狛

+ + +

鎧遂聖 窒径馬澗 奄管 須拭 焼督帖 SSI澗 痕呪 竺舛戚 亜管馬壱, + 搾嘘庚引 繕闇庚拭 戚 痕呪研 紫遂拝 呪 赤陥.

+ +

井壱

+ +

戚 越拭辞 竺誤馬澗 企採歳税 奄管精 焼督帖 1.2 戚板採斗 + 紫遂拝 呪 赤陥. 弘経, 焼督帖 1.2 戚雌聖 紫遂馬走 省澗陥檎 + 焼原亀 察軒 穣益傾戚球背醤 廃陥. 背虞. 走榎 背虞. 奄陥険 + 依戚陥.

+ + +

痕呪 竺舛

+ +

set 走獣嬢研 紫遂馬食 蟹掻拭 紫遂拝 痕呪研 + 竺舛拝 呪 赤陥. 蒋生稽 痕呪亜 琶推馬奄凶庚拭 胡煽 竺誤廃陥. + 庚狛精 陥製引 旭陥.

+

+ <!--#set var="name" value="Rich" --> +

+ +

陥製引 旭戚 葵聖 庚切益企稽 竺舛馬走 省壱 発井痕呪蟹 是拭辞 竺誤廃 痕呪(森研 + 級嬢, LAST_MODIFIED)人 旭戚 陥献 痕呪研 紫遂馬食 + 痕呪葵聖 竺舛拝 呪亀 赤陥. 戚凶 痕呪誤 蒋拭 含君 妊獣($)研 + 細食辞 庚切伸戚 焼観 痕呪績聖 妊獣廃陥.

+ +

<!--#set var="modified" value="$LAST_MODIFIED" --> +

+ +

痕呪葵拭 含君 庚切研 益企稽 脊径馬形檎 含君 妊獣 蒋拭 + 拷十掘習研 紫遂廃陥.

+

+ <!--#set var="cost" value="\$100" --> +

+ +

原走厳生稽 延 庚切伸 掻娃拭 痕呪研 紫遂馬澗汽 及拭 赤澗 + 庚切亀 痕呪誤生稽 神昔馬食 肇疑鞠澗 井酔, 痕呪誤聖 企胤硲稽 + 広嬢辞 溌叔備 廃陥. (疏精 森研 達奄 毘級走幻, 巷充 源昔走 + 戚背馬掩 郊空陥.)

+

+ <!--#set var="date" value="${DATE_LOCAL}_${DATE_GMT}" --> +

+ + +

繕闇 妊薄縦

+ + +

痕呪研 竺舛馬壱 搾嘘拝 呪 赤生艦 繕闇庚戚 亜管馬陥. 戚薦 + SSI亜 析曽税 娃舘廃 覗稽益掘講情嬢亜 吉陥. + mod_include澗 繕闇庚聖 幻球澗 if, + elif, else, endif + 姥繕研 薦因廃陥. 叔薦 廃 凪戚走稽 食君 轄軒旋昔 凪戚走研 + 幻級 呪 赤陥.

+ +

繕闇庚 姥繕澗 陥製引 旭陥.

+

+ <!--#if expr="test_condition" -->
+ <!--#elif expr="test_condition" -->
+ <!--#else -->
+ <!--#endif --> +

+ +

test_condition拭澗 嬢恐 轄軒搾嘘虞亀 紫遂拝 + 呪 赤陥. 葵聖 陥献 葵引 搾嘘馬暗蟹, 働舛 葵戚 ``凧''昔走 + 伊紫廃陥. (庚切伸戚 搾嬢赤走 省生檎 凧戚陥.) 紫遂亜管廃 + 搾嘘 尻至切研 乞砧 左形檎, mod_include + 庚辞研 凧壱馬虞. 陥製精 繕闇庚聖 紫遂廃 護亜走 森薦陥.

+ +

竺舛督析拭 陥製 匝聖 蓄亜廃陥.

+

+ BrowserMatchNoCase macintosh Mac
+ BrowserMatchNoCase MSIE InternetExplorer +

+ +

適虞戚情闘亜 呼轍塘獣拭辞 叔楳馬澗 Internet Explorer虞檎 + 発井痕呪 ``Mac''引 ``InternetExplorer'' 乞砧 凧生稽 竺舛廃陥.

+ +

益軒壱 SSI 庚辞拭 陥製引 旭戚 旋澗陥.

+

+ <!--#if expr="${Mac} && ${InternetExplorer}" -->
+ 食奄拭 紫引庚亜 蟹紳陥
+ <!--#else -->
+ 食奄拭 鈷遭 JavaScript 坪球亜 蟹紳陥
+ <!--#endif --> +

+ +

鎧亜 古轍塘獣 IE拭 鋼姶戚 赤澗 依精 焼艦陥. 蟹澗 舘走 + 煽腰爽拭 陥献 員拭辞澗 庚薦亜 蒸澗 JavaScript 坪球亜 古轍塘獣 + IE拭辞澗 疑拙馬走 省焼辞 護獣娃聖 壱持梅陥. 是澗 績獣 + 背衣奪戚陥.

+ +

(送羨 舛税馬心闇 析鋼 発井痕呪戚闇) 嬢恐 痕呪虞亀 繕闇庚拭 + 紫遂拝 呪 赤陥. 焼虞帖澗 SetEnvIf蟹 陥献 淫恵 + 走獣嬢稽 発井痕呪研 竺舛拝 呪 赤奄凶庚拭 CGI 蒸戚亀 鈷走惟 + 疑旋昔 鎧遂聖 幻級 呪 赤陥.

+ +
top
+
+

衣経

+ +

SSI澗 溌叔備 CGI蟹 疑旋昔 瀬凪戚走研 持失馬澗 陥献 奄綬聖 + 企端拝 呪 蒸陥. 益君蟹 弦精 蓄亜 拙穣蒸戚 凪戚走拭 疑旋昔 + 鎧遂聖 繕榎 蓄亜馬奄拭澗 版権廃 号狛戚陥.

+
+
+

亜管廃 情嬢:  en  | + ja  | + ko 

+
+ \ No newline at end of file -- cgit v1.2.3