From: Yoshiki Hayashi Date: Wed, 22 May 2002 10:22:40 +0000 (+0000) Subject: New Japanese translation. Forward port from 1.3. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88f9cf495cfd4b6c1cdcb67b60a531039a5b0e99;p=apache New Japanese translation. Forward port from 1.3. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95214 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/suexec.html b/docs/manual/suexec.html deleted file mode 100644 index 0448c942ec..0000000000 --- a/docs/manual/suexec.html +++ /dev/null @@ -1,620 +0,0 @@ - - - - - - - Apache suEXEC Support - - - - - - -

Apache suEXEC Support

- -
    -
  1. CONTENTS
  2. - -
  3. What is suEXEC?
  4. - -
  5. Before we begin.
  6. - -
  7. suEXEC Security Model.
  8. - -
  9. Configuring & Installing - suEXEC
  10. - -
  11. Enabling & Disabling - suEXEC
  12. - -
  13. Using suEXEC
  14. - -
  15. Debugging suEXEC
  16. - -
  17. Beware the Jabberwock: Warnings - & Examples
  18. -
-
-
- - -

What is suEXEC?

- -

The suEXEC feature -- - introduced in Apache 1.2 -- provides Apache users the ability - to run CGI and SSI programs - under user IDs different from the user ID of the calling - web-server. Normally, when a CGI or SSI program executes, it - runs as the same user who is running the web server.

- -

Used properly, this feature can reduce - considerably the security risks involved with allowing users to - develop and run private CGI or SSI programs. However, if suEXEC - is improperly configured, it can cause any number of problems - and possibly create new holes in your computer's security. If - you aren't familiar with managing setuid root programs and the - security issues they present, we highly recommend that you not - consider using suEXEC.

- -

BACK TO - CONTENTS

- -

Before we begin.

- -

Before jumping head-first into this document, - you should be aware of the assumptions made on the part of the - Apache Group and this document.

- -

First, it is assumed that you are using a UNIX - derivate operating system that is capable of - setuid and setgid operations. - All command examples are given in this regard. Other platforms, - if they are capable of supporting suEXEC, may differ in their - configuration.

- -

Second, it is assumed you are familiar with - some basic concepts of your computer's security and its - administration. This involves an understanding of - setuid/setgid operations and the various - effects they may have on your system and its level of - security.

- -

Third, it is assumed that you are using an - unmodified version of suEXEC code. All code - for suEXEC has been carefully scrutinized and tested by the - developers as well as numerous beta testers. Every precaution - has been taken to ensure a simple yet solidly safe base of - code. Altering this code can cause unexpected problems and new - security risks. It is highly recommended you - not alter the suEXEC code unless you are well versed in the - particulars of security programming and are willing to share - your work with the Apache Group for consideration.

- -

Fourth, and last, it has been the decision of - the Apache Group to NOT make suEXEC part of - the default installation of Apache. To this end, suEXEC - configuration requires of the administrator careful attention - to details. After due consideration has been given to the - various settings for suEXEC, the administrator may install - suEXEC through normal installation methods. The values for - these settings need to be carefully determined and specified by - the administrator to properly maintain system security during - the use of suEXEC functionality. It is through this detailed - process that the Apache Group hopes to limit suEXEC - installation only to those who are careful and determined - enough to use it.

- -

Still with us? Yes? Good. Let's move on!

- -

BACK TO - CONTENTS

- -

suEXEC Security Model

- -

Before we begin configuring and installing - suEXEC, we will first discuss the security model you are about - to implement. By doing so, you may better understand what - exactly is going on inside suEXEC and what precautions are - taken to ensure your system's security.

- -

suEXEC is based on a setuid - "wrapper" program that is called by the main Apache web server. - This wrapper is called when an HTTP request is made for a CGI - or SSI program that the administrator has designated to run as - a userid other than that of the main server. When such a - request is made, Apache provides the suEXEC wrapper with the - program's name and the user and group IDs under which the - program is to execute.

- -

The wrapper then employs the following process - to determine success or failure -- if any one of these - conditions fail, the program logs the failure and exits with an - error, otherwise it will continue:

- -
    -
  1. - Was the wrapper called with the proper number of - arguments? - -
    - The wrapper will only execute if it is given the proper - number of arguments. The proper argument format is known - to the Apache web server. If the wrapper is not receiving - the proper number of arguments, it is either being - hacked, or there is something wrong with the suEXEC - portion of your Apache binary. -
    -
  2. - -
  3. - Is the user executing this wrapper a valid user of - this system? - -
    - This is to ensure that the user executing the wrapper is - truly a user of the system. -
    -
  4. - -
  5. - Is this valid user allowed to run the - wrapper? - -
    - Is this user the user allowed to run this wrapper? Only - one user (the Apache user) is allowed to execute this - program. -
    -
  6. - -
  7. - Does the target program have an unsafe hierarchical - reference? - -
    - Does the target program contain a leading '/' or have a - '..' backreference? These are not allowed; the target - program must reside within the Apache webspace. -
    -
  8. - -
  9. - Is the target user name valid? - -
    - Does the target user exist? -
    -
  10. - -
  11. - Is the target group name valid? - -
    - Does the target group exist? -
    -
  12. - -
  13. - Is the target user NOT superuser? - - -
    - Presently, suEXEC does not allow 'root' to execute - CGI/SSI programs. -
    -
  14. - -
  15. - Is the target userid ABOVE the minimum ID - number? - -
    - The minimum user ID number is specified during - configuration. This allows you to set the lowest possible - userid that will be allowed to execute CGI/SSI programs. - This is useful to block out "system" accounts. -
    -
  16. - -
  17. - Is the target group NOT the superuser - group? - -
    - Presently, suEXEC does not allow the 'root' group to - execute CGI/SSI programs. -
    -
  18. - -
  19. - Is the target groupid ABOVE the minimum ID - number? - -
    - The minimum group ID number is specified during - configuration. This allows you to set the lowest possible - groupid that will be allowed to execute CGI/SSI programs. - This is useful to block out "system" groups. -
    -
  20. - -
  21. - Can the wrapper successfully become the target user - and group? - -
    - Here is where the program becomes the target user and - group via setuid and setgid calls. The group access list - is also initialized with all of the groups of which the - user is a member. -
    -
  22. - -
  23. - Does the directory in which the program resides - exist? - -
    - If it doesn't exist, it can't very well contain files. -
    -
  24. - -
  25. - Is the directory within the Apache - webspace? - -
    - If the request is for a regular portion of the server, is - the requested directory within the server's document - root? If the request is for a UserDir, is the requested - directory within the user's document root? -
    -
  26. - -
  27. - Is the directory NOT writable by anyone - else? - -
    - We don't want to open up the directory to others; only - the owner user may be able to alter this directories - contents. -
    -
  28. - -
  29. - Does the target program exist? - -
    - If it doesn't exists, it can't very well be executed. -
    -
  30. - -
  31. - Is the target program NOT writable by - anyone else? - -
    - We don't want to give anyone other than the owner the - ability to change the program. -
    -
  32. - -
  33. - Is the target program NOT setuid or - setgid? - -
    - We do not want to execute programs that will then change - our UID/GID again. -
    -
  34. - -
  35. - Is the target user/group the same as the program's - user/group? - -
    - Is the user the owner of the file? -
    -
  36. - -
  37. - Can we successfully clean the process environment - to ensure safe operations? - -
    - suEXEC cleans the process' environment by establishing a - safe execution PATH (defined during configuration), as - well as only passing through those variables whose names - are listed in the safe environment list (also created - during configuration). -
    -
  38. - -
  39. - Can we successfully become the target program and - execute? - -
    - Here is where suEXEC ends and the target program begins. -
    -
  40. -
-
-
- - -

This is the standard operation of the the - suEXEC wrapper's security model. It is somewhat stringent and - can impose new limitations and guidelines for CGI/SSI design, - but it was developed carefully step-by-step with security in - mind.

- -

For more information as to how this security - model can limit your possibilities in regards to server - configuration, as well as what security risks can be avoided - with a proper suEXEC setup, see the "Beware the Jabberwock" section of this - document.

- -

BACK TO - CONTENTS

- -

Configuring & Installing - suEXEC

- -

Here's where we begin the fun. If you use - Apache 1.2 or prefer to configure Apache 1.3 with the - "src/Configure" script you have to edit the suEXEC - header file and install the binary in its proper location - manually. The following sections describe the configuration and - installation for Apache 1.3 with the AutoConf-style interface - (APACI).

- -

APACI's suEXEC configuration - options
-

- -
-
--enable-suexec
- -
This option enables the suEXEC feature which is never - installed or activated by default. At least one - --with-suexec-xxxxx option has to be provided together with the - --enable-suexec option to let APACI accept your request for - using the suEXEC feature.
- -
--with-suexec-caller=UID
- -
The username under which - Apache normally runs. This is the only user allowed to - execute this program.
- -
--with-suexec-docroot=DIR
- -
Define as the DocumentRoot set for Apache. This will be - the only hierarchy (aside from UserDirs) that can be used for - suEXEC behavior. The default directory is the --datadir value - with the suffix "/htdocs", e.g. if you configure - with "--datadir=/home/apache" the directory - "/home/apache/htdocs" is used as document root for the suEXEC - wrapper.
- -
--with-suexec-logfile=FILE
- -
This defines the filename to which all suEXEC - transactions and errors are logged (useful for auditing and - debugging purposes). By default the logfile is named - "suexec_log" and located in your standard logfile directory - (--logfiledir).
- -
--with-suexec-userdir=DIR
- -
Define to be the subdirectory under users' home - directories where suEXEC access should be allowed. All - executables under this directory will be executable by suEXEC - as the user so they should be "safe" programs. If you are - using a "simple" UserDir directive (ie. one without a "*" in - it) this should be set to the same value. suEXEC will not - work properly in cases where the UserDir directive points to - a location that is not the same as the user's home directory - as referenced in the passwd file. Default value is - "public_html".
- If you have virtual hosts with a different UserDir for each, - you will need to define them to all reside in one parent - directory; then name that parent directory here. If - this is not defined properly, "~userdir" cgi requests will - not work!
- -
--with-suexec-uidmin=UID
- -
Define this as the lowest UID allowed to be a target user - for suEXEC. For most systems, 500 or 100 is common. Default - value is 100.
- -
--with-suexec-gidmin=GID
- -
Define this as the lowest GID allowed to be a target - group for suEXEC. For most systems, 100 is common and - therefore used as default value.
- -
--with-suexec-safepath=PATH
- -
Define a safe PATH environment to pass to CGI - executables. Default value is - "/usr/local/bin:/usr/bin:/bin".
-
-
-
- - -

Checking your suEXEC - setup
- Before you compile and install the suEXEC wrapper you can - check the configuration with the --layout option.
- Example output:

-
-    suEXEC setup:
-            suexec binary: /usr/local/apache/sbin/suexec
-            document root: /usr/local/apache/share/htdocs
-           userdir suffix: public_html
-                  logfile: /usr/local/apache/var/log/suexec_log
-                safe path: /usr/local/bin:/usr/bin:/bin
-                caller ID: www
-          minimum user ID: 100
-         minimum group ID: 100
-
-
-
- - -

Compiling and installing the suEXEC - wrapper
- If you have enabled the suEXEC feature with the - --enable-suexec option the suexec binary (together with Apache - itself) is automatically built if you execute the command - "make".
- After all components have been built you can execute the - command "make install" to install them. The binary image - "suexec" is installed in the directory defined by the --sbindir - option. Default location is - "/usr/local/apache/sbin/suexec".
- Please note that you need root - privileges for the installation step. In order - for the wrapper to set the user ID, it must be installed as - owner root and must have the setuserid - execution bit set for file modes.

- -

BACK TO - CONTENTS

- -

Enabling & Disabling - suEXEC

- -

Upon startup of Apache, it looks for the file - "suexec" in the "sbin" directory (default is - "/usr/local/apache/sbin/suexec"). If Apache finds a properly - configured suEXEC wrapper, it will print the following message - to the error log:

-
-    [notice] suEXEC mechanism enabled (wrapper: /path/to/suexec)
-
- If you don't see this message at server startup, the server is - most likely not finding the wrapper program where it expects - it, or the executable is not installed setuid root. -
- If you want to enable the suEXEC mechanism for the first time - and an Apache server is already running you must kill and - restart Apache. Restarting it with a simple HUP or USR1 signal - will not be enough.
- If you want to disable suEXEC you should kill and restart - Apache after you have removed the "suexec" file.
-
- - -

BACK TO - CONTENTS

- -

Using suEXEC

- -

Virtual Hosts:
- One way to use the suEXEC wrapper is through the User and Group directives in VirtualHost definitions. - By setting these directives to values different from the main - server user ID, all requests for CGI resources will be executed - as the User and Group defined for that - <VirtualHost>. If only one or neither of - these directives are specified for a - <VirtualHost> then the main server userid is - assumed.

- -

User directories:
- The suEXEC wrapper can also be used to execute CGI programs as - the user to which the request is being directed. This is - accomplished by using the "~" - character prefixing the user ID for whom execution is desired. - The only requirement needed for this feature to work is for CGI - execution to be enabled for the user and that the script must - meet the scrutiny of the security checks - above.

- -

BACK TO - CONTENTS

- -

Debugging suEXEC

- -

The suEXEC wrapper will write log information - to the file defined with the --with-suexec-logfile option as - indicated above. If you feel you have configured and installed - the wrapper properly, have a look at this log and the error_log - for the server to see where you may have gone astray.

- -

BACK TO - CONTENTS

- -

Beware the Jabberwock: - Warnings & Examples

- -

NOTE! This section may not be - complete. For the latest revision of this section of the - documentation, see the Apache Group's Online - Documentation version.

- -

There are a few points of interest regarding - the wrapper that can cause limitations on server setup. Please - review these before submitting any "bugs" regarding suEXEC.

- - - -

BACK TO - CONTENTS

- - - - diff --git a/docs/manual/suexec.html.ja.jis b/docs/manual/suexec.html.ja.jis new file mode 100644 index 0000000000..70b2ee33e3 --- /dev/null +++ b/docs/manual/suexec.html.ja.jis @@ -0,0 +1,613 @@ + + + + + + Apache suEXEC Support + + + + + + + +

Apache suEXEC Support

+ +
    + +
  1. 目次
  2. + +
  3. suEXEC とは?
  4. + +
  5. 始める前に
  6. + +
  7. suEXEC のセキュリティモデル
  8. + +
  9. suEXEC の設定とインストール
  10. + +
  11. suEXEC の有効化と無効化
  12. + +
  13. suEXEC の使用
  14. + +
  15. suEXEC のデバッグ
  16. + +
  17. とかげに注意: 警告と事例
  18. + +
+
+
+ +

suEXEC とは?

+ +

Apache 1.2 で導入された suEXEC + 機能により、Apache ユーザは Web サーバを実行しているユーザ ID とは + 異なるユーザ ID で CGI プログラムや SSI + プログラムを実行することができます。CGI プログラムまたは SSI + プログラムを実行する場合、通常は web サーバと同じユーザで実行されます。 +

+ +

適切に使用すると、この機能によりユーザが個別の CGI + や SSI プログラムを開発し実行することで生じるセキュリティ上の危険を、 + かなり減らすことができます。しかし、suEXEC の設定が不適切だと、 + 多くの問題が生じ、あなたのコンピュータに新しいセキュリティホールを + 作ってしまう可能性があります。あなたが root に setuid + されたプログラムと、それらから生じるセキュリティ上の問題の管理に + 詳しくないようなら、suEXEC の使用を検討しないように強く推奨します。 +

+ +

目次に戻る +

+ +

始める前に

+ +

この文書の先頭に飛ぶ前に、Apache + グループとこの文書での仮定を知っておくべきでしょう。 +

+ +

第 1 に、あなたが setuid と + setgid 操作が可能な UNIX + 由来のオペレーティングシステムを使っていることを想定しています。 + これは、すべてのコマンド例にあてはまります。 + その他のプラットホームでは、もし suEXEC + がサポートされていたとしても設定は異なるかもしれません。

+ +

第 2 に、あなたが使用中のコンピュータの + セキュリティに関する基本的な概念と、それらの管理について詳しいことを + 想定しています。これは、setuid/setgid + 操作、あなたのシステム上でのその操作による様々な効果、 + セキュリティレベルについてあなたが理解しているということを含みます。 +

+ +

第 3 に、改造されていない suEXEC + コードの使用を想定しています。suEXEC のコードは、 + 多くのベータテスタだけでなく、開発者によっても注意深く精査され + テストされています。それらの注意により、簡潔で信頼できる安全な + コードの基盤が保証されます。このコードを改変することで、 + 予期されない問題や新しいセキュリティ上の危険が生じることがあります。 + セキュリティプログラミングの詳細に通じていて、 + 今後の検討のために成果を Apache + グループと共有しようと思うのでなければ、suEXEC + コードは変えないことを 強く推奨します。

+ +

第 4 に、これが最後ですが、suEXEC を Apache + のデフォルトインストールには含めないことが + Apache グループで決定されています。これは、suEXEC + の設定には管理者の詳細にわたる慎重な注意が必要だからです。 + suEXEC の様々な設定について検討が終われば、管理者は suEXEC + を通常のインストール方法でインストールすることができます。 + これらの設定値は、suEXEC + 機能の使用中にシステムセキュリティを適切に保つために、 + 管理者によって慎重に決定され指定されることが必要です。 + この詳細な手順により、Apache グループは、suEXEC + のインストールについて、注意深く十分に検討してそれを使用することを + 決定した場合に限っていただきたいと考えています。 +

+ +

それでも進みますか? よろしい。では、先へ進みましょう!

+ +

目次に戻る

+ +

suEXEC セキュリティモデル

+ +

suEXEC の設定とインストールを始める前に、 + まず実装しようとしているセキュリティモデルについて論じておきます。 + それには、suEXEC の内部で行なわれていること、 + システムのセキュリティを保証するために警告されることを + よく理解しておいた方がよいでしょう。

+ +

suEXEC は、Apache web + サーバから呼び出される setuid された "wrapper" + プログラムが基本となっています。設計した CGI、または SSI + プログラムへの HTTP リクエストがあると、この wrapper + が呼び出されます。このようなリクエストがあると、Apache + はそのプログラムが実行される際のプログラム名とユーザ ID とグループ + ID を指定して suEXEC wrapper を実行します。 +

+ +

それから、wrapper は成功または失敗を決定するため + 以下の処理を行ないます。これらの状態のうち一つでも失敗した場合、 + プログラムは失敗をログに記録してエラーで終了します。 + そうでなければ、後の処理が続けられます。

+ +
    +
  1. + wrapper が適切な数の引数で呼び出されたか? + + +
    + wrapper は適切な数の引数が与えられた場合にのみ実行されます。 + 適切な引数のフォーマットは Apache Web サーバに解釈されます。 + 適切な数の引数を受け取らなければ、攻撃をされたか + あなたの Apache バイナリの suEXEC の部分が + どこかおかしい可能性があります。 +
    +
  2. + + +
  3. + wrapper + を実行しているユーザはこのシステムの正当なユーザか? + +
    + これは、wrapper を実行しているユーザが + 本当にシステムの利用者であることを保証するためです。 +
    +
  4. + +
  5. + この正当なユーザは wrapper + の実行を許可されているか? + +
    + このユーザは wrapper 実行を許可されたユーザですか? + ただ一人のユーザ (Apache ユーザ) だけが、 + このプログラムの実行を許可されます。 +
    +
  6. + +
  7. + 対象のプログラムが安全でない階層の参照をしているか? + + +
    + 対象のプログラムが '/' から始まる、または + '..' による参照を行なっていますか? これらは許可されません。 + 対象のプログラムは Apache の web 空間内になければなりません。 +
    +
  8. + +
  9. + 対象となるユーザ名は正当なものか? + +
    + 対象となるユーザ名は存在していますか? +
    +
  10. + +
  11. + 対象となるグループ名は正当なものか? + +
    + 対象となるグループ名は存在していますか? +
    +
  12. + +
  13. + 目的のユーザはスーパーユーザではないか? + + +
    + 今のところ、suEXEC は 'root' による CGI/SSI + プログラムの実行を許可していません。 +
    +
  14. + +
  15. + 対象となるユーザ ID は、最小の ID + 番号よりも大きいか? + +
    + 最小ユーザ ID 番号は設定時に指定されます。これは、 + CGI/SSI プログラム実行を許可されるユーザ ID + のとりうる最小値です。これは + "system" 用のアカウントを閉め出すのに有効です。 +
    +
  16. + +
  17. + 対象となるグループはスーパーユーザのグループでは + ないか? + +
    + 今のところ、suEXEC は 'root' グループによる CGI/SSI + プログラムの実行を許可していません。 +
    +
  18. + +
  19. + 対象となるグループ ID は最小の ID + 番号よりも大きいか? + +
    + 最小グループ ID 番号は設定時に指定されます。これは、 + CGI/SSI プログラム実行を許可されるグループ + ID のとりうる最小値です。 + これは "system" 用のグループを閉め出すのに有効です。 +
    +
  20. + +
  21. + wrapper が正常に対象となるユーザとグループになれるか? + + +
    + ここで、setuid と setgid + の起動によりプログラムは対象となるユーザとグループになります。 + グループアクセスリストは、 + ユーザが属しているすべてのグループで初期化されます。 +
    +
  22. + +
  23. + プログラムが置かれるディレクトリは存在しているか? + + +
    + ディレクトリが存在しないなら、そのファイルも存在しないかもしれません。 +
    +
  24. + +
  25. + ディレクトリが Apache のドキュメントツリー内にあるか? + + +
    + リクエストがサーバ内のものであれば、 + 要求されたディレクトリがサーバのドキュメントルート配下にありますか? + リクエストが UserDir のものであれば、 + 要求されたディレクトリがユーザのドキュメントルート配下にありますか? +
    +
  26. + +
  27. + ディレクトリを他のユーザが書き込めるようになって + いないか? + +
    + ディレクトリを他ユーザに開放しないようにします。 + 所有ユーザだけがこのディレクトリの内容を改変できるようにします。 +
    +
  28. + + +
  29. + 対象となるプログラムは存在するか? + +
    + 存在しなければ実行できません。 +
    +
  30. + +
  31. + 対象となるプログラムファイルが他アカウントから + 書き込めるようになっていないか? + +
    + 所有者以外にはプログラムを変更する権限は与えられません。 +
    +
  32. + + +
  33. + 対象となるプログラムが setuid または setgid + されていないか? + +
    + UID/GID を再度変更してのプログラム実行はしません +
    +
  34. + + +
  35. + 対象となるユーザ/グループがプログラムの + ユーザ/グループと同じか? + +
    + ユーザがそのファイルの所有者ですか? +
    +
  36. + +
  37. + 安全な動作を保証するための環境変数クリアが可能か? + + +
    + suEXEC は、安全な環境変数のリスト + (これらは設定時に作成されます) 内の変数として渡される安全な + PATH 変数 (設定時に指定されます) を設定することで、 + プロセスの環境変数をクリアします。 +
    +
  38. + + +
  39. + 対象となるプログラムを exec して実行できるか? + + +
    + ここで suEXEC が終了し、対象となるプログラムが開始されます。 +
    +
  40. +
+
+
+ +

ここまでが suEXEC の wrapper + におけるセキュリティモデルの標準的な動作です。もう少し厳重に + CGI/SSI 設計についての新しい制限や規定を取り入れることもできますが、 + suEXEC はセキュリティに注意して慎重に少しずつ開発されてきました。 +

+ +

このセキュリティモデルを用いて + サーバ設定時にどのように許すことを制限するか、また、suEXEC + を適切に設定するとどのようなセキュリティ上の危険を避けられるかに + 関するより詳しい情報については、"とかげに注意" + (Beware the Jabberwock) の章を参照してください。 +

+ +

目次に戻る

+ +

suEXEC + の設定とインストール

+ +

ここから楽しくなります。Apache 1.2 あるいは + "src/Configure" スクリプトで Apache 1.3 を設定するなら、 + suEXEC ヘッダファイルを編集してバイナリを適切な場所に手作業で + インストールしなければなりません。 + 以下の章では、AutoConf-style インタフェース (APACI) を使った + Apache 1.3 での設定とインストールについて述べています。 +

+ +

APACI の suEXEC + 設定オプション
+

+ +
+
--enable-suexec
+ +
このオプションは、デフォルトではインストールされず、 + 有効にはならない suEXEC 機能を有効にします。 + suEXEC を使うように APACI に要求するには、--enable-suexec + オプションにあわせて少なくとも一つは --with-suexec-xxxxx + オプションが指定されなければなりません。
+ +
--with-suexec-caller=UID
+ +
Apache を通常動作させるユーザ名を指定します。 + このユーザだけが suexec の実行を許可されたユーザになります。
+ +
--with-suexec-docroot=DIR
+ +
Apache のドキュメントルートを設定します。これが suEXEC + の動作で使用する唯一のディレクトリ階層になります (UserDir + の指定は別)。デフォルトでは --datedir に "/htdocs" + というサフィックスをつけたものです。 + "--datadir=/home/apache" として設定すると、 + suEXEC wrapper にとって "/home/apache/htdocs" + がドキュメントルートとして使われます。
+ +
--with-suexec-logfile=FILE
+ +
suEXEC の処理とエラーが記録されるファイル名を指定します。 + (監査やデバッグ目的に有用) + デフォルトではログファイルは "suexec_log" という名前で、 + 標準のログファイルディレクトリ (--logfiledir) に置かれます。 +
+ +
--with-suexec-userdir=DIR
+ +
suEXEC がアクセスを許されるユーザホームディレクトリ配下の + サブディレクトリを指定します。 + このディレクトリ以下の全実行ファイルは、"安全な"プログラムになるよう、 + suEXEC がそのユーザとして実行できるようにします。 + "単純な" UserDir ディレクティブを使っている場合 + (すなわち "*" を含まないもの)、これと同じ値を設定すべきです。 + Userdir ディレクティブがそのユーザのパスワードファイル内の + ホームディレクトリと同じ場所を指していなければ、 + suEXEC は適切に動作しません。デフォルトは "public_html" です。 +
+ 各 UserDir が異なった仮想ホストを設定している場合、 + それらを全て一つの親ディレクトリに含めて、 + その親ディレクトリの名前をここで指定する必要があります。 + このように指定されなければ "~userdir" cgi + へのリクエストが動作しません。
+ +
--with-suexec-uidmin=UID
+ +
suEXEC の対象ユーザとして許される UID の最小値を指定します。 + 大抵のシステムでは 500 か 100 が一般的です。 + デフォルト値は 100 です。
+ +
--with-suexec-gidmin=GID
+ +
suEXEC の対象グループとして許される GID + の最小値を指定します。大抵のシステムでは 100 が一般的なので、 + デフォルト値としても 100 が使われています。
+ +
--with-suexec-safepath=PATH
+ +
CGI 実行ファイルに渡される安全な PATH 環境変数です。 + デフォルト値は "/usr/local/bin:/usr/bin:/bin" です。 +
+
+
+
+ +

suEXEC 設定の確認 +
+ suEXEC wrapper をコンパイルしてインストールする前に、設定内容を + --layout オプションで確認できます。
+ 出力例:

+
+    suEXEC setup:
+            suexec binary: /usr/local/apache/sbin/suexec
+            document root: /usr/local/apache/share/htdocs
+           userdir suffix: public_html
+                  logfile: /usr/local/apache/var/log/suexec_log
+                safe path: /usr/local/bin:/usr/bin:/bin
+                caller ID: www
+          minimum user ID: 100
+         minimum group ID: 100
+
+
+
+ +

suEXEC wrapper + のコンパイルとインストール
+ --enable-suexec オプションで suEXEC 機能を有効にすると、 + "make" コマンドを実行した時に suEXEC のバイナリ (Apache 自体も) + が自動的に作成されます。 +
+ すべての構成要素が作成されると、それらのインストールには + "make install" コマンドが実行できます。バイナリイメージの "suexec" + は --sbindir オプションで指定されたディレクトリにインストールされます。 + デフォルトの場所は "/usr/local/apache/sbin/suexec" です。
+ インストール時には root + 権限が必要なので注意してください。wrapper がユーザ ID + を設定するために、所有者 root + でのセットユーザ ID + ビットをそのファイルのモードに設定しなければなりません。 +

+ +

目次に戻る

+ +

suEXEC + の有効化と無効化

+ +

起動時に、Apache は "sbin" ディレクトリで + "suexec" を探します + (デフォルトは "/usr/local/apache/sbin/suexec") 。 + 適切に設定された suEXEC がみつかると、 + エラーログに以下のメッセージが出力されます。

+
+    [notice] suEXEC mechanism enabled (wrapper: /path/to/suexec)
+
+ +

サーバ起動時にこのメッセージが出ない場合、 + 大抵はサーバが想定した場所で wrapper プログラムが見つからなかったか、 + setuid root としてインストールされていないかです。 +
+ suEXEC の仕組みを使用するのが初めてで、Apache が既に動作中であれば、 + Apache を kill して、再起動しなければなりません。HUP シグナルや + USR1 シグナルによる単純な再起動では不十分です。
+ suEXEC を無効にする場合は、"suexec" ファイルを削除してから + Apache を kill して再起動します。 +

+ +

目次に戻る

+ +

suEXEC の使用

+ +

仮想ホスト:
+ suEXEC wrapper の使い方として、 + 仮想ホスト設定での + User ディレクティブと + Group + ディレクティブを通したものがあります。 + これらのディレクティブをメインサーバのユーザ ID + と異なるものにすると、CGI リソースへのすべてのリクエストは、その + <VirtualHost> で指定された User と + Group として実行されます。<VirtualHost> + でそれらのディレクティブのどちらか、または両方が指定されていない場合、 + メインサーバのユーザ ID が想定されます。

+ +

ユーザディレクトリ:
+ suEXEC wrapper は、リクエスト先のユーザとして CGI + を実行するためにも使えます。これは期待する実行権限のユーザ ID + の前に、"~" + 文字を置くことで実現されます。 + この機能を動作させるために必要なことは、CGI + をそのユーザで実行できること、そのスクリプトが上記のセキュリティ検査をパスできることです。 +

+ +

目次に戻る

+ +

suEXEC のデバッグ

+ +

suEXEC wrapper は、上記で述べた --with-suexec-logfile + オプションで指定されたファイルにログ情報を記録します。 + wrapper を適切に設定、インストールできていると思う場合、 + どこで迷っているか見ようとするならこのログとサーバの + エラーログを見るとよいでしょう。

+ +

目次に戻る

+ +

とかげに注意: 警告と事例

+ +

注意! + この章は完全ではありません。この章の最新改訂版については、 + Apache グループの + オンラインドキュメント版を参照してください。 +

+ +

サーバの設定に制限をもうける wrapper について、 + いくつか興味深い点があります。suEXEC に関する "バグ" + を報告する前にこれらを確認してください。

+ + + +

目次に戻る

+ + +