capistrano cannot restart application with passenger - rvm

i have a rails 6 / ruby 2.7.2 app, and the passenger gem, app is working great in prod, but cap deploy chokes at the end with
01 *** ERROR: Phusion Passenger(R) doesn't seem to be running. If you are sure that it
01 is running, then the causes of this problem could be one of:
01
01 1. You customized the instance registry directory using Apache's
01 PassengerInstanceRegistryDir option, Nginx's
01 passenger_instance_registry_dir option, or Phusion Passenger(R) Standalone's
01 --instance-registry-dir command line argument. If so, please set the
01 environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
01 and run this command again.
01 2. The instance directory has been removed by an operating system background
01 service. Please set a different instance registry directory using Apache's
01 PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
01 option, or Phusion Passenger(R) Standalone's --instance-registry-dir command
01 line argument.
The only help I can find seems to be for the non-gem installation of passenger, i installed passenger and made these mods to the /etc/apache2.conf as the installer indicated:
LoadModule passenger_module /home/deploy/.rvm/gems/ruby-2.7.2/gems/passenger-6.0.10/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/deploy/.rvm/gems/ruby-2.7.2/gems/passenger-6.0.10
PassengerDefaultRuby /home/deploy/.rvm/gems/ruby-2.7.2/wrappers/ruby
</IfModule>
Passenger / apache seem to be working fine, i just cannot restart the app from capistrano.
Thanks for any help,
Kevin

Related

apache mod_jk.so start up Permission denied

I am trying to configure mod_jk in Apache 2.2.3 to connect with Tomcat 7. OS is CentOS 5
After all the configuration, while starting the Apache httpd I am getting -
Starting httpd: httpd: Syntax error on line 200 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_jk.so into server: /etc/httpd/modules/mod_jk.so: cannot open shared object file: Permission denied
I see the permission is set alright
-rwxr-xr-x 1 root root 266752 Jun 3 19:37 mod_jk.so
I don't know what to do. Can any one please help?
Check your SELinux configuration.
Either open file /etc/selinux/config and check selinux setting or
run getenforce and see the output.
If I am correct then you will find it to be Enforcing. Now set it to permissive and restart httpd. You might need to reboot system to take effect.

Apache 404 Not Found error after Ubuntu update

I have had installed separadly since more than one year Apache, Php and MySQL on my Ubuntu 12.04 (LTS). Everything worked perfectly until a couple of days ago my OS did an update and then I get that 404 Not Found error every time that I try to access one of my proyects from my /var/www directory or even the PhpMyAdmin.
I've tried a lot of things to fix this but nothing works. I change the "Allow None" to "All" on the config file, change the IncludeOptional sites-enabled/*.conf, I even reinstalled Apache (I did it properly, first with purge and all that, and then installing the apache).
This is what my error.log file says:
[Sat Feb 18 11:45:32.863856 2014] [core:notice] [pid 4656:tid 140028861409088] AH00094: Command line: '/usr/sbin/apache2'
So, what can be the problem?
I had the same problem and I solved it editing the file "/etc/apache2/sites-available".
I changed the line "DocumentRoot /var/www/html" to "DocumentRoot /var/www" and restarted the service.

gitorious gives permission denied on fresh bitnami setup , amazon ec2 instance using https

This is a brand new installation of a bitnami gitorius image on EC2, worked fine until i tried to enable https/ssl.
I am sure i have misconfigured apache somehow, however the root document at https://tarantula.anatexis.net loads just fine.
but if one goes to the gitorious app at https://tarantula.anatexis.net/gitorious you get permission denied.
which config file do I edit to allow https traffic to gitorious.
looking at the apache logs, is see this,
[Mon Jun 03 17:25:20 2013] [error] [client 71.17.13.29] Directory index forbidden by Options directive: /opt/bitnami/apache2/htdocs/gitorious/, referer:Https://tarantula.anatexis.net/
Any help would be appreciated, Thanks
Joe
OK, so i fixed it, found the file /opt/bitnami/apache2/conf/extra/httpd-ssl.conf this config file has the document root in it for ssl traffic, the default is wrong and it needs to be changed to
DocumentRoot "/opt/bitnami/apps/gitorious/htdocs/public"
This solved all my issues I believe.

Error 403 after rails capistrano deployment on apache

Deployed an app to a VPS running apache + passenger.
User:Group → rails:rails
Deployed to /home/rails/www/appname
Here are the permissions on the files: https://gist.github.com/2549332
Here are user groups: https://gist.github.com/2549336
But I continue getting a 403 error when trying to request the app.
The access log just sais Permission denied for /, nothing else.
What could be the problem and how to solve it.
OS running Fedora 14.
UPDATE 1
Here is the virtualhost config:
https://gist.github.com/2550383
UPDATE 2
added Passenger_enabled to vhost
Passenger options in the httpd.conf are as follows
#Passenger for RubyOnRails apps
LoadModule passenger_module /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12
PassengerRuby /home/rails/.rvm/wrappers/ruby-1.9.3-p194/ruby
Passenger processes, listed by ps:
root 32342 0.0 0.6 213928 1948 ? Ssl 13:38 0:00 PassengerWatchdog
root 32345 0.0 0.7 288308 2208 ? Sl 13:38 0:00 PassengerHelperAgent
root 32347 0.0 2.9 112704 8520 ? Sl 13:38 0:00 Passenger spawn server
nobody 32350 0.0 1.3 147996 3788 ? Sl 13:38 0:00 PassengerLoggingAgent
UPDATE 3
Tried putting the standard Rails index.html in the public folder. No reaction.
Tried putting a plain index.html with just head and title, no changes either.
UPDATE 4
Even tried commenting out the Passenger lines in httpd.conf and restarting the server, and still I get the same error. Looks like it is something in Apache configs, but Ican't find what.
*UPDATE 5
Renamed the vhost.conf to see how the server acts withought it, everything seems ok.
It may be that Passenger doesn't hook up to your site and Apache decides to list the public directory instead, and directory listing is disabled in Apache.
Are there Passenger processes visible in ps?
Do you have PassengerRoot set correctly?
Try adding PassengerEnabled on to the vhost config.
The problem was solved by changing permissions for /home/rails directory so group could read and execute it.
Thanks to everybody!

Phusion Passenger gives ERROR: not running on Ubuntu

I'm trying to user Phusion Passenger to host my Rails 3 app from Ubuntu 11.04. I installed the passenger apache2 module and followed the instructions for editing my apache2.conf file and everything. I also restarted my apache server and I'm getting this:
Restarting web server apache2
[Tue Aug 09 10:41:36 2011] [warn] module passenger_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting [Tue Aug 09 10:41:37 2011] [warn] module passenger_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
I'm able to get to localhost/testapp but when I get there, instead of a rails app, I get an "index of /testapp" page with just the file system laid out. When I run the command passenger-status, I get this:
ERROR: Phusion Passenger doesn't seem to be running.
Any ideas?
There are probably multiple issues on your system, but this one is the most obvious:
[warn] module passenger_module is already loaded, skipping
This means you have two "LoadModule passenger_module ..." directives in your config files. The old one is probably stale and points to an older version of Phusion Passenger. You need to remove that or it'll cause conflicts.
The other one is probably related to filesystem permissions. The user that Apache runs as must be able to check whether the file 'config/environment.rb' and 'config.ru' exist in your app root, i.e. it must have executable permissions to the necessary directories and all parent directories.
The final possible issue is that you've set DocumentRoot to the application root, but you're supposed to set it to the 'public' directory.