1.安装Apache时遇到的问题
不是只进入到Apache文件夹下,要进入httpd.exe所在的文件夹下。如图所示:
2.启动时遇到问题
问题1:httpd: Syntax error on line 39 of D:/Server/Apache24/conf/httpd.conf: ServerRoot must be a valid directory
这是因为在httpd.conf配置文件中第39行的地址没有改成自己的文件路径,需要在conf文件夹下找到httpd.conf修改。我的配置路径如图所示:
问题2:AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using fe80::fec9:82fb:7ffe:1b5b. Set the ‘ServerName’ directive globally to suppress this message
此时人需要修改httpd.conf文件,找到
#ServerNamewww.example.com:80 一行
修改为
ServerName localhost:80
问题3:Syntax OK
此时可能是因为80端口被占用了,所以需要停止正在使用80端口的进程。这个在Windows机器比较常见,经常被IIS抢占。
如果不是IIS,可以使用命令杀掉强占80端口的进程:
查找占用80端口的进程id:netstat -ano|find “:80”
假设该进程id为2013,查看进程名称:tasklist /fi “pid eq 2013”
杀掉该进程命令:taskkill /f /pid 2013
参考链接:https://www.cnblogs.com/xa4312cs/p/6091642.html https://blog.csdn.net/a13568hki/article/details/103428237