Solved

Forbidden Access CGI Apache

Posted on 2007-04-05
1
1,198 Views
Last Modified: 2008-02-01
I have this CGI application running on Apache 2.0.5 on XP professional. It stopped working. Error: "Forbidden
You don't have permission to access /myapp.exe on this server"

Why?
0
Comment
Question by:joemontalbo
1 Comment
 
LVL 15

Accepted Solution

by:
samri earned 500 total points
ID: 18863149
hi  joemontalbo,

looking at the URL path, you may try to run CGI outside of /cgi-bin (default) folder.  Based on the URL, the myapp.exe may be located in your default htdocs folder ("c:\Program Files\Apache Group\Apache2\htdocs").

If you need to make this myapp.exe to be executed as CGI program, you need to configure your Apache to run CGI outside of "ScriptAlias"ed folder.  Having this option in your DocumentRoot is not recommended (but still possible).

Please refer to Apache docs on CGI -- and look at the secton for "CGI outside of ScriptAlias directories"/.
http://httpd.apache.org/docs/2.0/howto/cgi.html

You may need to look at your apache configuration file ("c:\Program Files\Apache Group\Apache2\conf\httpd.conf")

and look for this section.

DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.  
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

and, modify the Options line to look -  


<Directory />
    Options FollowSymLinks +ExecCGI
    AllowOverride None
</Directory>

 AddHandler cgi-script .cgi .pl


alternately, you could just copy the myapp.exe to "c:\Program Files\Apache Group\Apache2\cgi-bin" folder

and test it there, using the URL http://yourser/cgi-bin/myapp.exe

This is more recommended

cheers,
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question