- Plesk for Linux
CGI scripts do not work on a domain if there is an application (e.g WordPress) installed via the Plesk Application Catalog (either through Tools & Settings > Application Vault or Domains > example.com > Applications) to the Document Root of the domain.
CGI support is enabled in Domains > example.com > Hosting Settings
CGI directory location it automatically detected as
/usr/lib/cgi-bin/. The following error might be found in
CONFIG_TEXT: [cgi:error] [pid 6315] [client 203.0.113.2:36203] script not found or unable to stat: /usr/lib/cgi-bin/
- ScriptAlias parameter is missing in domain's configuration file:
# grep ScriptAlias /var/www/vhosts/system/example.com/conf/httpd.conf
Plesk does not add the
ScriptAlias directive for
/cgi-bin/ if the application from Application Catalog is installed in the Document Root directory. This behavior is the requirement of https://www.apsstandard.org/ that was made in order to prevent corrupting
/cgi-bin/ of already existing applications on a domain. That is why when an application is installed from the Application Catalog, ScriptAlias gets removed from domain's configuration file.
ScriptAlias directive manually:
- Login to Plesk
Navigate to Subscriptions > example.com > Apache & Nginx settings > Additional Apache directives
Add the desired location for
/cgi-bin/to Additional directives for HTTP and Additional directives for HTTPS:
CONFIG_TEXT: ScriptAlias "/cgi-bin/" "/var/www/vhosts/example.com/httpdocs/cgi-bin/"
Note: In Plesk 12.0 and Plesk 12.5 WordPress installed via WordPress Toolkit extension will be still installed from Application catalog. As a result, CGI scripts will not work even if WordPress installed using WordPress Toolkit extension.