• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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

metalalisa

Basic Pleskian
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  "[email protected]"

        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
 
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.
 
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
 
Back
Top