intercity / chef-repo

Set up your server to host Ruby on Rails apps. - Follow us on Twitter: @intercityup
MIT License
417 stars 84 forks source link

Nginx, passenger module is not installed #201

Open arturictus opened 9 years ago

arturictus commented 9 years ago
sudo nginx -t
nginx: [emerg] unknown directive "passenger_root" in /etc/nginx/conf.d/passenger.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx -V
nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --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=/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-pcre-jit --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_secure_link_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.4.6/debian/modules/headers-more-nginx-module --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-cache-purge --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-dav-ext-module --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-development-kit --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.4.6/debian/modules/ngx-fancyindex --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-http-push --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-lua --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-upload-progress --add-module=/build/buildd/nginx-1.4.6/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.4.6/debian/modules/ngx_http_substitutions_filter_module

No passenger?

My run list:

"run_list":["role[mysql]","role[remove_applications]", "role[rails_passenger]", "role[sysadmins]"],
arturictus commented 9 years ago

After capistrano runs bundle install with the gem 'passenger' in the gem file all looks ok.

arturictus commented 9 years ago

My Nginx log was:

[emerg] 14487#0: unknown directive "passenger_root" in /etc/nginx/conf.d/passenger.conf:1

I had to run in the server:

apt-get install passenger
jvanbaarsen commented 9 years ago

@arturictus I believe I ran into this issue as well a little while ago. It had something to do with the servers of Passenger being down when running the chef cookbook. Thanks for reporting this! :yellow_heart:

@michiels I believe this is something we need to look in to.

michiels commented 9 years ago

@jvanbaarsen definitely! Would be great if we could capture chef run logs somehow to see if the Passenger server timed out.

arturictus commented 9 years ago

@michiels, Couldn't find the chef log file. where is it? I'm using solo. I should have to flag it with '--force-logger' ? That's the documentation I found: https://docs.chef.io/ctl_chef_solo.html

I found this stackoverflow article: http://stackoverflow.com/questions/29255342/how-can-i-capture-chef-client-log-output-to-a-file-in-a-kitchen-run

could we setup in the repo to always write the log in a file?

michiels commented 9 years ago

@arturictus Yeah that's a good suggestion. I believe the command currently only logs to standard out.

berkes commented 8 years ago

The passenger recipe includes passenger, in the apt-sources. But I fail to see where it gets installed. Should there not be some code that actually installs it? Or am I overlooking something deadly obvious?

Edit: I'm understanding now that this simply overrides the location where nginx is fetched from. Seems ok. Removing (purging) nginx manually and reinstalling by rerunning cook solved this problem for me.

michiels commented 8 years ago

@berkes That's correct. We use Phusion's repository that installs a binary nginx and passenger already installed. This is so we don't have to compile nginx on machines manually, which is normally required when doing a manual passenger install.

berkes commented 8 years ago

I'm not sure how a deb- server should work, but passenger.list shows the url https://oss-binaries.phusionpassenger.com/apt/passenger, which leads to a 404. It may very well be that the passenger- apt is either misconfigured on their side, or that the wrong url is used in the apt-source. Will research this.

Edit: nope: it does not really matter, not on the first run nor when updating, that link is merely used as kind of template on how to build the urls where to find the actual packages.

doncuomo commented 8 years ago

I've ran into this issue as well. The above suggested fixes do not work for me. Does anyone have any tips?

edit:

Finaly figured out how to get it working for now. It is what you guys said but in a specific order: Had to remove all the installed nginx stuff from the server apt-get purge nginx* After that i installed passenger apt-get install passenger Then recook