Symptoms
-
All websites show a "502 Bad Gateway" error in a web-browser.
-
Apache fails to start. The following error message is returned by Apache configuration checker:
-
on CentOS/RHEL-based distributions
# httpd -t
-
on Debian/Ubuntu-based distributions
# apache2ctl -t
Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be accessed: (2)No such file or directory
-
- Running the
plesk repair fs
command reveals an error that is similar to the following:Checking Linux system files
There are incorrect permissions on some items:
/var/www/cgi-bin/cgi_wrapper/cgi_wrapper .......................... [ERROR]
To see more details, run the command in the verbose mode: plesk repair fs -verbose
Repairing incorrect permissions ................................. [2024-12-13 16:25:31.733] 1478637:675c51ebb2e4c ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/fsmng' '--set-ac' '/var/www/cgi-bin/cgi_wrapper/cgi_wrapper'] with exit code [1]
[FAILED]
- fsmng failed: ERROR: [Errno 2] No such file or directory:
'/var/www/cgi-bin/cgi_wrapper/cgi_wrapper'
Cause
The file /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
is missing.
Resolution
-
Connect to the Plesk server via SSH.
-
Download the script that recreates this file by executing the following command:
# curl https://raw.githubusercontent.com/plesk/kb-scripts/refs/heads/master/restore-wrapper/restore-wrapper.sh -o restore-wrapper.sh
-
Make the downloaded script executable via this command:
# chmod +x restore-wrapper.sh
-
Run the script by executing the following command:
# ./restore-wrapper.sh