logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Configuring Apache2.4.18 to permit Perl 5.22.0 l CGI

 
Post new topic   Reply to topic    Apache Forum Index -> Other Software



View previous topic :: View next topic  
Author Message
fgorji



Joined: 15 Dec 2015
Posts: 9
Location: Iran

PostPosted: Tue 15 Dec '15 20:36    Post subject: Configuring Apache2.4.18 to permit Perl 5.22.0 l CGI Reply with quote

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: 2123
Location: Sun Diego, USA

PostPosted: Wed 16 Dec '15 19:05    Post subject: Re: Cnnfiguring Apache2.4.18 to permit Per5.22.0 l CGI Reply with quote

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

PostPosted: Thu 17 Dec '15 13:02    Post subject: Re: Cnnfiguring Apache2.4.18 to permit Per5.22.0 l CGI Reply with quote

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: 2123
Location: Sun Diego, USA

PostPosted: Thu 17 Dec '15 23:18    Post subject: Reply with quote

So what, if anything, did you do to configure Apache for cgi?
Back to top
fgorji



Joined: 15 Dec 2015
Posts: 9
Location: Iran

PostPosted: Fri 18 Dec '15 11:59    Post subject: Reply with quote

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: 2123
Location: Sun Diego, USA

PostPosted: Fri 18 Dec '15 21:25    Post subject: Reply with quote

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

PostPosted: Sat 19 Dec '15 12:46    Post subject: Reply with quote

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

PostPosted: Sat 19 Dec '15 12:50    Post subject: Reply with quote

sorry :
379 Require all granted
Back to top
fgorji



Joined: 15 Dec 2015
Posts: 9
Location: Iran

PostPosted: Tue 22 Dec '15 16:17    Post subject: Reply with quote

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

PostPosted: Tue 22 Dec '15 16:21    Post subject: Reply with quote

<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

PostPosted: Wed 13 Jan '16 8:00    Post subject: Reply with quote

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: 6255
Location: Germany, Next to Hamburg

PostPosted: Wed 13 Jan '16 17:58    Post subject: Reply with quote

We have a tutorial for PHP
https://www.apachelounge.com/viewtopic.php?t=2394

if you still have a question please ask again, but open a new topic since this is about Perl.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Other Software
Page 1 of 1