文章目录
- [一、httpd -k install -n Apache输入后,提示拒绝访问怎么办](#一、httpd -k install -n Apache输入后,提示拒绝访问怎么办)
- [二、命令行输入:httpd -t 报错](#二、命令行输入:httpd -t 报错)
- [三、httpd -k install -n Apache输入后,另外一种报错](#三、httpd -k install -n Apache输入后,另外一种报错)
- 四、路径问题引起报错
一、httpd -k install -n Apache输入后,提示拒绝访问怎么办
解决方案
- 使用管理员身份打开CMD,再输入一次命令,就可以解决了
二、命令行输入:httpd -t 报错
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::8d1c:aa1c:7625:3c47. Set the 'ServerName' directive globally to suppress this message
解决方案
- 在文件路径下 D:\server\apache\Apache\conf,找到httpd.conf ,以记事本打开方式打开编辑

- #ServerName www.example.com:80 改成ServerName localhost:80

三、httpd -k install -n Apache输入后,另外一种报错
(OS 10013)以一种访问权限不允许的方式做了一个访问套接字的尝试。 : AH00072: make_sock: could not bind to address [::]:80
(OS 10013)以一种访问权限不允许的方式做了一个访问套接字的尝试。 : AH00072: make_sock: could not bind to address 0.0.0.0:80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs

解决方案
- 为防止80端口与其它软件冲突,无法启动服务,将端口改为88:

- 打开httpd.conf文件,在里面加上ServerName localhost:88这句话:
测试是否成功
- 打开浏览器,输入访问http://localhost:88,若出现如下图所示界面,那么恭喜你Apache安装配置就完成了,此时apache服务器已经可以运行。

四、路径问题引起报错

解决方案
- 需要修改httpd.conf里面配置的ServerRoot路径跟实际路径一致,此时我们打开conf文件夹,找到httpd.conf,修改ServerRoot的路径:
-修改后
- ServerRoot路径要与实际路径一致