How to configure my ubuntu server? Or what am I doing wrong?

First ask the question lest he be lost in the text. How to correctly install nginx+passenger? on ubu server 16.04
Just note that all nizhenapisannoe wheels on ubuntu 14.04 and does not roll on 16.04. And I really want a new OS))))
nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2016/05/19 20:47:00 [emerg] 13204#13204: unknown directive "passenger_ruby" in /etc/nginx/nginx.conf:14
nginx: configuration file /etc/nginx/nginx.conf test failed


So. Have a clean computer on which I put ubuntu server 16.04.
First put ruby handles:
sudo apt update-y
sudo apt upgrade-y
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.5

Ruby with rvm successfully installs. Reboot.
Then put the rest of the software that I need.
Wrote a script for installing the software:
#!/bin/sh
echo "install ntpdate:"
apt install ntpdate
echo "install nodejs:"
apt install -y nodejs
echo "install unzip:"
apt install -y 
# for pg gem
sudo apt install libpq-dev-y
echo "install Java 8 at:"
add-apt-repository ppa:webupd8team/java
apt update
apt install -y oracle-Java 8 at-installer
echo "install postgresql"
apt install -y postgresql
echo "install redis:"
apt install -y redis-server
echo "install git:"
apt install -y git
echo "install imagemagick:"
apt install -y imagemagick
echo "install bundler:"
gem install bundler --no-rdoc --no-ri
echo "install rails 4.2.5:"
gem install rails -v 4.2.5 --no-rdoc --no-ri
echo "install backup 4.2.0:"
gem install backup -v 4.2.0 --no-rdoc --no-ri
echo "install nginx+passenger:"
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
apt install -y apt-transport-https ca-certificates
# Add our APT repository
sh-c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main > /etc/apt/sources.list.d/passenger.list'
apt update
# Install Passenger + Nginx
apt install -y nginx-extras passenger

Log installation of the software attached in the comments.
Please note that nginx without passenger was koga log!
Then do a deploy via Capistrano. It is complete, program config for nginx (good, working, tested on ubuntu server 14.04) and plugging in the end at the start nginx:

deployer@4e4o:~$ nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2016/05/19 20:49:14 [emerg] 13510#13510: unknown directive "passenger_ruby" in /etc/nginx/nginx.conf:14
nginx: configuration file /etc/nginx/nginx.conf test failed
July 9th 19 at 12:54
2 answers
July 9th 19 at 12:56
Set the correct permissions on the file /var/log/nginx/error.log
Install nginx-extras c support passenger

PS
How to install passenger for nginx?
Install nginx-extras passenger c support. That is the question - claud_Kerluke commented on July 9th 19 at 12:59
Set correct permissions on /var/log/nginx/error.log - the problem is not that, but the unknown directive "passenger_ruby" - claud_Kerluke commented on July 9th 19 at 13:02
Install nginx-extras passenger c support and issue with unknown directive "passenger_ruby" will disappear. - Mikayla.Roh commented on July 9th 19 at 13:05
July 9th 19 at 12:58
And I really want a new OS))))

The desire to have on the server, the new axle - not the best desire. Makes sense to wait a bit until version 16.04.1.

sh-c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main > /etc/apt/sources.list.d/passenger.list'

Returning to the previous point - a week ago official binary passenger'and for Ubuntu 16.04 was not. On the official website there are no installation instructions on 16.04. Did you even check what you yourself added? And look carefully at the log of installation: you put the passenger from the standard Ubuntu repositories.

deployer@4e4o:~$ nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)


The user who runs nginx must have write access to the specified file.

config for nginx (good, working, tested on another OS)
unknown directive "passenger_ruby" in /etc/nginx/nginx.conf:14

You put everything except the fact that you have the errors mentioned. Perhaps you have some problem in /etc/nginx/nginx.conf, and maybe again something wrong with the rights. But most of all - solved installation passenger'and oss-binaries.phusionpassenger.com/apt/passenger for Ubuntu 16.04 (when he appears there). And while not in a hurry - Ubuntu 14.04 will be supported for several more years - time to upgrade.

Find more questions by tags NginxPassengerRuby on RailsUbuntu Server