Do not working nginx...

Hi everyone

I’m trying to make a film project
But the test site does not open (neither by ip nor PC). 502 Bad Gateway
I think the problem is in the configuration settings of nginx or php-fpm.

Thanks

It is my error.

/var/log/nginx/joomla_error.log

`
2017/11/04 22:18:14 [crit] 10876#10876: *1 connect() to unix:/run/php/php7.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.1, server: joomla.devv, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/run/php/php7.1-fpm.sock:”, host: “192.168.5.2”

`

How will decide that problem?

Hi

I see only an error, and nothing more.
In order to help you we need to know what you are trying to achieve.
The ansible playbook would be a good start.

DIck

I want to run the Nginx server and PHP-FPM.
But the web page does not open (502 Bad Gateway)
I’ll find out that the pool (php7.1-fpm) is not running
Ii is all my project
`

  • name: install php{{ php.version }}-fpm

apt: name=php{{ php.version }}-fpm state=present

  • name: delete default config

file: path=/etc/php/{{ php.version }}/fpm/pool.d/www.conf state=absent

  • name: render php fpm pools config

template: src=pool-template.j2 dest=/etc/php/{{ php.version }}/fpm/pool.d/{{ item.name }}

with_items: ‘{{ apps }}’

notify: restart php-fpm `

You need to know *why* it isn't running.
The playbook you sent has a huge amount of empty lines - there could
be an issue there.
In any case there is a notify: statement (not sure why that is
rendered in italic, or why you need HTML to display plain text
content).
That notifies a handler.
If php-fpm isn't running, it must have not been restarted - so
something is off with the handler that does this.
So, check that handler, your issue is likely there.

Dick

php-joomla-vm/provisioning/roles/php-fpm/tasks/mail.yml

`

  • name: install php{{ php.version }}-fpm
    apt: name=php{{ php.version }}-fpm update_cache=yes state=present

  • name: delete default config
    file: path=/etc/php/{{ php.version }}/fpm/pool.d/www.conf state=absent

  • name: render php fpm pools config
    template: src=pool-template.j2 dest=/etc/php/{{ php.version }}/fpm/pool.d/{{ item.name }}
    with_items: ‘{{ apps }}’
    notify: restart php-fpm
    `

php-joomla-vm/provisioning/roles/php-fpm/handlers/mail.yml

`

  • name: restart php-fpm
    service: name=php{{ php.version }}-fpm state=restarted
    `

php-joomla-vm/provisioning/roles/php-fpm/templates/pool-template.j2

`
[{{ item.name }}]

user = {{ item.user }}
group = {{ item.group }}

listen = /run/php/php{{ php.version }}-fpm.sock

listen.owner = {{ item.user }}
listen.group = {{ item.group }}

pm = dynamic

pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
`

vagrant provision

`
Введите код.TASK [php-fpm : install php7.1-fpm] ********************************************
ok: [joomla] => {“cache_update_time”: 1510040072, “cache_updated”: true, “changed”: false, “failed”: false}

TASK [php-fpm : delete default config] *****************************************
ok: [joomla] => {“changed”: false, “failed”: false, “path”: “/etc/php/7.1/fpm/pool.d/www.conf”, “state”: “absent”}

TASK [php-fpm : render php fpm pools config] ***********************************
ok: [joomla] => (item={u’domain’: u’joomla.devv’, u’group’: u’vagrant’, u’name’: u’joomla’, u’db_user’: u’joomla’, u’db_passwd’: u’secret’, u’db_name’: u’joomla’, u’user’: u’vagrant’, u’type’: u’joomla’}) => {“changed”: false, “checksum”: “4237b94802ee910cefa41196b2cc8dbaa27bf9c4”, “failed”: false, “gid”: 0, “group”: “root”, “item”: {“db_name”: “joomla”, “db_passwd”: “secret”, “db_user”: “joomla”, “domain”: “joomla.devv”, “group”: “vagrant”, “name”: “joomla”, “type”: “joomla”, “user”: “vagrant”}, “mode”: “0644”, “owner”: “root”, “path”: “/etc/php/7.1/fpm/pool.d/joomla”, “size”: 269, “state”: “file”, “uid”: 0}

`

What could be wrong with the handler?

In the directory “/run/ php/” there is no php7.1-fpm.sock
How should he appear there?

I think your best bet is to either check the logs to see why your
php-fpm processes aren't creating sockets in that directory, or
manually install things to see at what stage things go wrong.

php7.1-fpm.log is empty
What other “log” to see?