Author |
|
fgorji
Joined: 15 Dec 2015 Posts: 9 Location: Iran
|
Posted: Tue 15 Dec '15 20:36 Post subject: Configuring Apache2.4.18 to permit Perl 5.22.0 l CGI |
|
|
Hi, I am trying to run my Perl CGI script using Apache2.4.18 Win64 vc14.I am using ActivePerl5.22.0
build 2200 64 bit.My Apache Directory is c:/Apache24/cgi-bin, in which i put my Perl CGI Script.When I try to run my CGI by Typing http://localhost/c:Apache24/cgi-bin/seminar.cgi
I keep receiving http 403 error.My http.conf has these entries:...[core error][pid 34 88:tid 924][20023] the given path wasabove the root path:[client::55718]Ah00127:can not map GET /c:/Apache24/CGI-bin/seminar.cgi Http/1.1 to file
my perl directory is c:/perl64
would you please help me?
Thank you Farideh |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 16 Dec '15 19:05 Post subject: Re: Cnnfiguring Apache2.4.18 to permit Per5.22.0 l CGI |
|
|
fgorji wrote: | http://localhost/c:Apache24/cgi-bin/seminar.cgi |
Try http://localhost/cgi-bin/seminar.cgi |
|
Back to top |
|
fgorji
Joined: 15 Dec 2015 Posts: 9 Location: Iran
|
Posted: Thu 17 Dec '15 13:02 Post subject: Re: Cnnfiguring Apache2.4.18 to permit Per5.22.0 l CGI |
|
|
Thanks glsmith,
by typing http://localhost/cgi-bin/seminar.cgi,
I get http404 not found. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Thu 17 Dec '15 23:18 Post subject: |
|
|
So what, if anything, did you do to configure Apache for cgi? |
|
Back to top |
|
fgorji
Joined: 15 Dec 2015 Posts: 9 Location: Iran
|
Posted: Fri 18 Dec '15 11:59 Post subject: |
|
|
Thanks for trying to help :
Yes, parts of my httpd.conf now is changed to :
226 <Directory /> 227 Options FollowSymLinks
228 AllowOverride none 229 Require all denied
230 </Drectory />
244 DocumentRoot "c:/Apache24/htdocs"
360 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin">
376 <Directory "c:/Apache24/cgi-bin">
377 AddHandler cgi-script .cgi
378 Options ExecCGI
379 Require all granted
380 </Directory> |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Fri 18 Dec '15 21:25 Post subject: |
|
|
fgorji wrote: | 360 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin"> |
ScriptAlias /URL-Path/ "/File-path/"
The funny thing with Alias and ScrptAlias is they have to have matching / on the trailing end. If the URL-Path has one, the File-path must have one. They will not expand properly if you omit the / on one side and not the other.
Another thing here is the > at the end of the line. You do not need the >.
Try;
ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/" |
|
Back to top |
|
fgorji
Joined: 15 Dec 2015 Posts: 9 Location: Iran
|
Posted: Sat 19 Dec '15 12:46 Post subject: |
|
|
my httpd.conf :
226 <Directory/>
227 Options FollowSymLinks
228 Allowoverride none
229 Require all denied
230 </Directory>
244 DocumentRoot "c:/Apache24/htdocs"
360 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"(as in original httpd.conf)
376 <Directory "c:/Apache24/cgi-bin">
377 AddHandler cgi-script .cgi .pl
378 Options ExecCGI
379 Requireall granted
380 </Directory>
which dosn't work |
|
Back to top |
|
fgorji
Joined: 15 Dec 2015 Posts: 9 Location: Iran
|
Posted: Sat 19 Dec '15 12:50 Post subject: |
|
|
sorry :
379 Require all granted |
|
Back to top |
|
fgorji
Joined: 15 Dec 2015 Posts: 9 Location: Iran
|
Posted: Tue 22 Dec '15 16:17 Post subject: |
|
|
Dear glsmith : Thank you again for trying to help.
My CGI Script works now.
solution :
run the perl program c:/perl64>seminar.pl
then put in c:/apache24/cgi-bin/seminar.pl
http://localhost/cgi-bin/seminar.pl works!
my httpd.conf is as follows :
<Directory/>
options FollowSymLinks
AllowOverride none
Require all granted
</Directory>
ScriptAlias "/cgi-bin/" "c:/Apache24/cgi-bin/" |
|
Back to top |
|
fgorji
Joined: 15 Dec 2015 Posts: 9 Location: Iran
|
Posted: Tue 22 Dec '15 16:21 Post subject: |
|
|
<Directory c:/Apache24/cgi-bin>
Allowoverride None
AddHandler cgi-script .cgi .pl
Options ExecCGI
Require all granted
<Directory> |
|
Back to top |
|
fgorji
Joined: 15 Dec 2015 Posts: 9 Location: Iran
|
Posted: Wed 13 Jan '16 8:00 Post subject: |
|
|
After configuring Apache2.4.18 to permit perl 5.22.0, as above ,would you Please help me to configure Apache to permit PHP scripts ?
Your help is appreciated.
Thank you |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|