I have created a virtual host with following configuration
NameVirtualHost 192.168.0.2:80
#Default Host
<VirtualHost *>
DocumentRoot /var/www/html
ServerName Linux
DirectoryIndex index.html
</VirtualHost>
#My domain
<VirtualHost 192.168.0.2>
DocumentRoot /var/www/mysite
ServerName
www.mysite.com
DirectoryIndex index.html
<Files results>
ForceType application/x-httpd-cgi
</Files>
<Directory "/var/www/mysite">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow, deny
Allow from all
</Directory>
</VirtualHost>
I have created a subdirectory that I named "result" under DocumentRoot directory mysite and placed a cgi file called results but with no .cgi extension but ForceType should take care of it.
but when I type URL
www.mysite.com/result/results
it doesnt run the file as cgi script but a window appears telling me that
"you have chosen to open results which is a: application/x-httpd-cgi from:
http://www.mysite.com
and asking me to open with or save to disk.
I am wondering why it is doing this instead of running it.
I also added the following line it maynot be necesary but I still added
AddHandler cgi-script .cgi
it run when I put results in the main directory
www.mysite.com/results
I will appreciate if anybody could help me in this
Thanks!!