サーバー構築 セキュリティ TCP/IP基礎 TIPS 書籍 ブログ

Web全体 サイト内検索

 サーバー構築導入編
はじめにお読みください
自宅サーバー構築前の準備
固定IPアドレスのススメ
参考:自宅サーバー環境
 ルータ設定編
ルータとは何か/ルータの賢い選び方
手動でIPアドレスを設定する
NAT/IPマスカレードとDMZの違い
 Apacheでのサーバー構築
WWWサーバー構築の流れ
Apache2.0の導入/インストール
Apacheの構造
Apache とにかくこれがやりたい!
ブラウザでの確認/Webページ公開
Apache(1.3)の設定 PART①
Apache(1.3)の設定 PART②
制御ファイル「.htaccess」
付録:Apacheの設定 索引
AN HTTPDの設定
ApacheLogViewer でアクセスログ解析
 DynamicDNSを利用する編
Dynamic DNSとは?
Dynamic DNSの管理
無通信状態での自動切断の防止策
急げ!新ドメインは早いもの勝ち!
 FTPサーバーの構築編
War FTPのインストール[ Ver.1.82 ]
War FTPの設定[ Ver.1.82 ]
War FTPの設定:基礎編 [ Ver1.65 ]
FTPサーバーの動作確認/ログイン
コラム:パーミッションの設定
FTPコマンドでファイル転送する
TFTPサーバーの構築/コマンド
 メールサーバーの構築編
メールサーバーソフトのインストール
メールサーバーソフトの基本設定
 VNCサーバーの構築編
TightVNCによるVNCサーバーの構築
 バックアップ編
True Imageのインストール
True Imageによるイメージバックアップ
True Imageによるバックアップからの復元
 自宅サーバー関連書籍

「全部フリーソフトで作るシリーズ」のWindowsXP版。初心者でもわかりやすい解説で人気のある1冊です。これから初めてサーバー構築する方には特にオススメ!


Apache2の逆引きリファレンス。知りたいと思ったディレクティブが簡単に引けて大変重宝しています。内容も非常に濃いのでこんな機能があったのか~と思わず感動してしまう事も。お勧め。
 レンタルサーバー
Xbit(エクスビット)
さくらインターネット
ロリポップ!
 個人情報(IPアドレス)の確認
SSI環境変数
 関連ソフトウェアDOWNLORD
AN HTTPD
Apache
BlackJumboDog
Tiny FTP
War FTP
3CDaemon
ArGoSoft Mail Server
DiCE
九十九電機




Apacheの構造」で「httpd.conf」の大まかな構造が理解できたところで、実際に「httpd.conf」の編集の作業に移ります。Apacheのインストールした場所から「conf」フォルダを探して、「httpd.conf」ファイルをメモ帳などのテキストエディタで開いてください。なお、デフォルトでは「httpd.conf」はアプリケーションの関連付けがなされていないため、ダブルクリックでは開けないので注意してください。もし、わざわざメモ帳を起動してからファイルを開くのが面倒くさい方は、適当なフォルダを開いて「ツール」→「フォルダオプション」→「ファイルタイプ」でアプリケーションの関連付けを行ってください。尚、「httpd.conf」を編集する際、間違えて記述してしまいどこをどういじったのかわからなくなってしまった場合のために、デスクトップなどに「httpd.conf」をコピーしてから作業にとりかかるようにしてください。もし、コピーをする事も忘れてしまった場合は「conf」フォルダに「httpd.conf」と同じ内容の「httpd.default.conf」があるので緊急用に使用するようにすると良いでしょう。






まずは、セクション1の「Global Environment」から説明していきます。ディレクティブが有効な場合は「赤の太字」、ディレクティブを無効にしている場合はハッシュマーク(#)を付け足して、「青の太字」で記述しています。

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone. Inetd mode is only supported on
# Unix platforms.
# 
ServerType standalone
⇒サーバーの起動方法
サーバーの起動方法です。他に「inetd」が設定できますが、UNIX系OSを使用している場合のみなのでウィンドウズの方は必然的に「standalone」になります。

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
# 
ServerRoot "C:/Program Files/Apache Group/Apache"
⇒サーバーのルートディレクトリ
Apacheインストール時に設定した内容が反映されています。重要なコンテンツを含んだセキュアなサイトを公開するような方は、ここでルートディレクトリを変更することができますが、通常はこのままで構いません。また、「httpd.conf」のパスの指定の際には「¥(エン)」ではなく「/(スラッシュ)」を使用してください。

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# 
PidFile logs/httpd.pid
⇒プロセス番号記録ファイル
Pid(Process IDentification number:プロセス番号)を記録するファイルの指定を行うディレクティブです。「logs」→「httpd.pid」に格納されています。Windowsの方は特に変える必要はありません。

#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this. But if yours does (you'll know because
# this file will be created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
# 
ScoreBoardFile logs/apache_runtime_status
⇒内部情報ファイル
Apacheの内部情報を記録するためのファイルを指定します。Apacheが動作する上で必要となるファイルなので、このディレクティブは変更しないようにしてください。

 

#
# In the standard configuration, the server will process httpd.conf (this
# file, specified by the -f command line option), srm.conf, and access.conf
# in that order. The latter two files are now distributed empty, as it is
# recommended that all directives be kept in a single file for simplicity.
# The commented-out values below are the built-in defaults. You can have the
# server ignore these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
# 
Timeout 300
⇒タイムアウトまでの時間
クライアント接続要求を受け取ってから、コンテンツを提供するまでの連続してパケットを送信する時間の最大値を指定します。単位は秒単位です。ここで設定した時間を過ぎてもパケットが送信されない場合、ブラウザはエラーメッセージを表示するようになります。クライアントの回線の速度にもよりますが、1ページあたりの送出データがよほど重くない限りは、300秒あれば十分といえるでしょう。それを超える値も設定できますが、サーバーに余分な負荷がかかるので適度な値に設定するようにしてください。

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
# 
KeepAlive On
⇒キープアライブ
クライアントからの要求があり、いったんコンテンツを提供した後もコネクションを閉じずに次の要求に対してすぐに応答できるようにする機能です。通常はアクセスがあった場合、リンク部分をたどって他のページを見にいこうとするので、このディレクティブが「On」になっているとパフォーマンスが向上します。

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
# 
MaxKeepAliveRequests 100
⇒最大キープアライブ値
各々の接続に対するキープアライブの最大数を指定するディレクティブです。この値を「0」にすると無制限になりますが、サーバーへの負荷も考えるとデフォルトの100のままで良いでしょう。実際に、運用していって問題があるようなら値を変更してパフォーマンスとのバランスを取るようにしてください。

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
# 
KeepAliveTimeout 15
⇒キープアライブタイムアウトまでの時間
ひとつの要求が完了してから、コネクションを切断しないで次の要求を受け入れるまでの時間を指定するディレクティブです。単位は秒単位です。この値が短すぎてもサーバーへの負荷が増大し、反対に長すぎるとレスポンスが悪くなるので適度な値を指定するようにしてください。

#
# Apache on Win32 always creates one child process to handle requests. If it
# dies, another child process is created automatically. Within the child
# process multiple threads handle incoming requests. The next two
# directives control the behaviour of the threads and processes.
#

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies. The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources. On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For Win32, set this value to zero (unlimited)
# unless advised otherwise.
#
# NOTE: This value does not include keepalive requests after the initial
# request per connection. For example, if a child process handles
# an initial request and 10 subsequent "keptalive" requests, it
# would only count as 1 request towards this limit.
# 
#MaxRequestsPerChild 0
⇒子プロセスの処理可能数
Apacheはクライアントから要求があるたびに子プロセスを作り、リクエストに応じます。このディレクティブでは子プロセスが終了するまでに処理可能な要求の数を指定します。この機能はUNIX系OSでのみ有効で、ウィンドウズでは無効とされるのでハッシュマーク(#)をつけてコメントアウトしても構いません。

#
# Number of concurrent threads (i.e., requests) the server will allow.
# Set this value according to the responsiveness of the server (more
# requests active at once means they're all handled more slowly) and
# the amount of system resources you'll allow the server to consume.
# 
ThreadsPerChild 50
⇒リクエストを処理する子スレッドの最大数
Apacheが提供するWebページが同時に処理できるヒット数を指定するディレクティブです。これはウィンドウズ系Apache固有のものでUNIX系OS用のApacheにはついていません。デフォルトで問題ありません。

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80

#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `apache -l' for the list of already
# built-in (statically linked and thus always available) modules in your Apache
# binary.
#
# Note: The order in which modules are loaded is important. Don't change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule status_module modules/mod_status.so
#LoadModule info_module modules/mod_info.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule anon_auth_module modules/mod_auth_anon.so
#LoadModule dbm_auth_module modules/mod_auth_dbm.so
#LoadModule digest_auth_module modules/mod_auth_digest.so
#LoadModule digest_module modules/mod_digest.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule unique_id_module modules/mod_unique_id.so

#
# Reconstruction of the complete module list from all available modules
# (static and shared ones) to achieve correct module execution order.
#
# The modules listed below, without a corresponding LoadModule directive,
# are static bound into the standard Apache binary distribution for Windows.
#
# Note: The order in which modules are loaded is important. Don't change
# the order below without expert advice.
#
# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE, UPDATE THIS TOO!] 
ClearModuleList
⇒組み込まれたモジュールリストのクリア
Section2以降で述べる「AddModule」ディレクティブによって組み込まれた実行可能なモジュールのリストをクリアする指定です。Apacheの起動時は「httpd.conf」の行頭から順に処理をしていくので、ここでモジュールをクリアして、その後で、モジュールの組み込みを行うという段取りをとります。このままにしておいてください。


#AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c

#AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c

#AddModule mod_status.c
#AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_isapi.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c

#AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c

#AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c

#AddModule mod_auth_anon.c
#AddModule mod_auth_dbm.c
#AddModule mod_auth_digest.c
#AddModule mod_digest.c
#AddModule mod_proxy.c
#AddModule mod_cern_meta.c
#AddModule mod_expires.c
#AddModule mod_headers.c
#AddModule mod_usertrack.c
#AddModule mod_unique_id.c 
AddModule mod_so.c
AddModule mod_setenvif.c
⇒モジュールの組み込み
Apacheは基本的な機能の他にモジュールを組み込むことによって、機能を拡張することができます。これらのディレクティブでは、引数として指定されたモジュールの組み込みを行います。


#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On




以上で「Section 1: Global Environment」の設定は完了です。次は「Section2」のメインサーバーに関する解説に入りますので「Apache(httpd.conf)の設定 PART②」へと進んでください。



 

Copyrights©KORO 2002-08 All Rights Reserved.Since 02/08/15 | サイトのプライバシーポリシー