Forbidden 您无权访问此资源。使用 apache2 在 digitalocean 上部署时

时间:2021-03-26 16:18:41

标签: reactjs apache ubuntu django-rest-framework digital-ocean

过去 5 天我一直在尝试在 digitalocean 上部署我的 react django 应用程序,但它不起作用。我已使用此 guid https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04 来部署它,但出现错误 403“禁止您无权访问此资源。 Apache/2.4.41 (Ubuntu) 服务器在 161.35.20.119 端口 80"

我已经记录了 apache 错误,我得到了这个

[Fri Mar 26 12:58:39.849945 2021] [core:notice] [pid 2948:tid 140423263165504] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 26 13:01:33.011075 2021] [mpm_event:notice] [pid 2948:tid 140423263165504] AH00491: caught SIGTERM, shutting down
[Fri Mar 26 13:01:33.227907 2021] [mpm_event:notice] [pid 15470:tid 139825591204928] AH00489: Apache/2.4.41 (Ubuntu) mod_wsgi/4.6.8 Python/3.8 configured -- resuming normal operations
[Fri Mar 26 13:01:33.228180 2021] [core:notice] [pid 15470:tid 139825591204928] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 26 13:14:21.257934 2021] [mpm_event:notice] [pid 15470:tid 139825591204928] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Mar 26 13:14:21.314783 2021] [mpm_event:notice] [pid 15470:tid 139825591204928] AH00489: Apache/2.4.41 (Ubuntu) mod_wsgi/4.6.8 Python/3.8 configured -- resuming normal operations
[Fri Mar 26 13:14:21.314810 2021] [core:notice] [pid 15470:tid 139825591204928] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 26 16:00:41.389644 2021] [mpm_event:notice] [pid 15470:tid 139825591204928] AH00491: caught SIGTERM, shutting down
[Fri Mar 26 16:00:41.625263 2021] [mpm_event:notice] [pid 29582:tid 140329193987136] AH00489: Apache/2.4.41 (Ubuntu) mod_wsgi/4.6.8 Python/3.8 configured -- resuming normal operations
[Fri Mar 26 16:00:41.625446 2021] [core:notice] [pid 29582:tid 140329193987136] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 26 16:00:49.491113 2021] [wsgi:error] [pid 29585:tid 140329173669632] [client 84.215.102.211:50612] Attempt to invoke directory as WSGI application: /var/www/html/SamfunnetiBergen/SamfunnetiBergen/
[Fri Mar 26 16:00:49.604457 2021] [wsgi:error] [pid 29585:tid 140329165276928] [client 84.215.102.211:50612] Target WSGI script not found or unable to stat: /var/www/html/SamfunnetiBergen/SamfunnetiBergen/favicon.ico, referer: http://161.35.20.119/
[Fri Mar 26 16:06:16.893930 2021] [wsgi:error] [pid 29584:tid 140329173669632] [client 84.215.102.211:50730] Attempt to invoke directory as WSGI application: /var/www/html/SamfunnetiBergen/SamfunnetiBergen/
[Fri Mar 26 16:06:47.515371 2021] [wsgi:error] [pid 29585:tid 140329140098816] [client 84.215.102.211:50745] Attempt to invoke directory as WSGI application: /var/www/html/SamfunnetiBergen/SamfunnetiBergen/
[Fri Mar 26 16:06:48.282807 2021] [wsgi:error] [pid 29585:tid 140329063806720] [client 84.215.102.211:50745] Attempt to invoke directory as WSGI application: /var/www/html/SamfunnetiBergen/SamfunnetiBergen/
[Fri Mar 26 16:06:48.687099 2021] [wsgi:error] [pid 29585:tid 140329055414016] [client 84.215.102.211:50745] Attempt to invoke directory as WSGI application: /var/www/html/SamfunnetiBergen/SamfunnetiBergen/

所以请如果有人可以提供帮助,因为我应该在上周将这个项目交付给我的学生组织

1 个答案:

答案 0 :(得分:1)

日志中有一条消息:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

检查这个help