After using Production Guide, I get Index of/ files

365 views
Skip to first unread message

Roy C

unread,
Jun 20, 2017, 11:14:23 AM6/20/17
to Canvas LMS Users
After using Production Guide, I get Index of/ files. Any ideas?
index_of.png

Graham Ballantyne

unread,
Jun 20, 2017, 11:33:38 AM6/20/17
to canvas-l...@googlegroups.com
Sounds like Apache and/or Passenger isn't configured correctly. Can you post a gist with your Apache config?

-- 
Graham Ballantyne 
IT Services 
Simon Fraser University 

On Jun 20, 2017, at 08:14, Roy C <chamb...@gmail.com> wrote:

After using Production Guide, I get Index of/ files. Any ideas?

--

---
You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<index_of.png>

Roy C

unread,
Jun 20, 2017, 11:44:20 AM6/20/17
to Canvas LMS Users

---------------------
apache.conf
---------------------
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf

# access here, or in any related virtual host.
<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>

# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
        Require all denied
</FilesMatch>

# requested file), because the latter makes it impossible to detect partial

# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

#Passenger
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
PassengerRoot /usr
PassengerRuby /usr/bin/ruby
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


----------------------
canvas.conf
----------------------
<VirtualHost *:80>
  ServerName canvas.example.com
  ServerAdmin your...@example.com
  DocumentRoot /var/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 production
  XSendFile On
  XSendFilePath /var/canvas
  <Directory /var/canvas/public>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
<VirtualHost *:443>
  ServerName canvas.example.com
  ServerAdmin your...@example.com
  DocumentRoot /var/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
  # the following ssl certificate files are generated for you from the ssl-cert package.
  SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
  SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  SetEnv RAILS_ENV production
  <Directory /var/canvas/public>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>

Roy C

unread,
Jun 20, 2017, 12:31:58 PM6/20/17
to Canvas LMS Users
-----------------
error.log
------------------

[Tue Jun 20 14:31:17.172275 2017] [so:warn] [pid 4082:tid 139994155325312] AH01574: module passenger_module is already loaded, skipping
[Tue Jun 20 14:31:17.175729 2017] [passenger:error] [pid 4083:tid 139994155325312] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger: Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/5.1.5/PassengerAgent). There may be different causes for this:\n\n - Your 'PassengerRoot' setting is set to the wrong value. Please see https://www.phusionpassenger.com/library/config/apache/reference/#passengerroot to learn how to fix the value.\n - The PassengerAgent binary is not compiled. Please run this command to compile it: /usr/bin/passenger-config compile-agent\n - Your Passenger installation is broken or incomplete. Please reinstall Passenger.
[Tue Jun 20 14:31:17.176808 2017] [mpm_event:notice] [pid 4083:tid 139994155325312] AH00489: Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.1.5 OpenSSL/1.0.1f configured -- resuming normal operations
[Tue Jun 20 14:31:17.176823 2017] [core:notice] [pid 4083:tid 139994155325312] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jun 20 14:54:44.091829 2017] [mpm_event:notice] [pid 4083:tid 139994155325312] AH00491: caught SIGTERM, shutting down
[Tue Jun 20 14:54:45.145033 2017] [passenger:error] [pid 4262:tid 140112558417792] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger: Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/5.1.5/PassengerAgent). There may be different causes for this:\n\n - Your 'PassengerRoot' setting is set to the wrong value. Please see https://www.phusionpassenger.com/library/config/apache/reference/#passengerroot to learn how to fix the value.\n - The PassengerAgent binary is not compiled. Please run this command to compile it: /usr/bin/passenger-config compile-agent\n - Your Passenger installation is broken or incomplete. Please reinstall Passenger.
[Tue Jun 20 14:54:45.149223 2017] [so:warn] [pid 4262:tid 140112558417792] AH01574: module passenger_module is already loaded, skipping
[Tue Jun 20 14:54:45.152629 2017] [passenger:error] [pid 4263:tid 140112558417792] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger: Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/5.1.5/PassengerAgent). There may be different causes for this:\n\n - Your 'PassengerRoot' setting is set to the wrong value. Please see https://www.phusionpassenger.com/library/config/apache/reference/#passengerroot to learn how to fix the value.\n - The PassengerAgent binary is not compiled. Please run this command to compile it: /usr/bin/passenger-config compile-agent\n - Your Passenger installation is broken or incomplete. Please reinstall Passenger.
[Tue Jun 20 14:54:45.153664 2017] [mpm_event:notice] [pid 4263:tid 140112558417792] AH00489: Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.1.5 OpenSSL/1.0.1f configured -- resuming normal operations
[Tue Jun 20 14:54:45.153680 2017] [core:notice] [pid 4263:tid 140112558417792] AH00094: Command line: '/usr/sbin/apache2'

Graham Ballantyne

unread,
Jun 20, 2017, 12:52:20 PM6/20/17
to canvas-l...@googlegroups.com
The error log indicates the cause of the issue pretty clearly:

[Tue Jun 20 14:31:17.175729 2017] [passenger:error] [pid 4083:tid 139994155325312] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger: Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/5.1.5/PassengerAgent). There may be different causes for this:\n\n - Your 'PassengerRoot' setting is set to the wrong value. Please see https://www.phusionpassenger.com/library/config/apache/reference/#passengerroot to learn how to fix the value.\n - The PassengerAgent binary is not compiled. Please run this command to compile it: /usr/bin/passenger-config compile-agent\n - Your Passenger installation is broken or incomplete. Please reinstall Passenger.

Apache can't find your passenger install. Your Apache conf has "PassengerRoot /usr", which is almost certainly incorrect. PassengerRoot "Refers to the location to the Passenger root directory, or to a location configuration file. This configuration option is essential to Passenger, and allows Passenger to locate its own data files." (https://www.phusionpassenger.com/library/config/apache/reference/#passengerroot). Correct your PassengerRoot setting, restart Apache and see what happens.


Roy C

unread,
Jun 20, 2017, 3:00:00 PM6/20/17
to Canvas LMS Users, gra...@sfu.ca
passenger-config --root
Returned
/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini

That worked. 
Thank you!
Reply all
Reply to author
Forward
0 new messages