nginx не хочет
[root@one ~]# systemctl start nginx
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
[root@one ~]# systemctl status nginx.service
nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Пт 2015-10-02 17:28:16 MSK; 4s ago
Process: 4749 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
окт 02 17:28:16 one systemd[1]: Starting The nginx HTTP and reverse proxy server...
окт 02 17:28:16 one nginx[4749]: nginx: [emerg] no path in the unix domain socket in upstream "unix:" in /etc/nginx/conf.d/lesson-web.conf:2
окт 02 17:28:16 one nginx[4749]: nginx: configuration file /etc/nginx/nginx.conf test failed
окт 02 17:28:16 one systemd[1]: nginx.service: control process exited, code=exited status=1
окт 02 17:28:16 one systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
окт 02 17:28:16 one systemd[1]: Unit nginx.service entered failed state.
[root@one ~]# su petrov
[petrov@one root]$ rvm use 2.2.2
Using /usr/local/rvm/gems/ruby-2.2.2
[petrov@one root]$ unicorn_rails -c config/unicorn.rb -E production -D
/usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:75:in `read': Permission denied @ rb_sysopen - config/unicorn.rb (Errno::EACCES)
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:75:in `reload'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/configurator.rb:68:in `initialize'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:100:in `new'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:100:in `initialize'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `new'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `'
from /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails:23:in `load'
from /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails:23:in `'
from /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `'
master failed to start, check stderr log for details
I, [2015-10-02T16:24:47.415487 #3069] INFO -- : Refreshing Gem list
E, [2015-10-02T16:24:48.589697 #3069] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:24:48.589765 #3069] ERROR -- : retrying in 0.5 seconds (4 tries left)
E, [2015-10-02T16:24:49.090285 #3069] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:24:49.090482 #3069] ERROR -- : retrying in 0.5 seconds (3 tries left)
E, [2015-10-02T16:24:49.591005 #3069] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:24:49.591159 #3069] ERROR -- : retrying in 0.5 seconds (2 tries left)
E, [2015-10-02T16:24:50.091695 #3069] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:24:50.091867 #3069] ERROR -- : retrying in 0.5 seconds (1 tries left)
E, [2015-10-02T16:24:50.592412 #3069] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:24:50.592568 #3069] ERROR -- : retrying in 0.5 seconds (0 tries left)
E, [2015-10-02T16:24:51.093108 #3069] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
/usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:158:in `initialize': Address already in use - connect(2) for /tmp/unicorn.sock (Errno::EADDRINUSE)
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:158:in `new'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:158:in `bind_listen'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:242:in `listen'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `block in bind_new_listeners!'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `each'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `bind_new_listeners!'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:138:in `start'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `'
from /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails:23:in `load'
from /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails:23:in `'
from /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `'
I, [2015-10-02T16:25:49.524852 #3077] INFO -- : Refreshing Gem list
E, [2015-10-02T16:25:50.752528 #3077] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:25:50.752600 #3077] ERROR -- : retrying in 0.5 seconds (4 tries left)
E, [2015-10-02T16:25:51.253002 #3077] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:25:51.253143 #3077] ERROR -- : retrying in 0.5 seconds (3 tries left)
E, [2015-10-02T16:25:51.753617 #3077] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:25:51.753759 #3077] ERROR -- : retrying in 0.5 seconds (2 tries left)
E, [2015-10-02T16:25:52.254179 #3077] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:25:52.254352 #3077] ERROR -- : retrying in 0.5 seconds (1 tries left)
E, [2015-10-02T16:25:52.754813 #3077] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
E, [2015-10-02T16:25:52.754983 #3077] ERROR -- : retrying in 0.5 seconds (0 tries left)
E, [2015-10-02T16:25:53.255491 #3077] ERROR -- : adding listener failed addr=/tmp/unicorn.sock (in use)
/usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:158:in `initialize': Address already in use - connect(2) for /tmp/unicorn.sock (Errno::EADDRINUSE)
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:158:in `new'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:158:in `bind_listen'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:242:in `listen'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `block in bind_new_listeners!'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `each'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `bind_new_listeners!'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:138:in `start'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `'
from /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails:23:in `load'
from /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails:23:in `'
from /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `'
I, [2015-10-02T16:27:47.001419 #3256] INFO -- : Refreshing Gem list
I, [2015-10-02T16:27:48.199664 #3256] INFO -- : unlinking existing socket=/tmp/unicorn.sock
F, [2015-10-02T16:27:48.199756 #3256] FATAL -- : error adding listener addr=/tmp/unicorn.sock
/usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:149:in `unlink': Operation not permitted @ unlink_internal - /tmp/unicorn.sock (Errno::EPERM)
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:149:in `rescue in bind_listen'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:143:in `bind_listen'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:242:in `listen'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `block in bind_new_listeners!'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `each'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `bind_new_listeners!'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:138:in `start'
from /usr/local/rvm/gems/ruby-2.2.2/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `'
from /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails:23:in `load'
from /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails:23:in `'
from /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `'
[root@one lessonweb]# which unicorn_rails
/usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails
[root@one lessonweb]# sudo -u petrov /usr/local/rvm/gems/ruby-2.2.2/bin/unicorn_rails -c config/unicorn.rb -E production -D
/usr/bin/env: ruby_executable_hooks: Нет такого файла или каталога
Кстати говоря я пытался запустить просто html файл.
И из папки /usr/share/nginx/html/ index.html запускается.
А когда я настройках nginx указываю пут например /home/petrov/test/ и там файлик index.html, то ошибку 403 выдает.
я запускаю все от root.
Я не очень пока понимаю всю систему, но вроде как-то можно от sudo запускать. И я читал что создают пользователя для nginx.
А пользователь nginx автоматически создается, а у него какие права доступа?