简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM