Articles in this section

Website or Webmail is showing 500 internal server error: command cgi_wrapper not in docroot

kb: technical Plesk Onyx for Linux ABT: Group B

Applicable to:

  • Plesk Onyx for Linux

Symptoms

  • Accessing to Webmail shows a "500 internal server error"

  • The following can be seen in the Apache log file:

    # tail -f /var/log/httpd/error_log
    [warn] [client 123.123.123.123] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
    [Thu Dec 05 17:21:00 2013] [error] [client 123.123.123.123] Premature end of script headers: index.php

  • The following can be seen in the Suexec log file:

    # tail -f /var/log/httpd/suexec_log
    uid: (501/horde_sysuser) gid: (504/504) cmd: cgi_wrapper
    command cgi_wrapper not in docroot (501)

Cause

CGI wrapper that comes with CentOS' apache RPM is hardcoded to allow only CGI scripts in /var/www

Resolution

Ensure that the /var/www is not a symlink to any other directory:

  1. Connect to the server via SSH

  2. Check that /var/www is not a symlink to any other directory:

    # ls -ld /var/www
    lrwxrwxrwx 1 root root 14 Oct 24 11:14 www -> /mnt/new_path/www/

  3. If the symlink exists, remove it

    # rm /var/www

  4. Change the vhost location to, for example, /mnt/new_path/www/ using the transvhosts.pl by referring to the following article: How to change virtual hosts location in Plesk for Linux?

  5. Create a real directory /var/www/ and copy folders /var/www/cgi-bin and /var/www/cgi-bin/webalizer back from /mnt/new_path/www:

    # cp -pR /mnt/new_path/www/cgi-bin /var/www/
    # cp -pR /mnt/new_path/www/webalizer /var/www/

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.