1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Default test.cgi script does not executes from newly created domain with enabled CGI

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by metalalisa, Jun 10, 2011.

  1. metalalisa

    metalalisa Basic Pleskian

    18
    85%
    Joined:
    Dec 9, 2010
    Messages:
    61
    Likes Received:
    0
    Code:
    # uname -a
    Linux ***** 2.6.18-238.12.1.el5.centos.plus #1 SMP Wed Jun 1 11:12:25 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
    Code:
    # cat /etc/redhat-release
    CentOS release 5.6 (Final)
    
    Code:
    # rpm -q psa
    psa-10.2.0-cos5.build1011110331.11
    
    Code:
    # cat 13076900830.12376900_httpd.include
    # ATTENTION!
    # DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
    # FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
    # MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
    # FOLLOWING FILE(S):
    #/var/www/vhosts/host.com/conf/vhost.conf
    
    <VirtualHost *.*.*.*:80>
        ServerName "host.com:80"
            ServerAlias  "www.host.com"
            UseCanonicalName Off
    
    <IfModule mod_suexec.c>
        SuexecUserGroup "host_com" "psacln"
    </IfModule>
    
        ServerAdmin  "admin@host.com"
    
            DocumentRoot "/var/www/vhosts/host.com/httpdocs"
        CustomLog /var/www/vhosts/host.com/statistics/logs/access_log plesklog
        ErrorLog  "/var/www/vhosts/host.com/statistics/logs/error_log"
    
    
    <IfModule mod_userdir.c>
        UserDir "/var/www/vhosts/host.com/web_users"
    </IfModule>
    
        ScriptAlias  "/cgi-bin/" "/var/www/vhosts/host.com/cgi-bin/"
    
        Alias  "/plesk-stat" "/var/www/vhosts/host.com/statistics"
        <Location  /plesk-stat/>
            Options +Indexes
        </Location>
        <Location  /plesk-stat/logs/>
            Require valid-user
        </Location>
        Alias  /webstat /var/www/vhosts/host.com/statistics/webstat
        Alias  /webstat-ssl /var/www/vhosts/host.com/statistics/webstat-ssl
        Alias  /ftpstat /var/www/vhosts/host.com/statistics/ftpstat
        Alias  /anon_ftpstat /var/www/vhosts/host.com/statistics/anon_ftpstat
    
        Alias  /awstats-icon /var/www/html/awstats
    
        <IfModule mod_ssl.c>
            SSLEngine off
        </IfModule>
    
        <Directory /var/www/vhosts/host.com/httpdocs>
    
    <IfModule sapi_apache2.c>
    php_admin_flag engine on
    php_admin_flag safe_mode on
    php_admin_value open_basedir /var/www/vhosts/host.com/httpdocs/:/tmp/
    </IfModule>
    
    <IfModule mod_php5.c>
    php_admin_flag engine on
    php_admin_flag safe_mode on
    php_admin_value open_basedir /var/www/vhosts/host.com/httpdocs/:/tmp/
    </IfModule>
    
            Options -Includes +ExecCGI
    
        </Directory>
    
    </VirtualHost>
    

    Code:
    # pwd
    /var/www/vhosts/host.com/cgi-bin/test
    
    # ls -l
    -rwxr-xr-x 1 host_com psacln 671 Jun 10 11:24 test.cgi
    
    Code:
    # tail error_log
    [Fri Jun 10 11:45:12 2011] [error] [client *.*.*.*] (13)Permission denied: exec of '/usr/sbin/suexec' failed
    [Fri Jun 10 11:45:12 2011] [error] [client *.*.*.*] Premature end of script headers: test.cgi
    [Fri Jun 10 11:46:14 2011] [error] [client *.*.*.*] (13)Permission denied: exec of '/usr/sbin/suexec' failed
    [Fri Jun 10 11:46:14 2011] [error] [client *.*.*.*] Premature end of script headers: test.cgi
    
    Code:
    # ls -l /usr/sbin/suexec
    lrwxrwxrwx 1 root root 32 Apr 25 20:19 /usr/sbin/suexec -> /usr/local/psa/suexec/psa-suexec
    
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    Looks like that /usr/sbin/suexec has been overwritten. Try to copy /usr/local/psa/suexec/psa-suexec over /usr/sbin/suexec and restart Apache.
     
  3. metalalisa

    metalalisa Basic Pleskian

    18
    85%
    Joined:
    Dec 9, 2010
    Messages:
    61
    Likes Received:
    0
    No, see last code quote
     
  4. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    No, there shouldn't be symlink:

    # ls -la /usr/sbin/suexec
    -r-s--x--- 1 root apache 22520 Mar 31 11:10 /usr/sbin/suexec
     
  5. metalalisa

    metalalisa Basic Pleskian

    18
    85%
    Joined:
    Dec 9, 2010
    Messages:
    61
    Likes Received:
    0
    yes, correct, thanks. Don't know, why it is symlink...
     
Loading...