Windows10에 Apache를 설치하는 방법
Apache 배치
Apache Haus Downloads의 [Apache 2.4 Server Binaries]에서 사용하려는 zip을 다운로드하십시오.
여기를 누르면 다운로드 할 수 있습니다
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/Apache24/bin/httpd -V
Server version: Apache/2.4.41 (Win32)
Server built: Aug 10 2019 12:59:56
Distributed by: The Apache Haus
Compiled with: Visual Studio 2017
Server's Module Magic Number: 20120211:88
Server loaded: APR 1.7.0, APR-UTIL 1.6.1
Compiled using: APR 1.7.0, APR-UTIL 1.6.1
Architecture: 32-bit
Server MPM: WinNT
threaded: yes (fixed thread count)
forked: no
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/Apache24"
-D HTTPD_EXEC="/Apache24/bin/httpd.exe"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error.log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
* The Apache Haus
* is not affiliated with, or endorsed by, the Apache Software Foundation.
* Apache HTTP Server, Apache, and the Apache feather logo are trademarks of
* The Apache Software Foundation.
httpd.conf에서 SRVROOT 설정
httpd.conf는 httpd-2.4.41-o111c-x86-vc15-r2/Apache24/conf
아래에 저장됩니다.
httpd.conf# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
Define SRVROOT "C:\apps\httpd-2.4.41-o111c-x86-vc15-r2\Apache24"
ServerRoot "${SRVROOT}"
# 省略
Apache 시작
# 応答が無ければOK
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/Apache24/bin/httpd
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
Define SRVROOT "C:\apps\httpd-2.4.41-o111c-x86-vc15-r2\Apache24"
ServerRoot "${SRVROOT}"
# 省略
# 応答が無ければOK
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/Apache24/bin/httpd
http://localhost/ 을(를) 브라우저에서 보기
Apache를 서비스에 등록
참고 : Windows 서비스 목록을 명령으로 얻기 - shibainu55 일기
서비스에 등록되지 않았는지 확인
$ sc query state=all | grep SERVICE_NAME | grep -i apa
SERVICE_NAME: Intel(R) Capability Licensing Service TCP IP Interface
서비스에 등록하는 방법 확인
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/Apache24/bin/httpd -h
# 省略
-k install : install an Apache service
터미널을 관리자 권한으로 시작
터미널을 관리자 권한으로 시작하지 않은 경우 오류# GitBashに文字化け対応を入れていなかったため、エラーメッセージは一部文字化けしてしまった
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/Apache24/bin/httpd -k install
Installing the 'Apache2.4' service
(OS 5)▒A▒N▒Z▒X▒▒▒▒▒ۂ▒▒▒܂▒▒▒▒B : AH00369: Failed to open the Windows service manager, perhaps you forgot to log in as Adminstrator?
서비스에 등록
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/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.
$
서비스에 등록되었는지 확인
$ sc query state=all | grep SERVICE_NAME | grep -i apa
SERVICE_NAME: Intel(R) Capability Licensing Service TCP IP Interface
SERVICE_NAME: Apache2.4
서비스 대화 상자(Win+R > services.msc)에서도 확인할 수 있습니다.
서비스 시작
$ sc start Apache2.4
SERVICE_NAME: Apache2.4
TYPE : 10 WIN32_OWN_PROCESS
STATE : 2 START_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x7d0
PID : 13692
FLAGS :
오류가 발생한 원인
# 原因 : ターミナルを管理者権限で起動していない
$ sc start Apache2.4
[SC] StartService: OpenService FAILED 5:
アクセスが拒否されました。
# 原因 : 指定したサービス名に誤記がある
$ sc start Apach2.4
[SC] StartService: OpenService FAILED 1060:
指定されたサービスはインストールされたサービスとして存在しません。
# 原因 : 既に起動している
$ sc start Apache2.4
[SC] StartService FAILED 1056:
サービス インスタンスは既に実行されています。
서비스 중지
$ sc stop Apache2.4
SERVICE_NAME: Apache2.4
TYPE : 10 WIN32_OWN_PROCESS
STATE : 3 STOP_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x2
WAIT_HINT : 0x7530
오류가 발생한 원인
# 原因 : 既に停止している
$ sc stop Apache2.4
[SC] ControlService FAILED 1062:
そのサービスを開始できませんでした。
Reference
이 문제에 관하여(Windows10에 Apache를 설치하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/ponsuke0531/items/7c9273776f9f17d320a4
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
$ sc query state=all | grep SERVICE_NAME | grep -i apa
SERVICE_NAME: Intel(R) Capability Licensing Service TCP IP Interface
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/Apache24/bin/httpd -h
# 省略
-k install : install an Apache service
# GitBashに文字化け対応を入れていなかったため、エラーメッセージは一部文字化けしてしまった
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/Apache24/bin/httpd -k install
Installing the 'Apache2.4' service
(OS 5)▒A▒N▒Z▒X▒▒▒▒▒ۂ▒▒▒܂▒▒▒▒B : AH00369: Failed to open the Windows service manager, perhaps you forgot to log in as Adminstrator?
$ /c/apps/httpd-2.4.41-o111c-x86-vc15-r2/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.
$
$ sc query state=all | grep SERVICE_NAME | grep -i apa
SERVICE_NAME: Intel(R) Capability Licensing Service TCP IP Interface
SERVICE_NAME: Apache2.4
$ sc start Apache2.4
SERVICE_NAME: Apache2.4
TYPE : 10 WIN32_OWN_PROCESS
STATE : 2 START_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x7d0
PID : 13692
FLAGS :
# 原因 : ターミナルを管理者権限で起動していない
$ sc start Apache2.4
[SC] StartService: OpenService FAILED 5:
アクセスが拒否されました。
# 原因 : 指定したサービス名に誤記がある
$ sc start Apach2.4
[SC] StartService: OpenService FAILED 1060:
指定されたサービスはインストールされたサービスとして存在しません。
# 原因 : 既に起動している
$ sc start Apache2.4
[SC] StartService FAILED 1056:
サービス インスタンスは既に実行されています。
$ sc stop Apache2.4
SERVICE_NAME: Apache2.4
TYPE : 10 WIN32_OWN_PROCESS
STATE : 3 STOP_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x2
WAIT_HINT : 0x7530
# 原因 : 既に停止している
$ sc stop Apache2.4
[SC] ControlService FAILED 1062:
そのサービスを開始できませんでした。
Reference
이 문제에 관하여(Windows10에 Apache를 설치하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ponsuke0531/items/7c9273776f9f17d320a4텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)