1. 下载文件: 选择红色部分

Apache HTTP Server 2.4.41 (httpd): 2.4.41 is the latest available version 2019-08-14

The Apache HTTP Server Project is pleased to announce the release of version 2.4.41 of the Apache HTTP Server (“Apache” and “httpd”). This version of Apache is our latest GA release of the new generation 2.4.x branch of Apache HTTPD and represents fifteen years of innovation by the project, and is recommended over all previous releases!
For details, see the Official Announcement and the CHANGES_2.4 and CHANGES_2.4.41 lists.

Apache 2.4.41 httpd-2.4.41-o102s-x86-vc14-r2.zip 10.4 MB Download Locations
with OpenSSL 1.0.2s, brotli 1.0.7, nghttp 1.39.2, Zlib 1.2.10, PCRE 8.43, APR 1.7.0, APR-Util 1.6.1 2984 安装Apache - 图4 安装Apache - 图5
SHA1 Checksum: a64d0329261bed2072e04d3db3219a0db3e65913

4. 解压文件到指定目录下,比如R:\programs\apache-httpd-2.4.41-o102s-x64-vc14-r2,为apache24/bin目录配置环境变量。

5. 更改apache24/conf/httpd.conf文件内容如下:

1.更改apache的安装路径:

  1. Define SRVROOT "R:\programs\apache-httpd-2.4.41-o102s-x64-vc14-r2\Apache24"
  2. ServerRoot "${SRVROOT}"

2.更改监听端口号:

  1. #Listen 12.34.56.78:80
  2. Listen 81
  1. # If your host doesn't have a registered DNS name, enter its IP address here.
  2. #
  3. ServerName localhost:81

6.解决错误:AH00526: Syntax error on line 34 of R:/programs/apache-httpd-2.4.41-o102s-x64-vc14-r2/Apache24/conf/extra/httpd-ahssl.conf:SSLProtocol: Illegal protocol ‘TLSv1.3’

  1. <IfModule ssl_module>
  2. #Include conf/extra/httpd-ssl.conf
  3. #下行注释掉:
  4. #Include conf/extra/httpd-ahssl.conf
  5. SSLRandomSeed startup builtin
  6. SSLRandomSeed connect builtin
  7. </IfModule>

7. 安装服务器:

  1. httpd -k install

8. 启动服务:

  1. httpd -k start

9. 对于默认服务器的安装/卸载/停止/终止/重启的命令如下:

  1. httpd -k install
  2. httpd -k uninstall
  3. httpd -k stop
  4. httpd -k shutdown
  5. httpd -k restart