【问题标题】:Forbidden You don't have permission to access this resource. when deploying on digitalocean with apache2Forbidden 您无权访问此资源。使用 apache2 在 digitalocean 上部署时
【发布时间】:2021-06-23 11:58:34
【问题描述】:

过去 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/

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

【问题讨论】:

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


【解决方案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

【讨论】:

  • 你知道如何解决这个问题吗?我还没有域名
  • 如果要访问已部署的站点,则需要域名或IP地址
  • 如果 161.35.20.119 是您的 IP 地址,您可以使用它来代替域
  • 是的,我在/etc/apache2/apache2.conf 上添加了这个<Directory /> Options FollowSymLinks AllowOverride None Require all denied </Directory> <Directory /usr/share> AllowOverride None Require all granted </Directory> <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> #<Directory /srv/> # Options Indexes FollowSymLinks # AllowOverride None # Require all granted #</Directory> ServerName 161.35.20.119,但仍然无法正常工作:(
猜你喜欢
  • 1970-01-01
  • 2020-05-07
  • 1970-01-01
  • 2021-08-17
  • 2021-04-03
  • 2021-12-27
  • 2020-05-30
  • 2021-07-03
  • 2022-08-03
相关资源
最近更新 更多