Do not working nginx...

54 views
Skip to first unread message

Artur001

unread,
Nov 3, 2017, 9:12:02 AM11/3/17
to Ansible Project
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

Artur001

unread,
Nov 5, 2017, 3:02:08 AM11/5/17
to Ansible Project
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?


пятница, 3 ноября 2017 г., 16:12:02 UTC+3 пользователь Artur001 написал:

Dick Visser

unread,
Nov 5, 2017, 4:31:26 AM11/5/17
to ansible...@googlegroups.com
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
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/2da87a87-3c34-4caf-9eaa-27a98a13db43%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Dick Visser
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs

Artur001

unread,
Nov 5, 2017, 6:03:50 AM11/5/17
to Ansible Project
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




воскресенье, 5 ноября 2017 г., 12:31:26 UTC+3 пользователь Dick Visser написал:

Dick Visser

unread,
Nov 6, 2017, 8:26:00 AM11/6/17
to ansible...@googlegroups.com
On 5 November 2017 at 12:03, Artur001 <jaguar...@gmail.com> wrote:
> 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

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

Artur001

unread,
Nov 7, 2017, 3:07:20 AM11/7/17
to Ansible Project

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?


понедельник, 6 ноября 2017 г., 16:26:00 UTC+3 пользователь Dick Visser написал:

Artur001

unread,
Nov 8, 2017, 4:42:24 PM11/8/17
to Ansible Project
In the directory "/run/ php/" there is no php7.1-fpm.sock
How should he appear there?


Dick Visser

unread,
Nov 8, 2017, 5:01:59 PM11/8/17
to ansible...@googlegroups.com
On 8 November 2017 at 22:42, Artur001 <jaguar...@gmail.com> wrote:
> 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.

Artur001

unread,
Nov 10, 2017, 3:19:06 AM11/10/17
to Ansible Project
php7.1-fpm.log is empty
What other "log" to see?


четверг, 9 ноября 2017 г., 1:01:59 UTC+3 пользователь Dick Visser написал:
Reply all
Reply to author
Forward
0 new messages