0

I'm trying to run some simple CGI files in my browser. The code is as follows:

#!/usr/bin/perl -wT
use strict;
use warnings; 

print "Content-type: text/html\n\n";
print "HTML, CGI & PERL Programming\n";

I've tried to use both Mozilla Firefox and Google Chrome as the browser. I've installed Apache2. The default page, Localhost works. I've placed the file in var/cgi-bin/ and changed modes with chmod 755.

This code has worked before in a virtualbox Ubuntu 32 bit. Now I'm using Ubuntu 64 bit.

simbabque
  • 53,749
  • 8
  • 73
  • 136
  • Which browser you use is irrelevant. The browser only displays what the web server sends it. Your problem lies on the server side. Is CGI processing enabled for the `var/cgi-bin`? – simbabque Aug 03 '16 at 07:45
  • @Quentin I found http://stackoverflow.com/a/560862/1331451 but didn't like it as a duplicate target too much. – simbabque Aug 03 '16 at 07:46
  • You might want to consider moving away from CGI to [Plack](https://metacpan.org/pod/CGI::Alternatives#PSGI-Plack). – Quentin Aug 03 '16 at 07:46
  • 1
    What does your Apache server log say? – Borodin Aug 03 '16 at 10:49
  • There was nothing in the access log. The error log: [Sat Aug 06 20:21:03.953564 2016] [mpm_event:notice] [pid 1026:tid 140525480413056] AH00489: Apache/2.4.12 (Ubuntu) configured -- resuming normal operations [Sat Aug 06 20:21:03.953580 2016] [core:notice] [pid 1026:tid 140525480413056] AH00094: Command line: '/usr/sbin/apache2' – Zatchooze Naut Aug 06 '16 at 13:28
  • I tried to use CGI again in a 32 bit system and ran into the same problem. I think I may have forgotten how to properly set up apache2. Does anyone know a detailed guide to setting up Apache2? – Zatchooze Naut Aug 06 '16 at 13:32

0 Answers0