2

I have done the following checks:

  • shebang line
  • file extension .cgi
  • script is executable
  • restarted apache

I've done the following in my project.conf file on Vagrant under /sites-enabled:

<Directory /var/www/perl_project/cgi-bin>
      Options ExecCGI
      SetHandler cgi-script
</Directory>

I'm pointing to http://project.local/cgi-bin/routes.cgi?page=reports in my links, but they bring up the text of the script and don't run them...

The script isn't displaying any HTML, it is a kind of router where I get query string and based on that load a template toolkit file

could someone please help?

friedo
  • 65,762
  • 16
  • 114
  • 184
a7omiton
  • 1,597
  • 4
  • 34
  • 61
  • 1
    Anything in your apache error log? Does your apache config have `mod_cgi` turned on? – friedo Jul 27 '14 at 01:30
  • @friedo I don't see any errors in my apache error log. where would i turn the mod_cgi module on, or where would i check to see if it is on? I don't see the httpd.conf file in my vagrant box, not sure where it is – a7omiton Jul 27 '14 at 11:28
  • i found this file: 'cgi.load' in the 'mods-available' directory, it isn't commented out, but it also isn't in the mods-enabled directory. Should it be? – a7omiton Jul 27 '14 at 11:31
  • I enabled two modules: cgid and cgi, not sure what to do now :/ – a7omiton Jul 27 '14 at 11:36
  • Any idea where i should be putting the following: ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ ? Sorry this stuff is really baffling me – a7omiton Jul 27 '14 at 11:43
  • Did you try restarting apache after enabling `mod_cgi`? – friedo Jul 27 '14 at 17:14

1 Answers1

0

I placed my cgi scripts under /usr/lib/cgi-bin

After installing the mod_cgi module I noticed a /cgi-bin directory was created under /vagrant, but that didn't work for some reason so I hunted down the former cgi-bin directory.

Hope this helps someone

a7omiton
  • 1,597
  • 4
  • 34
  • 61