I've followed the instructions to deploy my small Sinatra app in Ubuntu Trusty, using rvm and ruby 2.12, nginx. The app tries to start but I think it's trying to do the right thing by installing some missing components. The odd thing is it's trying to install them in /var/www ... which needs sudo access. I've looked at the nginx conf files but don't see why it's getting this as a default location. This app was running last year but it's not now so I'm trying to get it to work.
Following are conf files that may help.
Sure, while my harper user is part of the www-data group, it's not root. I need help figuring out the permissions here.
groups harper
harper sudo www-data
I have attempted to change the user in nginx.conf from www-data to harper but no different output.
sudo chmod g+x,o+x /home/harper/harper/contact.rb
sudo chmod g+x,o+x /home/harper/harper/
sudo chmod g+x,o+x /home/harper/
Environment variables
PASSENGER_USE_FEEDBACK_FD=true
SERVER_SOFTWARE=nginx/1.10.0 Phusion_Passenger/5.0.28
PASSENGER_DEBUG_DIR=/tmp/passenger.spawn-debug.XXXXsfCHyg
USER=www-data
LOGNAME=www-data
SHELL=/usr/sbin/nologin
HOME=/var/www
PWD=/home/harper/harper
IN_PASSENGER=1
PYTHONUNBUFFERED=1
NODE_PATH=/usr/share/passenger/node
RAILS_ENV=production
RACK_ENV=production
WSGI_ENV=production
NODE_ENV=production
PASSENGER_APP_ENV=production
passenger-config —root
/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
[locations]
packaging_method=deb
bin_dir=/usr/bin
support_binaries_dir=/usr/lib/passenger/support-binaries
lib_dir=/usr/lib/passenger
helper_scripts_dir=/usr/share/passenger/helper-scripts
resources_dir=/usr/share/passenger
include_dir=/usr/share/passenger/include
doc_dir=/usr/share/doc/passenger
ruby_libdir=/usr/lib/ruby/vendor_ruby
node_libdir=/usr/share/passenger/node
apache2_module_path=/usr/lib/apache2/modules/mod_passenger.so
ruby_extension_source_dir=/usr/share/passenger/ruby_extension_source
nginx_module_source_dir=/usr/share/passenger/ngx_http_passenger_module
/etc/nginx/nginx.conf
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
server {
#listen 80;
#root /home/harper/harper/app/;
#passenger_enabled on;
#passenger_friendly_error_pages on;
#passenger_startup_file contact.rb;
#passenger_app_type rack;
#passenger_ruby /home/harper/.rvm/gems/ruby-2.1.2/wrappers/ruby;
}
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
# include /etc/nginx/naxsi_core.rules;
##
# Phusion Passenger config
##
# Uncomment it if you installed passenger or passenger-enterprise
##
passenger_ruby /home/harper/.rvm/gems/ruby-2.1.2/wrappers/ruby;
#passenger_ruby /usr/lib/ruby/vendor_ruby/;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/harper.biz.conf;
/etc/nginx/sites-available/harper.biz.conf
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/harper/harper/app;
#index index.html index.htm;
# Turn on Passenger
passenger_enabled on;
passenger_ruby /home/harper/.rvm/gems/ruby-2.1.2/wrappers/ruby;
passenger_friendly_error_pages on;
passenger_startup_file contact.rb; #passenger will not start without this key/value
passenger_app_type rack;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
Apparently, passenger doesn't see it has what it needs and is trying to install it. But it's pointed to a directory that it doesn't have permission.
I've googled and re-read the docs to see what user passenger is thinking it has. What am I overlooking? thx, sam