Articles in this section

Apache fails to start on a Plesk server: Wrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper cannot be accessed: (2)No such file or directory

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

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

    CONFIG_TEXT: 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:

    CONFIG_TEXT: 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

  1. Connect to the Plesk server via SSH.

  2. 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

  3. Make the downloaded script executable via this command:

    # chmod +x restore-wrapper.sh

  4. Run the script by executing the following command:

    # ./restore-wrapper.sh

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.