Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

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

 
apachecentosfastcgiinternal server errorlinux

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/

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Extended Lifecycle Support OSes Update

Read More »

WordPress 500 Internal Server Error: What to do

Read More »

How to Check Open Ports in Linux (Simple Commands & Tools)

Read More »
Knowledge Base

Webmail works very slow or unavailable: Internal Server Error

Read More »

How to change PHP version for webmail in Plesk for Linux?

Read More »

Unable to access RoundCube webmail with the 500 error: the /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 symlink is missing

Read More »

A website/webmail hosted in Plesk on CentOS/RHEL is showing internal server error 500: Exec format error: exec of /usr/sbin/suexec failed

Read More »

Hosting Wiki

  • Server Redundancy
  • QMAIL
  • Sendmail
  • Linux Containers
  • CGI
  • Bare Metal Server
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • PHP
  • Plesk
  • Apache Tomcat
  • Apache
  • Web Server
  • DNS Server
  • SSH
  • Email Autoresponder
  • Mailing Lists
  • Email Alias
  • Email Virus Protection
  • Email Forwarding
  • Webmail
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family