instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.42k stars 2.42k forks source link

403 Forbidden after upgrading new version #2240

Closed huangdengpan closed 11 months ago

huangdengpan commented 11 months ago

After installing the new version ,the configuration of apache as same before, doesn't change anything. but it shows 403 forbbiden and the log shows as below:

    [Tue Aug 01 14:33:31.655811 2023] [autoindex:error] [pid 334116:tid 139678611126016] [client 47.241.65.113:33766] AH01276: Cannot serve directory /opt/canvas/public/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive

I checked the files in public directory, there is no indexOf file in the old version, too.

Could someone let me know what should I do o(╯□╰)o

Here is my apache settings.

<VirtualHost *:80>
  ServerName demo.canvas.com
  ServerAdmin a@hotmail.com
  DocumentRoot /opt/canvas/public
  RewriteEngine On
  RewriteCond %{HTTP:X-Forwarded-Proto} !=https
  RewriteCond %{REQUEST_URI} !^/health_check
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
  ErrorLog /var/log/apache2/canvas_errors.log
  LogLevel warn
  CustomLog /var/log/apache2/canvas_access.log combined
  SetEnv RAILS_ENV development
  PassengerFriendlyErrorPages on
  <Directory /opt/canvas/public>
    Options All
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
<VirtualHost *:443>
  ServerName demo.canvas.com
  ServerAdmin a@hotmail.com
  DocumentRoot /opt/canvas/public
  ErrorLog /var/log/apache2/canvas_errors.log
  LogLevel warn
  CustomLog /var/log/apache2/canvas_ssl_access.log combined
  SSLEngine on
  BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
  BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
  SSLProtocol all -SSLv2 -SSLv3
  SSLCipherSuite HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM
  SSLHonorCipherOrder on
  SSLCertificateFile /opt/cert/public.crt
  SSLCertificateKeyFile /opt/cert/domain.key
  SSLCertificateChainFile /opt/cert/chain.crt
  SetEnv RAILS_ENV development
  XSendFile On
  XSendFilePath /opt/canvas
  PassengerFriendlyErrorPages on
  <Directory /opt/canvas/public>
    Options All
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
huangdengpan commented 11 months ago

what happend? o(╯□╰)o image

amg-web commented 11 months ago

is apache passenger module installed?

huangdengpan commented 11 months ago

is apache passenger module installed? Yes, it looks run well ?

image
amg-web commented 11 months ago

check apache error log

huangdengpan commented 11 months ago

@amg-web Thank you ! passenger runs wrong.

image

The commands doesn't help.

apt-get install apache2
apt-get install -y dirmngr gnupg apt-transport-https ca-certificates 
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger focal main > /etc/apt/sources.list.d/passenger.list'
apt-get update
apt-get install -y libapache2-mod-passenger

sudo a2enmod rewrite
sudo a2enmod passenger

#change apache settings:
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
PassengerRoot /usr
PassengerRuby /usr/bin/ruby
PassengerDefaultUser canvasuser
TarikHaci commented 10 months ago

@huangdengpan how did you solve this? I have the same error. imageerror