LoginSignup
0
1

More than 5 years have passed since last update.

Windows 10 Pro x64 で Apache2 を試してみる

Posted at

目的

Windows 10 Pro x64 に Apache2 をインストールしてみる

ファイルのダウンロード

Downloading Apache for Windowsより適当なサイトを選択してダウンロードする
httpd-2.4.38-win64-VC15.zip を解凍して c:\ 以下に配置する
VS2017をインストールしていない場合は最新のサポートされる Visual C++ のダウンロードより
[Visual Studio 2017 用 Microsoft Visual C++ 再頒布可能パッケージ]
をDLしてインストールする必要があるかもしれません

httpd.conf を修正する

C:\Apache24\conf\httpd.conf を修正する


 58行目 Listen 8090               <- 8090に修正
222行目 ServerName localhost:8090 <- コメントアウト&localhost:8090に修正

httpd.conf のデフォルトでは以下の設定となっている
インストール先のフォルダを変更する場合(権限変更が必要かも?)
 37行目 ServerRoot "c:/Apache24"     # フォルダの変更
243行目 DocumentRoot "c:/Apache24/htdocs" # コンテンツの配置先の変更
243行目   # 上記に合わせる
363行目 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/" # 上記に合わせる

修正後 以下で httpd.conf の確認を行う
> C:\Apache24\bin\httpd -t
Syntax OK

Windows のサービスとして登録する

以下はコンソールを管理者モードで起動して行う


サービスとして登録
自動起動に設定されるので、変更する場合はサービス画面より変更する


C:\Apache24\bin\httpd -k install
Installing the 'Apache2.4' service
The 'Apache2.4' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.


サービスから削除


C:\Apache24\bin\httpd -k uninstall
Removing the 'Apache2.4' service
The 'Apache2.4' service has been removed successfully.


以下は通常の画面より実行可能
起動
> C:\Apache24\bin\httpd -k start

終了
> C:\Apache24\bin\httpd -k stop

自分は C:\Apache24\bin\ApacheMonitor.exe のショートカットを貼り付けています

参考にしたのは以下のサイト

Apacheインストール
Windows版Apacheのconfigテスト

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1