我正处于启动Django webapp的最后阶段,我已经被难住了好几天,试图理解为什么我总是得到一个403禁止的错误(你没有权限访问/在这个服务器上)。当我检查错误日志时,输出的最后一部分如下:[Fri Sep 11 04:54:04.525052 2015] [:error] [pid 31126:tid 140413402863360] [client 104.156.102.54:62884] ImportError: No module named foodshop.settings
[Fri Sep 11 05:10:08.926570 2015] [mpm_event:notice] [pid 31122:tid 140413615802240] AH00491: caught SIGTERM, shutting down
[Fri Sep 11 05:10:09.912491 2015] [mpm_event:notice] [pid 31345:tid 139760551360384] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Fri Sep 11 05:10:09.912511 2015] [core:notice] [pid 31345:tid 139760551360384] AH00094: Command line: '/usr/sbin/apache2'
[Fri Sep 11 05:10:15.259159 2015] [authz_core:error] [pid 31349:tid 139760274188032] [client 104.156.102.54:63064] AH01630: client denied by server configuration: /home/ubuntu/foodshop
[Fri Sep 11 05:15:00.604266 2015] [mpm_event:notice] [pid 31345:tid 139760551360384] AH00491: caught SIGTERM, shutting down
[Fri Sep 11 05:15:01.657535 2015] [mpm_event:notice] [pid 31455:tid 140370721130368] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Fri Sep 11 05:15:01.657552 2015] [core:notice] [pid 31455:tid 140370721130368] AH00094: Command line: '/usr/sbin/apache2'
[Fri Sep 11 05:15:06.215273 2015] [authz_core:error] [pid 31458:tid 140370621613824] [client 104.156.102.54:63126] AH01630: client denied by server configuration: /home/ubuntu/foodshop
[Fri Sep 11 05:15:07.389851 2015] [authz_core:error] [pid 31458:tid 140370613221120] [client 104.156.102.54:63126] AH01630: client denied by server configuration: /home/ubuntu/foodshop
[Fri Sep 11 05:15:08.519875 2015] [authz_core:error] [pid 31458:tid 140370427979520] [client 104.156.102.54:63126] AH01630: client denied by server configuration: /home/ubuntu/foodshop
[Fri Sep 11 05:33:55.993127 2015] [mpm_event:notice] [pid 31455:tid 140370721130368] AH00491: caught SIGTERM, shutting down
[Fri Sep 11 05:33:56.047551 2015] [mpm_event:notice] [pid 31598:tid 140492520712064] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Fri Sep 11 05:33:56.047572 2015] [core:notice] [pid 31598:tid 140492520712064] AH00094: Command line: '/usr/sbin/apache2'
[Fri Sep 11 05:34:01.575422 2015] [authz_core:error] [pid 31602:tid 140492306102016] [client 104.156.102.54:63348] AH01630: client denied by server configuration: /home/ubuntu/foodshop
[Fri Sep 11 05:34:02.481030 2015] [authz_core:error] [pid 31602:tid 140492297709312] [client 104.156.102.54:63348] AH01630: client denied by server configuration: /home/ubuntu/foodshop
[Fri Sep 11 05:34:03.342911 2015] [authz_core:error] [pid 31602:tid 140492289316608] [client 104.156.102.54:63348] AH01630: client denied by server configuration: /home/ubuntu/foodshop
需要注意的是…应用程序在我的本地主机上运行得很好。另外,我运行了sudo chown-rwww data apache2.conf将所有权更改为apache。我很乐意分享整个错误日志,如果它会更有用的话,但它很长。在
我在一个EC2实例(ubuntu14.04)上运行这个。在
你可以看到我的000-默认.conf文件如下:
^{pr2}$