或者直接下载这个地址,使用迅雷下载,速度会快很多。
https://www.apachelounge.com/download/VS16/binaries/httpd-2.4.39-win64-VS16.zip
目录结构如下:
在命令行中执行httpd.exe
启动会报如下错误:
D:\devtools\httpd-2.4.39-win64-VS16\Apache24\bin>httpd.exe
httpd.exe: Syntax error on line 39 of D:/devtools/httpd-2.4.39-win64-VS16/Apache
24/conf/httpd.conf: ServerRoot must be a valid directory
解决办法:
在httpd.conf的第37行设置变量
Define SRVROOT “D:/devtools/httpd-2.4.39-win64-VS16/Apache24” 指定目录
再次启动:有个警告
D:\devtools\httpd-2.4.39-win64-VS16\Apache24\bin>httpd.exe
AH00558: httpd.exe: Could not reliably determine the server’s fully qualified do
main name, using fe80::498c:9c71:88cb:cd23. Set the ‘ServerName’ directive globa
lly to suppress this message
解决办法:
在第226行处,设置ServerName localhost:80,指定相应的域名即可。
再次启动,不再有任何警告。
在浏览器上访问,显示如下图。成功。
在htdocs目录下新建文件hi.html
hi
添加新页面成功