Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: To Run perl through CGI

by sidvanga (Initiate)
on Nov 06, 2015 at 06:09 UTC ( [id://1147066]=note: print w/replies, xml ) Need Help??


in reply to Re: To Run perl through CGI
in thread To Run perl through CGI

I have updated my question can you please help me out.

Replies are listed 'Best First'.
Re^3: To Run perl through CGI
by davebaker (Pilgrim) on Nov 06, 2015 at 18:01 UTC
    Change
    Alias /cgi-bin /var/www/cgi-bin/
    to be
    ScriptAlias /cgi-bin/ /var/www/cgi-bin/
    (note use of ScriptAlias rather than Alias and the new trailing slash in the first string after ScriptAlias)
Re^3: To Run perl through CGI
by tonto (Friar) on Nov 06, 2015 at 23:02 UTC

    Your test script cannot run because it is not a cgi script, so Apache cannot run it. Try this instead:

    #!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; print "<html>"; print "<header><title>Hello</title></header>"; print "<body>"; print "<p>Hello World!</p>\n"; print "</body>"; print "</html>"; 1;

    The next problem is your Apache configuration. What version is Apache? You can find that by typing this into a terminal:

    apachectl -V

    If your Apache is 2.4, you need to add this line to the configuration:

    Require all granted

    That goes at the bottom of your directory configuration. Also make the changes that davebaker and AnonymousMonk have mentioned.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1147066]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2025-07-10 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.