兵どもが、夢のあとさき

JavaScript 系の言語に興味を惹かれ、まったりと更新しております

Apache のインストール

 

Apache のインストール

1. ダウンロード

Thread Safe は、ApacheIIS のタイプに合わせること。

Apache 2.x Thread Safe には、PHP も Thread Safe タイプを使用する。

 

http://www.apachelounge.com/ から正しい Apache を取得すること。(http://www.apache.com/ からはダウンロードしないこと)

 

『Downloads』をクリック。『Apache 2.4 VC11 Binaries and Modules Win32 and Win64』が表示される。ついこの間までVC9だったのに、いつのまにかVC11になっている)。

  

Apache 2.4 VC11 Binaries and Modules Win32 and Win64』を訳してみた () 内

 

Apache Lounge has provided up-to-date Windows binaries and popular third-party modules for more than 10 years. We have hundreds of thousands of satisfied users: small and big companies as well as personal users. Always build with up to date dependencies and latest compilers, and tested thorough. The binaries are referenced by the ASF, Microsoft, PHP etc. and more and more commercial software is packaged with our binaries and modules.(Apache Lounge は、以下略...)

 

The Windows 32 and 64 bits 2.4 binaries below, are build with the sources from ASF at httpd.apache.org, contains the latest patches and latest dependencies like zlib, openssl etc. which makes the downloads here mostly more actual for example then downloads from the ASF and other places. (Windows 32 及び 64ビット版があります。これは最新のパッチやzlip, openssl 等のライブラリが含まれます)

 

Build with the latest Visual StudioR 2012 aka VC11. VC11 has improvements, fixes and optimizations over VC10 in areas like Performance, MemoryManagement and Stability. For example code quality tuning and improvements done across different code generation areas for "speed". And makes more use of modern processors and win7, win8, 2008 and Server 2012 internal features.(これらは、最新の Visual StudioR 2012 aka VC11. VC11で作成され、VC10と比べパフォーマンスや安定性に優れています。そして、Win7, Win8, 2008 及び 2012サーバに最適化されています)

 

A VC11 binary loads VC11, VC10 and VC9 modules. Minimum system required: Windows 7 SP1, Windows 8 / 8.1, Windows Vista SP2, Windows Server 2008 R2 SP1, Windows Server 2012 / R2, it does not run on XP and 2003. (VC11は、VC11, VC10 と VC9のモジュールをロードしています。最低限のシステムに必要なOSは、Windows 7 SP1, Windows 8/8.1, Windows Vista SP2, Windows Server 2008 R2 SP1, Windows Server 2012 / R2 です。XP and 2003 は使っちゃダメです)

 

After you have downloaded and before you attempt to install it, you should make sure that it is intact and has not been tampered with. Use the PGP Signature and/or the SHA Checksums to verify the integrity.(ダウンロードしたら、インストールする前に PGP署名やハッシュ(SHAなど)で整合性を確認してください)

 

Be sure that you have installed Visual C++ Redistributable for Visual Studio 2012 : VC11 vcredist_x64/86.exe(「Visual C++ Redistributable for Visual Studio 2012 : VC11 vcredist_x64/86.exe」もインストールされているかチェックして下さいね。インストールされていなければ、http://www.microsoft.com/ja-jp/download/details.aspx?id=30679 からダウンロード ⇒ インストール!)

 

 

下記のいずれかをダウンロード (Apache 2.4 binaries VC11 with IPv6 Crypto apr-1.5.0 apr-util-1.5.3 apr-iconv-1.2.1 openssl-1.0.1e zlib-1.2.8 pcre-8.33 libxml2-2.9.1 lua-5.1.5 expat-2.1.0)

 

Apache 2.4.7 Win64 [Apache VC11 Binary] httpd-2.4.7-win64-VC11.zip 22 Nov '13 12.492K 

 

Apache 2.4.7 Win32 [Apache VC11 Binary] httpd-2.4.7-win32-VC11.zip 22 Nov '13 11.901K 

 

(いつの間にか、opensslは同梱されるようになったのね)

  

2. インストール

 apache24 フォルダを c:\ へ移動(複写)する。httpd.conf の ServerRoot は、デフォルトで "c:/Apache24" になっているので修正が不要。

別のフォルダにインストールした場合には、上記ディレクティブを適宜変更する。

 

httpd.conf は、デフォルトで下記の様になっているので、これも適宜修正。

 

DocumentRoot "c:/Apache24/htdocs"

<Directory "c:/Apache24/htdocs">

 

他、使用しないが CGI関連など。

  

3. 実行

  1. 実行

     c:\apache24\bin\httpd -d c:\apache24

    httpd.exe - システム エラー

     コンピューターに MSVCR110.dll がないため、プログラムを開始できません。この問題を解決するには、プログラムを再インストールしてみてください。

     

    上記のエラーが発生した場合(『してみてください』という表現も少し情けないですけど)、「Visual Studio 2012 更新プログラム 4 の Visual C++ 再頒布可能パッケージ」がインストールされていないようです。http://www.microsoft.com/ja-jp/download/details.aspx?id=30679 から、当該ライブラリをダウンロードし、インストールしてください。その際、CPUによってファイルが異なるので、適宜選択してください。(『VSU4\vcredist_arm.exe』or『VSU4\vcredist_x64.exe』or『VSU4\vcredist_x86.exe』)

  2. サービスとして登録

    管理者権限でログインし、下記を実行

    c:\apache24\bin\httpd.exe -k install (-n サービス名)

    自動で起動はしないので、『サービス』から起動する。
    起動権限がないユーザの場合には、サービスの設定、起動はあきらめ、c:\apache2.4\bin\httpd -d c:\apache2.4 で起動。CTRL + c で停止

  

4. PHP を使用する

 『apacheサーバでPHPを使用する.txt』を参照(作成中)

 

 

 

* その他

 

起動しない場合には、たいがい別のプロセスで apache が起動済み。

または、簡単な httpd.conf の設定ミス。パスの間違いや、クォーテーション忘れ等

 

きっちりパラメータを指定し、コマンドで実行

 

c:\apache24\bin\httpd -d c:\apache24 -f c:\apache24\conf\httpd.conf 又は、

c:/xampp/apache/bin/httpd -d c:/xampp/apache -f c:/xampp/apache/conf/httpd.conf

等など

 

 

エラーをチェック

 

下記のエラーで Apache が起動しない場合には、タスクマネージャのプロセス 『httpd.exe *32』 を強制終了させる

なお、この場合 Netstat -a でも使用ポートに表示されない様だ...

 

(OS 10048)通常、各ソケット アドレスに対してプロトコル、ネットワーク アドレス、またはポートのどれか 1 つのみを使用できます。  : AH00072: make_sock: could not bind to address [::]:8080

(OS 10048)通常、各ソケット アドレスに対してプロトコル、ネットワーク アドレス、またはポートのどれか 1 つのみを使用できます。  : AH00072: make_sock: could not bind to address 0.0.0.0:8080

AH00451: no listening sockets available, shutting down

AH00015: Unable to open logs

 

 

 

5.セキュリティ

 以下をチェック

  1. アクセス権限の設定は的確か?
  2. フォルダを指定した際、ファイル群が表示されないようになっているか?
  3. PHPファイルを指定した場合、きちんとパースされているか? (他の拡張子も同様)
  4. 40x、50x系のエラーの場合、デフォルト(サーバ情報、スクリプトのバージョン等が表示される)の設定のままになっていないか?
  5. デバッグ画面(phpinfo()等)が表示されないか?
  6. favicon は適切か? 何らかの無用な情報を提供していないか?
  7. ...