Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to execute cgi files from /var/www/html/cgi-bin and /var/www/html/s1/cgi-bin. I currently have this in my httpd.conf

Options Indexes FollowSymLinks ExecCGI
ScriptAlias /cgi-bin/ "/var/www/html/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

Cgi files in /var/www/html/cgi-bin work perfectly but when I try to execute /var/www/html/s1/cgi-bin/test.cgi, I get errors saying I can't execute a directory /var/www/cgi-bin and that /var/www/cgi-bin/test.cgi does not exist.

How can I fix this problem?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Got it working by adding to httpd.conf

<Directory "/var/www/html/s1/cgi-bin">
    Options +ExecCGI -Indexes
    AddHandler cgi-script cgi pl
</Directory>
share|improve this answer
    
Ah, okay. Close enough. But that makes sense. Good luck to you. –  U4iK_HaZe Sep 5 '11 at 7:03
    
Thanks for helping –  Matthew Hui Sep 5 '11 at 8:23
add comment

Make sure the ScriptAlias place is in the "mod_alias" directives. (tags).

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"
</IfModule>

Edit: Of course use linux folder systems and not "C:/" etc.

share|improve this answer
    
When I first installed httpd, the mod_alias directives were not there –  Matthew Hui Sep 5 '11 at 0:34
    
So add them. It should fix your problem. –  U4iK_HaZe Sep 5 '11 at 1:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.