Plesk

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

Symptoms

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/

Exit mobile version