reactjs - 禁止您无权访问此资源。使用 apache2 在 digitalocean 上部署时

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

在过去的 5 天里,我一直在尝试在 digitalocean 上部署我的 react django 应用程序,但它无法正常工作。我用过这个指南 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/
所以请如果有人可以帮忙,因为我应该在上周将这个项目交付给我的学生组织

最佳答案

日志中有一条消息:

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

关于reactjs - 禁止您无权访问此资源。使用 apache2 在 digitalocean 上部署时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66820609/

相关文章:

node.js - 在 React 代码中导入 superagent 时出错

python - 在 Ubuntu 上安装 pylibmc

git clone(权限被拒绝)

php - PCRE 正则表达式,从包含具有不同分隔符和 strip 注释的多个语句的字符串中提取单个 SQL 语句

ruby-on-rails - 必须在 Ubuntu 启动时启动 ElasticSearch

function - ReactJS:使用 material-ui 获取多个复选框值

javascript - 在 useEffect() 内部的函数上使用立即返回是否会以任何方式改变行为?

reactjs - Highcharts 极坐标图 : Apply Gradient Color on Intersecting Area Series

apache - 通过 httpd.conf 将登录页面从 HTTP 重定向到 HTTPS

linux - 在我的 Linux 主板上监听多个端口或启用 SSL 模块后 HTTP 请求失败