0

I'm trying to install bugzilla on ubuntu + nginx and because I'm not a Linux expert, I encountered a problem at a certain stage. I did everything according to the instructions, and when I try to access the site I get the following error in error.log:

connect() to unix:/var/run/fcgiwrap.sock failed (2: No such file or directory) while connecting to upstream, client: ..., server: ..., request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.sock:", host: "..."

I found how to launch this socket, I launch it with the following command:

fcgiwrap -s unix:/var/run/fcgiwrap.sock

the socket is started:

# ls -la /run/fcgi*
srwxr-xr-x 1 root root 0 Jun 10 12:08 /run/fcgiwrap.sock
srw-rw-rw- 1 root root 0 Jun  9 19:20 /run/fcgiwrap.socket

but when I trying to open the website I get 502 error, and the error in error.log:

connect() to unix:/var/run/fcgiwrap.sock failed (13: Permission denied) while connecting to upstream, client: ... , server: ..., request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.sock:", host: "..."

and the second problem, after rebooting the server /var/run/fcgiwrap.sock stops working, how can I prevent it from unloading after rebooting the system?

New contributor
7tunnel is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • 1. Are you sure that /var/run/fcgiwrap.sock and /run/fcgiwrap.sock are the same socket? 2. Socket must be writable for nginx' worker user which is usually www-data or nobody.
    – Alexey Ten
    Commented 2 days ago

2 Answers 2

0

If you have installed fcgiwrap via apt on Ubuntu, the correct way to start it is with included systemd unit:

sudo systemctl enable fcgiwrap
sudo systemctl start fcgiwrap
sudo systemctl status fcgiwrap

This gurantees that fcgiwrap is started on boot with the proper UID/GID and socket ownership.

2
  • Yes, I ran these commands and it works after restarting the system. But the problem is that after restarting only “/run/fcgiwrap.socket” works, and to start “/run/fcgiwrap.sock” you again have to run the command “fcgiwrap -s unix:/var/run/fcgiwrap.sock”
    – 7tunnel
    Commented 2 days ago
  • @7tunnel please edit your nginx.conf fastcgi_pass statement to reference /var/run/fcgiwrap.socket. A complete statement should look like fastcgi_pass unix:/var/run/fcgiwrap.socket; as that's the socket name created by default systemd unit for this service on Debian. Commented 2 days ago
0

Thanks for answers! I found a solution on how to start a socket to make the site work:

spawn-fcgi -s /var/run/fcgiwrap.sock -M 755 -u www-data -g www-data  /usr/sbin/fcgiwrap

The only thing left. I can't figure out how to automatically start a socket after a "sudo restart". After restarting the system I have to start it again.

New contributor
7tunnel is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .