CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [rammohan] How to run cgi script on apache server: Edit Log



FishMonger
Veteran / Moderator

Feb 13, 2014, 7:06 AM


Views: 3026
Re: [rammohan] How to run cgi script on apache server

The config looks good, with 1 exception (approx line 134).

Quote
<Directory "/usr/local/apache2/htdocs">
#
ectory "/usr/local/apache2/htdocs">

That second (incomplete) statement needs to be removed.

Was apache restarted after making the last set of changes to the conf file? If not, you'll need to do a restart to have those changes take affect.

What are the file permissions for the script? Does the web server user have rights to the script?

Reset the permissions:

Quote
chmod 755 /usr/local/apache2/cgi-bin/first.pl


Change your script to this:

Code
#!/usr/bin/perl 

use strict;
use warnings;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);

print header(),
start_html(),
h2('Hello World!'),
end_html;

exit;


If it fails, post the complete error message it returns to the browser.


(This post was edited by FishMonger on Feb 13, 2014, 7:09 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Feb 13, 2014, 7:09 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives