Closed TarikHaci closed 10 months ago
I still couldn't solve it but I found the following thread: https://github.com/instructure/canvas-lms/issues/2240#issuecomment-1661921955
And indeed my passenger has some error:
But I don't know how I can solve this?
I have this in my error logs:
canvasuser@ubuntu-4gb-fsn1-3-canvassafwah:~$ sudo tail -n 50 /var/log/apache2/error.log
[Wed Aug 30 18:01:03.646890 2023] [passenger:error] [pid 3073:tid 281473546457120] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger(R) watchdog: it seems to have crashed during startup for an unknown reason, with exit code 127
PassengerAgent: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
[Wed Aug 30 18:01:03.661031 2023] [passenger:error] [pid 3077:tid 281473546457120] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger(R) watchdog: it seems to have crashed during startup for an unknown reason, with exit code 127
[Wed Aug 30 18:01:03.665745 2023] [mpm_event:notice] [pid 3077:tid 281473546457120] AH00489: Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.18 OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 30 18:01:03.665780 2023] [core:notice] [pid 3077:tid 281473546457120] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 30 18:09:39.687108 2023] [mpm_event:notice] [pid 3077:tid 281473546457120] AH00492: caught SIGWINCH, shutting down gracefully
PassengerAgent: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
[Wed Aug 30 18:09:39.742412 2023] [passenger:error] [pid 3203:tid 281473253654560] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger(R) watchdog: it seems to have crashed during startup for an unknown reason, with exit code 127
PassengerAgent: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
[Wed Aug 30 18:09:39.762615 2023] [passenger:error] [pid 3207:tid 281473253654560] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger(R) watchdog: it seems to have crashed during startup for an unknown reason, with exit code 127
[Wed Aug 30 18:09:39.768933 2023] [mpm_event:notice] [pid 3207:tid 281473253654560] AH00489: Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.18 OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 30 18:09:39.768963 2023] [core:notice] [pid 3207:tid 281473253654560] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 30 18:10:00.936796 2023] [mpm_event:notice] [pid 3207:tid 281473253654560] AH00492: caught SIGWINCH, shutting down gracefully
PassengerAgent: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
[Wed Aug 30 18:10:16.769071 2023] [passenger:error] [pid 722:tid 281473078853664] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger(R) watchdog: it seems to have crashed during startup for an unknown reason, with exit code 127
PassengerAgent: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
[Wed Aug 30 18:10:16.795195 2023] [passenger:error] [pid 774:tid 281473078853664] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger(R) watchdog: it seems to have crashed during startup for an unknown reason, with exit code 127
[Wed Aug 30 18:10:16.800456 2023] [mpm_event:notice] [pid 774:tid 281473078853664] AH00489: Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.18 OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 30 18:10:16.800491 2023] [core:notice] [pid 774:tid 281473078853664] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 30 20:21:42.887846 2023] [mpm_event:notice] [pid 774:tid 281473078853664] AH00492: caught SIGWINCH, shutting down gracefully
PassengerAgent: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
[Wed Aug 30 20:21:42.953285 2023] [passenger:error] [pid 1543:tid 281473470554144] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger(R) watchdog: it seems to have crashed during startup for an unknown reason, with exit code 127
PassengerAgent: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
[Wed Aug 30 20:21:42.972237 2023] [passenger:error] [pid 1547:tid 281473470554144] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger(R) watchdog: it seems to have crashed during startup for an unknown reason, with exit code 127
[Wed Aug 30 20:21:42.977657 2023] [mpm_event:notice] [pid 1547:tid 281473470554144] AH00489: Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.18 OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 30 20:21:42.977691 2023] [core:notice] [pid 1547:tid 281473470554144] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 30 20:24:35.447056 2023] [mpm_event:notice] [pid 1547:tid 281473470554144] AH00492: caught SIGWINCH, shutting down gracefully
[Wed Aug 30 20:24:35.514855 2023] [passenger:error] [pid 1630:tid 281473389486112] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger(R): Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/6.0.18/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.
[Wed Aug 30 20:24:35.522261 2023] [so:warn] [pid 1630:tid 281473389486112] AH01574: module passenger_module is already loaded, skipping
[Wed Aug 30 20:24:35.530679 2023] [passenger:error] [pid 1632:tid 281473389486112] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger(R): Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/6.0.18/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.
[Wed Aug 30 20:24:35.541011 2023] [mpm_event:notice] [pid 1632:tid 281473389486112] AH00489: Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.18 OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 30 20:24:35.541059 2023] [core:notice] [pid 1632:tid 281473389486112] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 30 20:24:48.771061 2023] [mpm_event:notice] [pid 1632:tid 281473389486112] AH00492: caught SIGWINCH, shutting down gracefully
[Wed Aug 30 20:24:48.839697 2023] [passenger:error] [pid 1711:tid 281473404231712] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger(R): Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/6.0.18/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.
[Wed Aug 30 20:24:48.847957 2023] [so:warn] [pid 1711:tid 281473404231712] AH01574: module passenger_module is already loaded, skipping
[Wed Aug 30 20:24:48.861098 2023] [passenger:error] [pid 1713:tid 281473404231712] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger(R): Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/6.0.18/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.
[Wed Aug 30 20:24:48.868084 2023] [mpm_event:notice] [pid 1713:tid 281473404231712] AH00489: Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.18 OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 30 20:24:48.868142 2023] [core:notice] [pid 1713:tid 281473404231712] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 30 20:26:28.211690 2023] [mpm_event:notice] [pid 1713:tid 281473404231712] AH00492: caught SIGWINCH, shutting down gracefully
[Wed Aug 30 20:26:46.553865 2023] [passenger:error] [pid 724:tid 281473368535072] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger(R): Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/6.0.18/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.
[Wed Aug 30 20:26:46.565610 2023] [so:warn] [pid 724:tid 281473368535072] AH01574: module passenger_module is already loaded, skipping
[Wed Aug 30 20:26:46.573711 2023] [passenger:error] [pid 788:tid 281473368535072] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger(R): Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/6.0.18/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.
[Wed Aug 30 20:26:46.579315 2023] [mpm_event:notice] [pid 788:tid 281473368535072] AH00489: Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.18 OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 30 20:26:46.579374 2023] [core:notice] [pid 788:tid 281473368535072] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 30 20:29:43.986881 2023] [mpm_event:notice] [pid 788:tid 281473368535072] AH00492: caught SIGWINCH, shutting down gracefully
[Wed Aug 30 20:29:44.043515 2023] [passenger:error] [pid 1088:tid 281473278914592] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger(R): Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/6.0.18/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.
[Wed Aug 30 20:29:44.052460 2023] [so:warn] [pid 1088:tid 281473278914592] AH01574: module passenger_module is already loaded, skipping
[Wed Aug 30 20:29:44.058814 2023] [passenger:error] [pid 1090:tid 281473278914592] *** Passenger could not be initialized because of this error: Unable to start Phusion Passenger(R): Support binary PassengerAgent not found (tried: /usr/buildout/support-binaries/PassengerAgent and /root/.passenger/support-binaries/6.0.18/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.
[Wed Aug 30 20:29:44.065971 2023] [mpm_event:notice] [pid 1090:tid 281473278914592] AH00489: Apache/2.4.52 (Ubuntu) Phusion_Passenger/6.0.18 OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 30 20:29:44.066034 2023] [core:notice] [pid 1090:tid 281473278914592] AH00094: Command line: '/usr/sbin/apache2'
Anyone who can help me?
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
a2enmod rewrite
a2enmod passenger
这个时候passenger可能启动不了,需要修改下配置: /etc/apache2/mods-enabled/passenger.conf,主要是修改下PassengerInstanceRegistryDir。 /opt/tmp要给777 权限
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/passenger_free_ruby
PassengerDefaultUser canvasuser
# PassengerInstanceRegistryDir /var/run/passenger-instreg
PassengerInstanceRegistryDir /opt/tmp
</IfModule>
@huangdengpan Thanks for your fast reply! I executed your commands that you gave me (that resulted in repository error I think):
canvasuser@myservername:~$ sudo apt-get install apache2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apache2 is already the newest version (2.4.52-1ubuntu4.6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
canvasuser@myservername:~$ sudo apt-get install -y dirmngr gnupg apt-transport-https ca-certificates
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20230311ubuntu0.22.04.1).
dirmngr is already the newest version (2.2.27-3ubuntu2.1).
gnupg is already the newest version (2.2.27-3ubuntu2.1).
apt-transport-https is already the newest version (2.4.10).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
canvasuser@myservername:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.EaOL4eN3lG/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
gpg: key 561F9B9CAC40B2F7: "Phusion Automated Software Signing (Used by automated tools to sign software packages) <auto-software-signing@phusion.nl>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
canvasuser@myservername:~$ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger focal main > /etc/apt/sources.list.d/passenger.list'
canvasuser@myservername:~$ sudo apt-get update
Hit:1 https://mirror.hetzner.com/ubuntu/packages jammy InRelease
Hit:2 https://mirror.hetzner.com/ubuntu/packages jammy-updates InRelease
Hit:3 https://mirror.hetzner.com/ubuntu/packages jammy-backports InRelease
Hit:4 https://mirror.hetzner.com/ubuntu/security jammy-security InRelease
Hit:5 https://dl.yarnpkg.com/debian stable InRelease
Hit:6 https://deb.nodesource.com/node_16.x jammy InRelease
Ign:7 https://ppa.launchpadcontent.net/chris-lea/redis-server/ubuntu jammy InRelease
Ign:8 https://oss-binaries.phusionpassenger.com/apt/passenger focal InRelease
Hit:9 https://oss-binaries.phusionpassenger.com/apt/passenger focal Release
Hit:10 https://ppa.launchpadcontent.net/instructure/ruby/ubuntu jammy InRelease
Err:11 https://ppa.launchpadcontent.net/chris-lea/redis-server/ubuntu jammy Release
404 Not Found [IP: 2620:2d:4000:1::3e 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/chris-lea/redis-server/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: https://dl.yarnpkg.com/debian/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://oss-binaries.phusionpassenger.com/apt/passenger/dists/focal/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
canvasuser@myservername:~$ sudo apt-get install -y libapache2-mod-passenger
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libapache2-mod-passenger is already the newest version (1:6.0.18-1~focal1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
canvasuser@myservername:~$ ^C
canvasuser@myservername:~$ sudo a2enmod rewrite
Module rewrite already enabled
canvasuser@myservername:~$ sudo a2enmod passenger
Module passenger already enabled
As seen there is some repository error? Notice: I run Ubuntu 22.04 on a Hetzner Cloud 8GB RAM server.
I would like to share you some configurations that I have currently:
in /etc/apache2/mods-enabled/passenger.conf
:
### Begin automatically installed Phusion Passenger config snippet ###
<IfModule mod_passenger.c>
#PassengerDefaultUser canvasuser
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/passenger_free_ruby
PassengerDefaultUser canvasuser
PassengerInstanceRegistryDir /var/run/passenger-instreg
#PassengerInstanceRegistryDir /opt/tmp
</IfModule>
### End automatically installed Phusion Passenger config snippet ###
I commented out /opt/tmp since that directory doesn't exist on my machine.
in /etc/apache2/sites-available/canvas.conf
:
PassengerDefaultUser canvasuser
<VirtualHost *:80>
ServerName canvas.removedMyDomain.nl
ServerAlias canvasfiles.removedMyDomain.nl
ServerAdmin admin@removedMyDomain.nl
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
<Directory /var/canvas/public>
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
# If you are only serving HTTP behind a HTTPS-terminating load balancer, skip the next VirtualHost
<VirtualHost *:443>
ServerName canvas.removedMyDomain.nl
ServerAlias canvasfiles.removedMyDomain.nl
ServerAdmin admin@removedMyDomain.nl
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 [17-9]" ssl-unclean-shutdown
# the following ssl certificate files are generated for you from the ssl-cert package.
SSLCertificateFile /etc/letsencrypt/live/canvas.safwah.nl/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/canvas.safwah.nl/privkey.pem
SetEnv RAILS_ENV production
<Directory /var/canvas/public>
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
in /etc/apache2/apache2.conf
I appended at the bottom of the file:
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
PassengerRoot /usr
PassengerRuby /usr/bin/ruby
PassengerDefaultUser canvasuser
Could you please tell me what I am doing wrong? Thanks in advance!
Note: I found out that my Ubuntu version Jammy (22.04) is not possible to do this since the distro of jammy misses they only have till focal and biotronic, I tried to change in d /etc/apt/sources.list.d distro to focal instead of jammy but I couldn't do it.
So I will reinstall everyting on Ubuntu 20.04 which is focal and is supported.
You can see here the names of the distros: https://wiki.ubuntu.com/Releases And you can see here that there is no jammy (ubuntu 22.04) in the list: https://ppa.launchpadcontent.net/chris-lea/redis-server/ubuntu/dists/
So just downgrade to 20.04 focal, and this version was also noted before hand installation, and it will be good in Shaa Allaah. (unless someone teaches me to continue with focal on jammy or another way around)
Yes reinstalled server to fabricate settings with ubuntu 20.04 instead, and everything worked, there was some error with versioning I managed it to fix with:
$ sudo gem install strscan -v '3.0.6'
$ bundle install
by the power of Allaah.
And there wa also some errors with database permission but I re-executed the canvasuser permission 2 lines and it was fixed. Alhamdulillah! BTw I added canvasuser on top of conf file as mentioned in instructions.
There could also be pubkey not available missing error managed to fix it with:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 1234
At "1234" change with the key it shows at the terminal, I put 1234 as place holder. It happened after passenger updating packages moment.
Summary:
After initial installation I get "Index of /" site instead of the Canvas webpage, nothing works even /login/canvas.
Steps to reproduce:
Expected behavior:
To see the Canvas site and everything working.
Actual behavior:
Seeing Index of / all files list only. And nothing works. Screenshot:![Screenshot image of the index of /](https://gcdnb.pbrd.co/images/UcZzsrq4e9uj.png?o=1)
Additional notes:
I found only this online regarding the same issue: passenger is using wrong ruby version: https://github.com/instructure/canvas-lms/issues/1322#issuecomment-414516941 But I don't know how to fix that.