user3165155
user3165155

Reputation: 33

cgi-bin configure fro httpd

I am trying to configure cgi with apache
I did following changes in httpd.conf file
uncommented

AddHandler cgi-script .cgi

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options +ExecCGI
    Require all granted
</Directory>

service httpd restart

But unable to execute, its giving following error in logs/error_log file

[Wed Mar 26 17:08:22.088316 2014] [mime_magic:error] [pid 7760] [client ::1:59024] AH01512: mod_mime_magic: can't read `/var/www/cgi-bin/hello.cgi'
[Wed Mar 26 17:08:22.089486 2014] [cgi:error] [pid 7760] [client ::1:59024] AH01215: (13)Permission denied: exec of '/var/www/cgi-bin/hello.cgi' failed
[Wed Mar 26 17:08:22.090045 2014] [cgi:error] [pid 7760] [client ::1:59024] End of script output before headers: hello.cgi

Upvotes: 0

Views: 1314

Answers (1)

blue
blue

Reputation: 1949

From here:

The problem is the security of SELinux is preventing mod_mime_magic access to the testprogram.

This happens when context of the program (in this case testprogram) does not match the directory. To change to the appropriate context, use the UNIX command "chcon".

Read the following article for details: Apache and SELinux

Upvotes: 1

Related Questions