Internet-technologies-web-servers

提供:Dev Guides
移動先:案内検索

Webサーバー

概要

  • Webサーバー*は、Webコンテンツが保存されているコンピューターです。 基本的に、WebサーバーはWebサイトのホストに使用されますが、ゲーム、ストレージ、FTP、電子メールなど、他のWebサーバーも存在します。

'_WebサイトはWebページのコレクションであり、WebサーバーはWebリソースの要求に応答するソフトウェアです。_

Webサーバーの動作

Webサーバーは、次の2つの方法のいずれかでクライアント要求に応答します。

  • 要求されたURLに関連付けられたクライアントにファイルを送信します。
  • スクリプトを呼び出してデータベースと通信することで応答を生成する

internet_technologies_tutorial

キーポイント

  • クライアントがWebページの要求を送信するとき、要求されたページが見つかった場合、Webサーバーは要求されたページを検索し、HTTP応答でクライアントに送信します。
  • 要求されたWebページが見つからない場合、Webサーバーは* HTTP応答:Error 404 Not found。*を送信します。
  • クライアントが他のリソースを要求した場合、Webサーバーはアプリケーションサーバーとデータストアに接続してHTTP応答を作成します。

建築

Webサーバーアーキテクチャは、次の2つのアプローチに従います。

  1. 並行アプローチ
  2. シングルプロセスイベント駆動型アプローチ。

並行アプローチ

並行アプローチにより、Webサーバーは複数のクライアント要求を同時に処理できます。 次の方法で実現できます。

  • マルチプロセス
  • マルチスレッド
  • ハイブリッド法。

マルチプロセッシング

これでは、単一のプロセス(親プロセス)が複数のシングルスレッドの子プロセスを開始し、これらの子プロセスに着信要求を分散します。 各子プロセスは、単一のリクエストを処理します。

負荷を監視し、プロセスを強制終了するか分岐するかを決定するのは、親プロセスの責任です。

マルチスレッド

マルチプロセスとは異なり、複数のシングルスレッドプロセスを作成します。

ハイブリッド

上記の2つのアプローチの組み合わせです。 このアプローチでは、複数のプロセスが作成され、各プロセスが複数のスレッドを開始します。 各スレッドは1つの接続を処理します。 単一プロセスで複数のスレッドを使用すると、システムリソースの負荷が軽減されます。

次の表に、現在利用可能な最も主要なWebサーバーを示します。

S.N. Web Server Descriptino
1 Apache HTTP ServerThis is the most popular web server in the world developed by the Apache Software Foundation. Apache web server is an open source software and can be installed on almost all operating systems including Linux, UNIX, Windows, FreeBSD, Mac OS X and more. About 60% of the web server machines run the Apache Web Server.
2. Internet Information Services (IIS)The Internet Information Server (IIS) is a high performance Web Server from Microsoft. This web server runs on Windows NT/2000 and 2003 platforms (and may be on upcoming new Windows version also). IIS comes bundled with Windows NT/2000 and 2003; Because IIS is tightly integrated with the operating system so it is relatively easy to administer it.
3. LighttpdThe lighttpd, pronounced lighty is also a free web server that is distributed with the FreeBSD operating system. This open source web server is fast, secure and consumes much less CPU power. Lighttpd can also run on Windows, Mac OS X, Linux and Solaris operating systems.
4. Sun Java System Web ServerThis web server from Sun Microsystems is suited for medium and large web sites. Though the server is free it is not open source. It however, runs on Windows, Linux and UNIX platforms. The Sun Java System web server supports various languages, scripts and technologies required for Web 2.0 such as JSP, Java Servlets, PHP, Perl, Python, and Ruby on Rails, ASP and Coldfusion etc.
5. Jigsaw ServerJigsaw (W3C’s Server) comes from the World Wide Web Consortium. It is open source and free and can run on various platforms like Linux, UNIX, Windows, and Mac OS X Free BSD etc. Jigsaw has been written in Java and can run CGI scripts and PHP programs.