django - AH01630: 客户端被服务器配置错误拒绝
问题描述
我在生产中运行 Django,当访问者在我的网站上填写表格并在后端向我发送一封电子邮件时,我遇到了问题。在开发模式下运行没有问题,只有在生产中才会出现问题。我正在使用 apache2 和 mod_wsgi。
以下是我的 error_log 的片段
[Sat Mar 20 18:36:52.693566 2021] [authz_core:error] [pid 63623:tid 140495391864576] [client 66.249.69.150:50390] AH01630: client denied by server configuration: /etc/wsgi-port-80/htdocs/cgi-bin
[Sat Mar 20 18:46:20.822928 2021] [authz_core:error] [pid 63623:tid 140495391598336] [client 66.249.75.187:51831] AH01630: client denied by server configuration: /etc/wsgi-port-80/htdocs/cgi-bin
[Sat Mar 20 18:49:18.121736 2021] [authz_core:error] [pid 63600:tid 140495390799616] [client 66.249.77.27:61325] AH01630: client denied by server configuration: /etc/wsgi-port-80/htdocs/cgi-bin
[Sat Mar 20 18:49:25.616719 2021] [wsgi:error] [pid 63599:tid 140495337584384] [remote 52.175.223.195:7872] Not Found: /wp-includes/js/wp-emoji-release.min.js
[Sat Mar 20 18:50:25.165286 2021] [wsgi:error] [pid 63599:tid 140494956918528] Exception in thread Thread-7:
[Sat Mar 20 18:50:25.165357 2021] [wsgi:error] [pid 63599:tid 140494956918528] Traceback (most recent call last):
[Sat Mar 20 18:50:25.165373 2021] [wsgi:error] [pid 63599:tid 140494956918528] File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
[Sat Mar 20 18:50:25.165832 2021] [wsgi:error] [pid 63599:tid 140494956918528] self.run()
[Sat Mar 20 18:50:25.165847 2021] [wsgi:error] [pid 63599:tid 140494956918528] File "/usr/lib/python3.8/threading.py", line 870, in run
[Sat Mar 20 18:50:25.166139 2021] [wsgi:error] [pid 63599:tid 140494956918528] self._target(*self._args, **self._kwargs)
[Sat Mar 20 18:50:25.166153 2021] [wsgi:error] [pid 63599:tid 140494956918528] File "/home/jianwu/HD_website/website/website/Modules/emailMessage.py", line 71, in sendEmailNow_Thread
[Sat Mar 20 18:50:25.166267 2021] [wsgi:error] [pid 63599:tid 140494956918528] smtpObj = smtplib.SMTP(host=cred['email']['host'], port = cred['email']['port'])
[Sat Mar 20 18:50:25.166280 2021] [wsgi:error] [pid 63599:tid 140494956918528] File "/usr/lib/python3.8/smtplib.py", line 253, in __init__
[Sat Mar 20 18:50:25.166486 2021] [wsgi:error] [pid 63599:tid 140494956918528] (code, msg) = self.connect(host, port)
[Sat Mar 20 18:50:25.166499 2021] [wsgi:error] [pid 63599:tid 140494956918528] File "/usr/lib/python3.8/smtplib.py", line 339, in connect
[Sat Mar 20 18:50:25.166655 2021] [wsgi:error] [pid 63599:tid 140494956918528] self.sock = self._get_socket(host, port, self.timeout)
[Sat Mar 20 18:50:25.166667 2021] [wsgi:error] [pid 63599:tid 140494956918528] File "/usr/lib/python3.8/smtplib.py", line 308, in _get_socket
[Sat Mar 20 18:50:25.166813 2021] [wsgi:error] [pid 63599:tid 140494956918528] return socket.create_connection((host, port), timeout,
[Sat Mar 20 18:50:25.166829 2021] [wsgi:error] [pid 63599:tid 140494956918528] File "/usr/lib/python3.8/socket.py", line 808, in create_connection
[Sat Mar 20 18:50:25.167192 2021] [wsgi:error] [pid 63599:tid 140494956918528] raise err
[Sat Mar 20 18:50:25.167209 2021] [wsgi:error] [pid 63599:tid 140494956918528] File "/usr/lib/python3.8/socket.py", line 796, in create_connection
[Sat Mar 20 18:50:25.167516 2021] [wsgi:error] [pid 63599:tid 140494956918528] sock.connect(sa)
[Sat Mar 20 18:50:25.167551 2021] [wsgi:error] [pid 63599:tid 140494956918528] TimeoutError: [Errno 110] Connection timed out
我无法解释此错误的AH01630: client denied by server configuration: /etc/wsgi-port-80/htdocs/cgi-bin
含义。我也试过检查位置/etc/wsgi-port-80/htdocs/cgi-bin
,它只是一个空目录,不包含任何文件。
解决方案
推荐阅读
- java - 如何为单个 C 函数生成多个包装器?
- ssh - 为什么我不能使用我刚在 Google Cloud Compute Engine 上购买的永久磁盘的存储空间?
- powershell - 有没有办法在powershell中导入c dll和头文件?
- c# - Read as much JSON data from the stream as possible
- c++ - 运行无限循环的最小二叉树问题
- c# - 页面渲染后,C#.Net 更新 HTML 表中的列
- .net-core - 使用 Visual Studio 在本地调试 .NET Core 3.1 Lambda
- c# - Unity _MainTex 属性在明确存在时不存在
- java - 棋盘上的蚂蚁
- python - 使用索引访问列表中 dict 的值