如何在Windows 10上安装Apache 2?

时间:2018-12-31 12:23:12

标签: windows apache installation

我想在Windows 10系统上安装Apache 2服务器。官方文档(https://httpd.apache.org/docs/2.4/platform/windows.html)指出:

  

“ Apache HTTP Server项目本身不提供软件的二进制发行版,仅提供源代码”

要拥有Apache HTTP Server的二进制文件,必须自己编译或从第三方提供的发行版中获取。这些发行版通常将Apache与PHP和MySQL捆绑在一起。

问题是:

建议使用哪种发行版来安装独立的Apache 2服务器,并执行哪些步骤?

1 个答案:

答案 0 :(得分:0)

我已经使用了Apache 2官方文档(https://httpd.apache.org/docs/2.4/platform/windows.html)中指出的Apache Lounge发行版。

以下是使用Apache Lounge发行版在Windows上安装Apache的步骤:

  1. 下载 Apache 2.4.37 Win64 https://www.apachelounge.com/download/
  2. 创建文件夹 C:/ Apache24
  3. 在文件夹 C:/ Apache24
  4. 中解压 httpd-2.4.37-win64-VC15.zip

选项1:要从控制台运行它:

  1. 打开 Windows Power Shell
  2. 执行 httpd.exe

    PS > C:\Apache24\bin\httpd.exe
    

    PS > cd C:\Apache24\bin
    PS > .\install.exe
    
  3. 在brwoser中打开 http:\ localhost http:\ 127.0.0.1

  

将显示消息有效!

选项2:要将其安装为服务:

  1. 打开 Windows Power Shell
  2. 以管理员身份打开 Windows Power Shell

    PS > Start-Process PowerShell -Verb RunAs
    
  3. 安装服务

    PS > cd C:\Apache24\bin
    PS > .\httpd.exe -k install
    
  4. 启动服务

    PS > .\httpd.exe -k start
    

    或通过服务管理员

    PS > services.msc
    Select Apache2.4 > Right-click > Start
    
  5. 在brwoser中打开 http:\ localhost http:\ 127.0.0.1

  

将显示消息有效!

相关问题