Article ID: 125915, created on Jun 17, 2015, last review on Sep 4, 2015

  • Applies to:
  • Plesk 11.5 for Linux


CWD is improperly set in Python script.

The following message appears in apache error log:

    Thu Apr 16 15:52:56 2015] [error] [client] mod_python (pid=17749, interpreter='', phase='PythonHandler', handler='mod_python.cgihandler'): Application error
    [Thu Apr 16 15:52:56 2015] [error] [client] ServerName: ''
    [Thu Apr 16 15:52:56 2015] [error] [client] DocumentRoot: '/var/www/vhosts/'
    [Thu Apr 16 15:52:56 2015] [error] [client] URI: '/cgi-bin/'
    [Thu Apr 16 15:52:56 2015] [error] [client] Location: None


Such behaviour is known as software issue #PPP-2745 and will be fixed in further updates.


As workaround you need to modify the domain configuration file /etc/apache2/plesk.conf.d/vhosts/ by replacing PythonHandler mod_python.cgihandler to PythonHandler mod_python.publisher:

<IfModule mod_python.c>
    <Files ~ (\.py$)>
        SetHandler python-program
        PythonHandler mod_python.cgihandler
<IfModule mod_fcgid.c>

To make such configuration to be applied for newly created domains as well, it is better to perform changes via custom web server config templates at /opt/psa/admin/conf/templates/default/service/mod_python.php. In this case changes will not be overwritten on next domains configuration rebuild.

Please check the official guide for your reference.

Search Words

PythonHandler mod_python.cgihandler

CWD is improperly set in Python script

SetHandler python-program

29d1e90fd304f01e6420fbe60f66f838 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 01bc4c8cf5b7f01f815a7ada004154a2 0a53c5a9ca65a74d37ef5c5eaeb55d7f

Email subscription for changes to this article
Save as PDF