Author |
|
farideh
Joined: 21 Dec 2014 Posts: 6
|
Posted: Tue 23 Dec '14 12:42 Post subject: Perl script : HTTP 403 Forbidden |
|
|
I am trying to run a simple Perl CGI on Apache 2.4.10 on Windows 7 Professional.
My Perl directory is c:\perl64\bin\perl5.20.1.
c:/localhost/ gives me the Welcome page.
c:\perl64\bin\fig.pl works.
c:\Apache24\httpd.conf is changed to :
serverRoot "c:/Apache24
Alias /cgi-bin /c:/Apache24/cgi-bin
<Directory c:/Apache24/cgi-bin>
AddHandler cgi-script cgi pl
Options ExecCGI
</Directory>
Http://localhost/c:/Apache24/cgi-bin/fig.pl
gives Http 403 Forbidden
The Website declined to show this Webpage . Http 403.
Please let me know "How to add Perl CGI Support to
my Apache 2.4.10 Web Server on Windows 7.
How to run my Perl CGI.
How to avoid Http 403 .
Farideh |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 23 Dec '14 13:10 Post subject: |
|
|
Since you you can Alias you need to call the script a bit different in your URL. Do not put the windows path into the url
http://localhost/cgi-bin/fig.pl
if you still have a question please ask again. |
|
Back to top |
|
farideh
Joined: 21 Dec 2014 Posts: 6
|
Posted: Tue 23 Dec '14 14:57 Post subject: |
|
|
thanks, but by typing :
http://localhost/cgi-bin/fig.pl
I have : Http 403.
Farideh
Last edited by farideh on Tue 23 Dec '14 17:10; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 23 Dec '14 15:19 Post subject: |
|
|
Are you sure your script is in c:/Apache24/cgi-bin ? |
|
Back to top |
|
farideh
Joined: 21 Dec 2014 Posts: 6
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 23 Dec '14 23:57 Post subject: |
|
|
Sorry,
I missed an important part...
You directory needs a
Code: |
Require all granted |
http://localhost/cgi-bin/fig.pl will work! |
|
Back to top |
|
farideh
Joined: 21 Dec 2014 Posts: 6
|
Posted: Wed 24 Dec '14 13:43 Post subject: |
|
|
Hi James :
I added "Require all granted"
Http://localhost/cgi-bin/fig.pl
gave me HTTP 404 Not Found.
By examining "c:/Apache24/logs/error" the followings found:
[Wed Dec 24 12:54:28 . 0365 39 2014] [core : error]
[pid 2884 : tid 940] (20023) the given path was above
the root path : [client :: 1 : 2424]AH00127: can not map GET /c:/Apache24/cgi-bin/fig.pl HTTP/1.1 to file.
I have also read about chmod 755 command on Unix to resolve Directories problems. But on Windows, have not seen any. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
farideh
Joined: 21 Dec 2014 Posts: 6
|
Posted: Sun 28 Dec '14 20:39 Post subject: |
|
|
It worked. Thanks for trying to help.
solution :
<Directory />
Options FollowsymLinks
AllowOverride none
Require all granted
</Directory>
ScriptAlias /cgi-bin "c:/Apache24/cgi-bin/"
<Directory c:/Apache24/cgi-bin>
AddHandler cgi-script cgi pl
options ExecCGI
</Directoriy> |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Mon 29 Dec '14 13:24 Post subject: |
|
|
There is a tutorial at http://www.tommyrodriguez.com/?p=446 , special attention to step 3.
Also try to have the first line of your script point to Perl.exe, in your case:
#!c:\perl64\bin\perl5.20.1\bin\PERL.EXE
Btw.
In your first post above you say that the Perl location is : c:\perl64\bin\perl5.20.1. Little strange naming for me.
So be sure where your perl.exe is. |
|
Back to top |
|
farideh
Joined: 21 Dec 2014 Posts: 6
|
Posted: Mon 29 Dec '14 20:34 Post subject: |
|
|
Hi Steffen
Thanks for the tutorial.
The Strawberry Perl has this strange Directory. |
|
Back to top |
|