1. 浏览器提示Internal Server Error
分析:查看Apache错误日志。日志提示:IndentationError: expected an indented block\r,即程序缺少了缩进。
解决:检查程序,按照python语法,将函数体一律缩进。
重启服务器,问题解决。
2.启动Apache时,控制台提示
AH00526: Syntax error on。。。:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
分析:根据提示,配置中缺少引用的模块。
解决:引入mod_access_compat模块,即在配置文件httpd.conf中,将第一个LoadModule前面的#号去掉。
3.启动Apache时,控制台提示
(OS 10013)以一种访问权限不允许的方式做了一个访问套接字的尝试。 : AH00072: make_sock: could not bind to address [::]:80
分析:80端口被占用。
解决:关掉SQL Server Reporting Services(MSSQLSERVER)。
4.启动Apache时,控制台提示
httpd: Syntax error on line 191 of D:/Apache24/conf/httpd.conf: Cannot load d:/program files/python/python35/python35.dll into server: %1 \xb2\xbb\xca\xc7\xd3\xd0\xd0\xa7\xb5\xc4 Win32 \xd3\xa6\xd3\xc3\xb3\xcc\xd0\xf2\xa1\xa3
解决:Apache版本搞错了!!!,应该用VC14的,用成了VC15了。
5.启动Apache时,控制台没有报错,但是出现以下令人不舒服的提示
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::49e7:e76f:58cc:5f12. Set the 'ServerName' directive globally to suppress this message
解决:在配置文件httpd.conf中,文末添加一行:ServerName localhost:80
6.浏览器提示Not Found
解答:因为在conf文件中使用了80端口配置了虚拟主机,所以再单独访问localhost时无效。也就是说,一个端口只能给一个节点(虚拟主机使用)。若想不占用80端口,虚拟主机中配置为其他端口即可。
7.浏览器提示Forbidden
解决:httpd.conf配置文件中的关于权限的配置问题。在<Directory />中将Require all denied改为Require all granted.
参考:
- https://blog.csdn.net/lihaidong1991/article/details/105693332
- https://blog.csdn.net/u012904764/article/details/77461621