I've created a rails app but I'm not enabled to do a rails server or rake routes, error is : /home/charles/.rbenv/shims/rails: ligne 21: /root/.rbenv/libexec/rbenv: Permission non accordée
Going su works but it's not good to do this that way.
With visudo I have this, my current user charles has user privilege : #
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sb$
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
charles ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
ls -l output this :
➜ alpha_blog git:(master) ✗ ls -l
total 68
drwxr-xr-x 10 charles charles 4096 nov. 15 16:52 app
drwxr-xr-x 2 charles charles 4096 nov. 15 16:52 bin
drwxr-xr-x 5 charles charles 4096 nov. 15 16:52 config
-rw-r--r-- 1 charles charles 130 nov. 15 16:52 config.ru
drwxr-xr-x 2 charles charles 4096 nov. 15 16:52 db
-rw-r--r-- 1 charles charles 1974 nov. 15 16:52 Gemfile
-rw-r--r-- 1 charles charles 4772 nov. 15 16:52 Gemfile.lock
drwxr-xr-x 4 charles charles 4096 nov. 15 16:52 lib
drwxr-xr-x 2 charles charles 4096 nov. 15 16:53 log
-rw-r--r-- 1 charles charles 68 nov. 15 16:52 package.json
drwxr-xr-x 2 charles charles 4096 nov. 15 16:52 public
-rw-r--r-- 1 charles charles 227 nov. 15 16:52 Rakefile
-rw-r--r-- 1 charles charles 374 nov. 15 16:52 README.md
drwxr-xr-x 9 charles charles 4096 nov. 15 16:52 test
drwxr-xr-x 2 charles charles 4096 nov. 29 10:12 tmp
drwxr-xr-x 2 charles charles 4096 nov. 15 16:52 vendor
I've made sudo chown - R charles ./ where ./ is my rails directory.
I don't known where the problem is my user and directory rights seems good and I don't to go as su to do those commands as it is not a good practice.
Resolved the problem by doing rbenv rehash
Related
I have a fresh install of nextcloud 22.2.0, that I installed according to [these instructions:]1
After NC installation, I hae ZERO errors in my NC log. However, in the Overview section I have some basic wearnings that I know are "false positives" forllowing a new installation. There I want to run the NC occ in order to repair things:
./occ integrity:check-core
However, I get these errors:
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.
Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/22/go.php?to=admin-dir_permissions
Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed
Please install one of these locales on your system and restart your webserver.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /web/lib/private/Console/Application.php:162
Stack trace:
#0 /web/console.php(98): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /web/occ(11): require_once('/web/console.ph...')
#2 {main}
I was able to resolve this error:
Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed
Please install one of these locales on your system and restart your webserver.
By using:
chattr -i /var/www/clients/client1/web19/
jk_cp -j /var/www/clients/client1/web19/ /usr/lib/locale
chattr +i /var/www/clients/client1/web19/
Can anyone tell me how to resolve the two remaining errors so that the NC occ will work correctly?
thanks
Also the user's permissions are correct:
# ls -la /var/www/clients/client1/web19
total 60
drwxr-xr-x 15 root root 4096 Nov 12 15:12 .
drwxr-xr-x 9 root root 4096 Nov 12 14:50 ..
lrwxrwxrwx 1 root root 7 Nov 12 15:09 bin -> usr/bin
drwxr-xr-x 2 web19 client1 4096 Nov 12 14:50 cgi-bin
drwxr-xr-x 2 root root 4096 Nov 12 17:36 dev
drwxr-xr-x 8 root root 4096 Nov 12 15:12 etc
drwxr-xr-x 4 root root 4096 Nov 12 15:12 home
lrwxrwxrwx 1 root root 7 Nov 12 15:09 lib -> usr/lib
lrwxrwxrwx 1 root root 9 Nov 12 15:09 lib64 -> usr/lib64
drwxr-xr-x 2 root root 4096 Nov 12 19:58 log
drwx--x--- 2 web19 client1 4096 Nov 12 20:05 private
drwx------ 2 web19 client1 4096 Nov 12 15:09 .ssh
drwxr-xr-x 2 root root 4096 Nov 12 14:55 ssl
drwxrwx--- 2 web19 client1 4096 Nov 12 20:09 tmp
drwxr-xr-x 8 root root 4096 Nov 12 15:09 usr
drwxr-xr-x 4 root root 4096 Nov 12 15:12 var
drwx--x--x 14 web19 client1 4096 Nov 12 20:09 web
drwx--x--- 2 web19 client1 4096 Nov 12 14:50 webdav
I had the same problem as you and, curiously, I use the same user/client for the same service.
I've resolved in the following way (in addition to yours solution about "locale").
Go into the jail root (/var/www/clients/client1/web19). Here create the directories to contain PHP stuff:
mkdir -p etc/php/7.4/cli/conf.d
Copy the system-wide php.ini for cli into jail:
cp -a /etc/php/7.4/cli/php.ini etc/php/7.4/cli/php.ini
"Hardly" link every file *.so present in system-wide conf into the jail. For example:
ln /etc/php/7.4/mods-available/apcu.ini 20-apcu.ini
If you has the cache problems too (as me), you can add a definition before run occ.
I'm using the following command:
runuser -l web19 -c "cd /web; php --define apc.enable_cli=1 ./occ"
...and all seems to works fine! :-)
I spent lot of hours and just stuck :(
Build app in ruby on rails
On dev environment working with Apache
Have to install production on Ubuntu 18.04 LTS with nginx and passenger
I add Passenger to nginx how it's described by Passenger Library here
App not working and logs showing:
403 forbidden error for root (https://cennik.leczymed.pl)
2019/02/08 21:46:19 [error] 4743#4743: *2 directory index of "/var/www/html/cennik/public/" is forbidden, client: XXX.XXX.XXX.XXX, server: cennik.leczymed.pl, request: "GET / HTTP/2.0", host: "cennik.leczymed.pl"
404 not found for others sublinks (ex. https://cennik.leczymed.pl/rtg)
2019/02/08 21:46:25 [error] 4743#4743: *2 open() "/var/www/html/cennik/public/rtg" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: cennik.leczymed.pl, request: "GET /rtg HTTP/2.0", host: "cennik.leczymed.pl"
My configurations:
/etc/nginx/sites-available/cennik.conf
server {
listen 80;
server_name cennik.leczymed.pl;
include snippets/letsencrypt.conf;
return 301 https://cennik.leczymed.pl$request_uri;
}
server {
listen 443 ssl http2;
server_name cennik.leczymed.pl;
# Tell Nginx and Passenger where your app's 'public' directory is
root /var/www/html/cennik/public;
# log files
access_log /var/log/nginx/cennik.leczymed.pl.access.log;
error_log /var/log/nginx/cennik.leczymed.pl.error.log;
# Turn on Passenger
passenger_enabled on;
passenger_ruby /usr/bin/ruby2.5;
ssl_certificate /etc/letsencrypt/live/cennik.leczymed.pl/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cennik.leczymed.pl/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/cennik.leczymed.pl/chain.pem;
include snippets/letsencrypt.conf;
include snippets/ssl.conf;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
}
All files of application are in /var/www/html/cennik catalog.
drwxr-xr-x 16 cennik cennik 4096 Feb 8 20:53 .
drwxr-xr-x 6 root root 4096 Feb 8 14:23 ..
drwxrwxr-x 10 cennik cennik 4096 Jul 27 2018 app
drwxr-xr-x 2 cennik cennik 4096 Jul 27 2018 bin
drwxr-xr-x 2 cennik cennik 4096 Feb 8 20:33 .bundle
drwx------ 5 cennik cennik 4096 Feb 8 20:48 config
-rw-rw-r-- 1 cennik cennik 130 Jul 27 2018 config.ru
drwx------ 2 cennik cennik 4096 Jul 27 2018 db
-rw-rw-r-- 1 cennik cennik 2371 Feb 8 19:58 Gemfile
-rw-r--r-- 1 cennik cennik 5544 Feb 8 20:42 Gemfile.lock
drwxrwxr-x 7 cennik cennik 4096 Feb 8 19:47 .git
-rw-rw-r-- 1 cennik cennik 687 Feb 8 19:47 .gitignore
drwxrwxr-x 4 cennik cennik 4096 Jul 27 2018 lib
drwxrwxr-x 2 cennik cennik 4096 Feb 8 20:53 log
drwxr-xr-x 2 cennik cennik 4096 Feb 8 20:53 node_modules
-rw-rw-r-- 1 cennik cennik 64 Jul 27 2018 package.json
drwxrwxrwx 3 cennik cennik 4096 Feb 8 20:54 public
-rw-rw-r-- 1 cennik cennik 227 Jul 27 2018 Rakefile
-rw-rw-r-- 1 cennik cennik 5 Jul 27 2018 .ruby-version
drwxrwxr-x 2 cennik cennik 4096 Jul 27 2018 storage
drwxrwxr-x 9 cennik cennik 4096 Jul 27 2018 test
drwxrwxr-x 6 cennik cennik 4096 Jul 27 2018 tmp
drwxrwxr-x 3 cennik cennik 4096 Feb 8 20:33 vendor
-rw-r--r-- 1 cennik cennik 86 Feb 8 20:53 yarn.lock
All files and catalogs owner is cennik user (as described in recipe).
Catalog /public inside RoR app is with all privileges (chmod 777).
Any ideas guys ?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Update:
passenger-config --ruby-command
passenger-config was invoked through the following Ruby interpreter:
Command: /usr/bin/ruby2.5
Version: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
To use in Apache: PassengerRuby /usr/bin/ruby2.5
To use in Nginx : passenger_ruby /usr/bin/ruby2.5
To use with Standalone: /usr/bin/ruby2.5 /var/lib/gems/2.5.0/gems/passenger-6.0.1/bin/passenger start
The following Ruby interpreter was found first in $PATH:
Command: /home/artur/.rbenv/shims/ruby
Version: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
To use in Apache: PassengerRuby /home/artur/.rbenv/shims/ruby
To use in Nginx : passenger_ruby /home/artur/.rbenv/shims/ruby
To use with Standalone: /home/artur/.rbenv/shims/ruby /var/lib/gems/2.5.0/gems/passenger-6.0.1/bin/passenger start
So, I think that nginx configuration cennik.conf declare correct place of catalog for ruby : /usr/bin/ruby2.5
Any other ideas how to solve it ?
************************ UPDATE *******************************
Ok. So I found few things which can help others. Problem as mine is only for Ubuntu upgraded to 18.04 from previous versions. Instalation of nginx is not overwrite confs for nginx (this can be solved manually). Bigger problem is that nginx package which is delivered for Ubuntu 18.04 is not compiled with passenger support.
So I'm looking now for solution how to compile nginx with passenger module in it and still use it my systemctl functions - installation from sources work, but you can't work with it as a service :(
I found some special receipe for comapiling Ubuntu package with changes inside compilation process but any of my try to put correct add-on for passenger already fail.
Anybody can help me ?
I add Passenger to nginx how it's described by Passenger Library here
Looks like Passenger in not configured. As you're using RVM, you should have another location for ruby executable. To get ruby path, go to application root and run the following command and replace passenger_ruby directive.
> cd /var/www/html/cennik
> passenger-config --ruby-command
# It shows output like this
passenger-config was invoked through the following Ruby interpreter:
Command: /home/deploy/.rvm/gems/ruby-2.3.5/wrappers/ruby
Version: ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
To use in Apache: PassengerRuby /home/deploy/.rvm/gems/ruby-2.3.5/wrappers/ruby
To use in Nginx : passenger_ruby /home/deploy/.rvm/gems/ruby-2.3.5/wrappers/ruby
To use with Standalone: /home/deploy/.rvm/gems/ruby-2.3.5/wrappers/ruby /usr/bin/passenger start
Catalog /public inside RoR app is with all privileges (chmod 777).
Making public directory executable isn't good idea. It may contains files uploaded by users. Just set permissions to 755 and chown to user or group running nginx (www-data).
A colleague installed a 3 node DSE cluster.
When bringing up Opscenter on the seed node, we get an alert that the agent requires an upgrade from 5.2.0 to 5.2.2 and the agent is not installed on the two other nodes.
Because of environmental restrictions, We do not have the internet accessibility or root credentials to perform the automated upgrade/install from Opscenter. I downloaded and unpacked the 5.2.2 agent tarbell and the latest Opscenter.
Where do I overlay 5.2.0 contents with 5.2.2 to manually perform the upgrade with only SU access via the command line? On the non-seed nodes, I started the agents manually.
Non-seed:
root 8362 1 2 Nov30 ? 03:36:33 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-1.b16.el6_7.x86_64/jre/bin/java -Xmx128M -Djclouds.mpu.parts.magnitude=100000 -Djclouds.mpu.parts.size=16777216 -Dopscenter.ssl.trustStore=ssl/agentKeyStore -Dopscenter.ssl.keyStore=ssl/agentKeyStore -Dopscenter.ssl.keyStorePassword=opscenter -Dagent-pidfile=./datastax-agent.pid -Dlog4j.configuration=file:./conf/log4j.properties -Djava.security.auth.login.config=./conf/kerberos.config -jar datastax-agent-5.2.`2-standalone.jar ./conf/address.yaml
Seed:
497 4375 1 2 Nov30 ? 03:42:23 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-1.b16.el6_7.x86_64/jre/bin/java -Xmx128M -Djclouds.mpu.parts.magnitude=100000 -Djclouds.mpu.parts.size=16777216 -Dopscenter.ssl.trustStore=/var/lib/datastax-agent/ssl/agentKeyStore -Dopscenter.ssl.keyStore=/var/lib/datastax-agent/ssl/agentKeyStore -Dopscenter.ssl.keyStorePassword=opscenter -Dagent-pidfile=/var/run/datastax-agent/datastax-agent.pid -Dlog4j.configuration=file:./conf/log4j.properties -Djava.security.auth.login.config=./conf/kerberos.config -jar datastax-agent-5.2.0-standalone.jar /var/lib/datastax-agent/conf/address.yaml
We are completely new to DSE and RHEL.
drwxr-xr-x 4 cassandra cassandra 4096 Sep 17 12:20 datastax-agent
drwxr-xr-x 7 root root 4096 Nov 30 14:31 datastax-agent-5.2.2
drwxr-xr-x 4 root root 4096 Nov 30 14:31 datastax-agent-old
datastax-agent:
total 24836
drwxrwxr-x 7 cassandra cassandra 4096 Sep 17 12:20 .
drwxr-xr-x. 95 root root 4096 Dec 1 17:08 ..
drwxrwxr-x 3 cassandra cassandra 4096 Nov 16 13:16 bin
drwxrwxr-x 2 cassandra cassandra 4096 Sep 17 12:20 conf
-rw-rw-r-- 1 cassandra cassandra 25402316 Jul 14 12:19 datastax-agent-5.2.0-standalone.jar
drwxrwxr-x 2 cassandra cassandra 4096 Sep 17 12:20 doc
drwxrwxr-x 2 cassandra cassandra 4096 Sep 17 12:20 ssl
drwxrwxr-x 3 cassandra cassandra 4096 Sep 17 12:20 tmp
datastax-agent-5.2.2:
total 25044
drwxr-xr-x 7 root root 4096 Dec 1 17:08 .
drwxr-xr-x. 95 root root 4096 Dec 1 17:08 ..
drwxr-xr-x 3 root root 4096 Dec 1 17:08 bin
drwxr-xr-x 2 root root 4096 Dec 1 17:08 conf
-rw-r--r-- 1 root root 25608470 Dec 1 17:08 datastax-agent-5.2.2-standalone.jar
-rw-r--r-- 1 root root 5 Dec 1 18:06 datastax-agent.pid
drwxr-xr-x 2 root root 4096 Dec 1 17:08 doc
drwxr-xr-x 2 root root 4096 Dec 1 17:08 log
drwxr-xr-x 2 root root 4096 Dec 1 17:08 ssl
How did you install DSE? rpm, tarball or standalone installer? Either way, to get the new agent in place, the only thing you need is the new jar file, so drop the one from the tar ball into the location where you see datastax-agent-5.2.0-standalone.jar (which unfortunately varies based upon the install method you used, hence my question above :-). Move the old jar out of the way and restart the agent process /etc/init.d/datastax-agent stop followed by /etc/init.d/datastax-agent start).
To upgrade OpsCenter Agent installed from tarball, simply extract that tarball to the same directory the agent was installed before and remove the old jar file (datastax-agent-5.2.0-standalone.jar in this case).
I'm running a 3-node cluster in AWS. Yesterday, I upgraded my cluster from DSE 4.7.3 to 4.8.0.
After the upgrade, the datastax-agent service is no longer registered and the /usr/share/datastax-agent/conf folder has been removed.
PRE-UPGRADE:
$ ls -alr
total 24836
drwxrwxr-x 3 cassandra cassandra 4096 Aug 10 14:57 tmp
drwxrwxr-x 2 cassandra cassandra 4096 Aug 10 14:56 ssl
drwxrwxr-x 2 cassandra cassandra 4096 Sep 28 15:14 doc
-rw-r--r-- 1 cassandra cassandra 25402305 Jul 14 18:55 datastax-agent-5.2.0-standalone.jar
drwxrwxr-x 2 cassandra cassandra 4096 Sep 28 18:23 conf
drwxrwxr-x 3 cassandra cassandra 4096 Sep 28 18:13 bin
drwxr-xr-x 118 root root 4096 Oct 2 18:02 ..
drwxrwxr-x 7 cassandra cassandra 4096 Oct 7 19:03 .
POST-UPGRADE:
$ ls -al
total 24976
drwxr-xr-x 3 cassandra cassandra 4096 Oct 5 20:45 .
drwxr-xr-x 114 root root 4096 Oct 5 18:23 ..
drwxr-xr-x 3 cassandra cassandra 4096 Oct 5 20:45 bin
-rw-r--r-- 1 cassandra cassandra 25562841 Sep 10 20:43 datastax-agent-5.2.1-standalone.jar
Also, /etc/init.d/datastax-agent file has been deleted. I don't know how I'm supposed to start/stop the service now.
Can I restore the files from the rollback directory? What effect will that have?
In this particular case what happened was that the dpkg install found a preexisting /etc/init.d/datastax-agent file and only put /etc/init.d/datastax-agent.fpk.bak into place. A "sudo dpkg -P datastax-agent" followed by a "sudo dpkg -i /usr/share/dse/datastax-agent/datastax-agent_5.2.1_all.deb" fixed the issue. We had to first kill the already running agent processes and then do a service restart.
Will investigate how that could have happened... that's still a little bit of a mystery to me.
I want to setup nginx with passenger support on ubuntu 12.04 VM (vagrant box). Therefore I created the following chef cookbook recipe (https://github.com/i42n/wrapper-nginx-passenger/blob/master/recipes/default.rb):
#
# Cookbook Name:: wrapper-nginx-passenger
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
apt_repository 'nginx-passenger' do
uri 'https://oss-binaries.phusionpassenger.com/apt/passenger'
distribution node['lsb']['codename']
components ['main']
keyserver 'keyserver.ubuntu.com'
key '561F9B9CAC40B2F7'
end
# install nginx which contains passenger support
package "nginx-extras"
package "passenger"
# define nginx service as the nginx::passenger recipe restarts the service
# and fails if the service does not exist
service 'nginx' do
supports :status => true, :restart => true, :reload => true
action :start
end
# installs the passenger gem
include_recipe "nginx::passenger"
# create server config template in nginx config directory
template "/etc/nginx/sites-available/plantasy" do
source "plantasy.erb"
mode 0644
owner "root"
group "root"
end
# symlink the config to the active sites directory
link "/etc/nginx/sites-enabled/plantasy" do
to "/etc/nginx/sites-available/plantasy"
end
It follows the passenger installation guide from here: https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.html#install_add_apt_repo
However if I try to start nginx I get the following error:
vagrant#vagrant:/etc/nginx/conf.d$ sudo service nginx restart
* Restarting nginx nginx
nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable (/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/buildout/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive, whichever is applicable. (-1: Unknown error)
...done.
This actually seems a common error if nginx has not been compiled correctly with passenger support. However if I check the nginx modules my nginx does have passenger support:
vagrant#vagrant:~$ nginx -V
nginx version: nginx/1.6.0
TLS SNI support enabled
configure arguments: --with-cc-opt= --with-ld-opt= --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_spdy_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-mail --with-mail_ssl_module --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/headers-more-nginx-module --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-auth-pam --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-cache-purge --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-dav-ext-module --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-development-kit --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-echo --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/ngx-fancyindex --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-http-push --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-lua --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-upload-progress --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/nginx-upstream-fair --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/ngx_http_substitutions_filter_module --add-module=/tmp/buildd/nginx-1.6.0/debian/modules/passenger/ext/nginx
The error is actually correct. The file/folder passenger is looking for on nginx startup is not present:
vagrant#vagrant:/etc/nginx/conf.d$ ls -l /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/passenger-4.0.45
total 196
-rw-r--r-- 1 vagrant root 80232 Jul 7 13:38 CHANGELOG
-rw-r--r-- 1 vagrant root 15919 Jul 7 13:38 CONTRIBUTING.md
-rw-r--r-- 1 vagrant root 1035 Jul 7 13:38 CONTRIBUTORS
-rw-r--r-- 1 vagrant root 363 Jul 7 13:38 INSTALL.md
-rw-r--r-- 1 vagrant root 1056 Jul 7 13:38 LICENSE
-rw-r--r-- 1 vagrant root 2880 Jul 7 13:38 README.md
-rw-r--r-- 1 vagrant root 1814 Jul 7 13:38 Rakefile
-rw-r--r-- 1 vagrant root 2345 Jul 7 13:38 Vagrantfile
drwxr-xr-x 2 vagrant root 4096 Jul 7 13:38 bin
drwxr-xr-x 2 vagrant root 4096 Jul 7 13:38 build
-rwxr-xr-x 1 vagrant root 287 Jul 7 13:38 configure
drwxr-xr-x 4 vagrant root 4096 Jul 7 13:38 debian.template
drwxr-xr-x 4 vagrant root 4096 Jul 7 13:38 dev
drwxr-xr-x 5 vagrant root 4096 Jul 7 13:38 doc
drwxr-xr-x 2 vagrant root 4096 Jul 7 13:38 download_cache
drwxr-xr-x 10 vagrant root 4096 Jul 7 13:38 ext
drwxr-xr-x 3 vagrant root 4096 Jul 7 13:38 helper-scripts
drwxr-xr-x 3 vagrant root 4096 Jul 7 13:38 lib
drwxr-xr-x 2 vagrant root 4096 Jul 7 13:38 man
drwxr-xr-x 3 vagrant root 4096 Jul 7 13:38 node_lib
-rw-r--r-- 1 vagrant root 6514 Jul 7 13:38 npm-shrinkwrap.json
-rw-r--r-- 1 vagrant root 722 Jul 7 13:38 package.json
-rw-r--r-- 1 vagrant root 1243 Jul 7 13:38 passenger.gemspec
drwxr-xr-x 4 vagrant root 4096 Jul 7 13:38 resources
drwxr-xr-x 2 vagrant root 4096 Jul 7 13:38 rpm
drwxr-xr-x 10 vagrant root 4096 Jul 7 13:38 test
I have a default nginx.conf and /etc/nginx/conf.d/passenger.conf looks like this:
vagrant#vagrant:/etc/nginx/conf.d$ cat /etc/nginx/conf.d/passenger.conf
passenger_root /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/passenger-4.0.45;
passenger_ruby /usr/local/rvm/rubies/ruby-2.1.2/bin/ruby;
passenger_max_pool_size 6;
passenger_spawn_method smart-lv2;
passenger_buffer_response on;
passenger_min_instances 1;
passenger_max_instances_per_app 0;
passenger_pool_idle_time 300;
passenger_max_requests 0;
If I remove the passenger.conf nginx starts without errors and serves the default test page fine. As expectable passenger does not work.
My passenger app nginx config looks like this:
vagrant#vagrant:~$ cat /etc/nginx/sites-enabled/plantasy
# Only for development purposes.
# For production environment, set it accordingly (i.e. production)
# Remove this line when you upload an actual application.
# For * TESTING * purposes only.
passenger_app_env development;
server {
listen 8080;
server_name example.com;
passenger_enabled on;
passenger_ruby /usr/local/rvm/rubies/ruby-2.1.2/bin/ruby;
root /home/vagrant/app/public;
}
If I try to access this page, I get a 403:
vagrant#vagrant:~$ curl localhost:8080
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.6.0</center>
</body>
</html>
Ruby is installed correctly:
vagrant#vagrant:~$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
Also the passenger gem is installed.
vagrant#vagrant:~$ gem list passenger
*** LOCAL GEMS ***
passenger (4.0.45)
I really do not know what's wrong. I checked out this thread but as you can see above, I have nginx present with passenger support. It's just the passenger binary missing?
Any ideas how to fix this?
And before anyone suggests it: I do not want to compile nginx myself. I want to use the version from the apt repository as it speeds up performance on vagrant VM setup very much.
Your passenger_root directive is incorrect. You can discover the correct value for it by following the guide here:
https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.html#inserting_passenger_root_for_apt
Check passenger-install-nginx-module is properly installed.
By 'which passenger-install-nginx-module'
if not installed, try with:
rvmsudo passenger-install-nginx-module
This is for rvm users. Will solve problem