FastCGI issues on Rocky Linux 9 with Nginx

Hi,

I am installing RT 5.0.3 with Postgres 15 and Nginx 1.20 on Rocky Linux 9.2. I have used the manual install instructions on the wiki to do this. I am stuck at the end of the web server install. I believe I have an problem with FastCGI. Systemd is adamant the FastCGI RT server is running.

[root@helpdesk etc]# systemctl status rt-server
● rt-server.service - RT FCGI server
     Loaded: loaded (/etc/systemd/system/rt-server.service; static)
     Active: active (running) since Wed 2023-02-01 10:48:49 GMT; 10min ago
TriggeredBy: ● rt-server.socket
   Main PID: 1918 (multiwatch)
      Tasks: 4 (limit: 48914)
     Memory: 603.9M
        CPU: 4.527s
     CGroup: /system.slice/rt-server.service
             ├─1918 /usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi
             ├─1920 perl -I/opt/rt5/local/lib/perl5 -w /opt/rt5/sbin/rt-server.fcgi
             ├─1921 perl -I/opt/rt5/local/lib/perl5 -w /opt/rt5/sbin/rt-server.fcgi
             └─1922 perl -I/opt/rt5/local/lib/perl5 -w /opt/rt5/sbin/rt-server.fcgi

Feb 01 10:48:49 helpdesk systemd[1]: Started RT FCGI server.

However Nginx is claiming that it can’t connect.

2023/02/01 10:50:13 [error] 928#928: *15 no live upstreams while connecting to upstream, client: 172.31.250.205, server: _, request: "GET /nginx-logo.png HTTP/1.1", upstream: "fastcgi://localhost", host: "172.31.1.77", referrer: "http://172.31.1.77/"
2023/02/01 10:50:13 [error] 928#928: *18 no live upstreams while connecting to upstream, client: 172.31.250.205, server: _, request: "GET /poweredby.png HTTP/1.1", upstream: "fastcgi://localhost", host: "172.31.1.77", referrer: "http://172.31.1.77/"
2023/02/01 10:50:14 [error] 928#928: *18 no live upstreams while connecting to upstream, client: 172.31.250.205, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://localhost", host: "172.31.1.77", referrer: "http://172.31.1.77/"
2023/02/01 10:50:14 [error] 928#928: *18 no live upstreams while connecting to upstream, client: 172.31.250.205, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://localhost", host: "172.31.1.77"
2023/02/01 10:50:14 [error] 928#928: *18 no live upstreams while connecting to upstream, client: 172.31.250.205, server: _, request: "GET /nginx-logo.png HTTP/1.1", upstream: "fastcgi://localhost", host: "172.31.1.77", referrer: "http://172.31.1.77/"
2023/02/01 10:50:14 [error] 928#928: *15 no live upstreams while connecting to upstream, client: 172.31.250.205, server: _, request: "GET /poweredby.png HTTP/1.1", upstream: "fastcgi://localhost", host: "172.31.1.77", referrer: "http://172.31.1.77/"
2023/02/01 10:50:14 [error] 928#928: *18 no live upstreams while connecting to upstream, client: 172.31.250.205, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://localhost", host: "172.31.1.77", referrer: "http://172.31.1.77/"

I suspect I have some sort of permissions issue. I have run make fixperms. I have disabled SELinux. :slight_smile:

Just to update progress.

I stopped Nginx and tried running rt-server directly (as you would for development). Initially this broke as some of the directories under /opt/rt5 were owned by root. I chown’d these all to rt:rt and that would let it run and i can login and access RT this way. That at least proves RT is working.

This hasn’t made any difference to Nginx and the FastCGI though. :frowning:

Worth noting a couple of things, there is this page for web deployment which you can compare to your setup.

When you run make fixperms from the unpacked RT source dir, is it writing ownership to the correct user? The one nginx will be accessing the RT files as?

I ran make fixdeps again. It suggested making the web ui readable to all with the root user/group and the web data writeable with the rt user and group. I ran these outputted commands as directed.
I retested and nginx still can’t connect to the fastcgi socket.

Nginx is running as user ‘nginx’. RT FastCGI is running as ‘rt’. So nginx doesn’t have any file access to rt as far as I can tell. I note in the web development document it says to run the FastCGI as the web server user? Rather than as rt?

I have fixed this issue. The wiki documentation is incorrect in the install instruction for the systemd socket on Rocky 9.1

When I checked with ‘lsof -i 5000’ systemd was only opening the socket for IPv6 connections. Nginx was attempting to connect via IPv4…

I updated rt-server.socket and changed

ListenStream=[::1]:5000

to

ListenStream=127.0.0.1:5000

Rebooted and Nginx could access the FastCGI socket and load the site correctly.