Sympa邮件列表部署遇Nginx FCGI连接拒绝问题求助
Let’s work through this FCGI socket issue step by step—this is a common pain point with Sympa, but we can narrow it down quickly:
1. First, Verify the Socket File Exists & Has Correct Permissions
Start by checking if the socket Sympa is supposed to use actually exists, and who owns it:
ls -l /var/run/sympa/
You should see a file like wwsympa.sock (the exact name depends on your config). If it’s missing, that means the wwsympa process didn’t start properly—skip to step 3 to debug the process.
If the socket exists, check its permissions: it should be owned by the sympa user/group, and the Nginx user (usually www-data) needs read/write access to it. If the permissions look like srw------- (only owner can access), that’s the problem.
2. Check Your System V Init Script for Correct Socket Configuration
Open up your System V init file and verify these key details:
- The script launches
wwsympa.fcgiwith the correct socket path (matches what’s in Nginx) - It runs the process as the
sympauser/group (look for--user sympa --group sympain the start command) - It sets a umask that allows group access (e.g.,
--umask 0007to make socket permissionssrw-rw----)
For example, your start command should look something like:
/usr/lib/cgi-bin/sympa/wwsympa.fcgi --socket /var/run/sympa/wwsympa.sock --user sympa --group sympa --umask 0007
If the socket path here doesn’t match what’s in Nginx, that’s a guaranteed connection failure.
3. Ensure the wwsympa FCGI Process is Running
Check if the process is active with:
ps aux | grep wwsympa
If you don’t see any wwsympa.fcgi processes, try starting it manually and check for errors:
/etc/init.d/wwsympa start tail -f /var/log/sympa/wwsympa.log
Common errors here include:
- Permission denied to create the socket (fix by ensuring
/var/run/sympa/is owned bysympa:sympawithchown sympa:sympa /var/run/sympa/) - Missing dependencies (check if all Perl modules for Sympa are installed with
dpkg -l | grep sympa)
4. Validate Your Nginx Configuration
Double-check your Nginx config to make sure:
- The
fastcgi_passline points to the exact same socket path as your System V script:fastcgi_pass unix:/var/run/sympa/wwsympa.sock; - You’ve included the necessary FastCGI parameters, especially
SCRIPT_FILENAMEandPATH_INFO:location /sympa { fastcgi_pass unix:/var/run/sympa/wwsympa.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/sympa/wwsympa.fcgi; fastcgi_param PATH_INFO $fastcgi_path_info; }
After making changes, test the config and restart Nginx:
nginx -t service nginx restart
5. Fix Cross-User Permissions
If the socket exists but Nginx still can’t access it, add the Nginx user to the sympa group to grant access:
usermod -aG sympa www-data
Then restart both wwsympa and Nginx to apply the change.
Most of the time, this issue boils down to one of three things: a mismatched socket path, a dead wwsympa process, or permission blocks between Sympa and Nginx. Work through these steps one by one, and you should get it up and running.
内容的提问来源于stack exchange,提问作者Andrey Tsarev

