-1

When I tried to access the http://host-ip/~ec2-user/cgi-bin/try.cgi, I got 403 Forbidden error, error_log shows Options ExecCGI is off in this directory: /home/ec2-user/public_html/cgi-bin/try.cgi. If I commented out AddHandler line, I can see the script text, though. Below is some basic information. Do you have any clue what is preventing the server from parsing CGI scripts? Thanks!

[ec2-user@ip-10-245-79-145 cgi-bin]$ uname -a
Linux ip-10-245-79-145 3.4.37-40.44.amzn1.x86_64 #1 SMP Thu Mar 21 01:17:08 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

[ec2-user@ip-10-245-79-145 cgi-bin]$ apachectl -v
Server version: Apache/2.2.24 (Unix)
Server built:   Apr 30 2013 22:53:39

[ec2-user@ip-10-245-79-145 cgi-bin]$ tail /etc/httpd/conf/httpd.conf
<Directory "/home/ec2-user/public_html/cgi-bin/">
        Options +ExecCGI
        AddHandler cgi-script .cgi
        Order allow,deny
        Allow from all
</Directory>

No .htaccess file in the /home/ec2-user/public_html/cgi-bin/ directory, no SELinux running, suexec.log shows nothing.

Youngman
  • 111
  • 4

1 Answers1

0

Finally I figured out the reason after reading how sections are merged, my script works after commenting out the following lines in my httpd.conf:

<Location />
       Options         Includes
       AddHandler      server-parsed .shtml
</Location>
Youngman
  • 111
  • 4