CGI Problems

  • Onson
  • Born
  • Born
  • Onson
  • Posts: 4
  • Loc: http://home.earthlink.net/~glenn61/index.html

Post 3+ Months Ago

Not a guru here, but I'm trying to run my own server. I downloaded the INDIGOPERL package that sets up the APACHE server. The install went fine and a little web site I've set up on my computer can be accessed via a password page I set up on the Internet. That part looks good.

The part where my ignorance catches up with me, and no amount of reading tutorials seems to help, is getting scripts to work. I know I have some good scripts, including a very simple "hello world" I wrote myself, but what do I do with them? I'm having a mental block on something everyone assures me is very simple.

I've tried linking to the scripts from a page, placing the script on a page, etc.

Let's say I have a HELLO.PL. What do I do with this so someone can come to my computer (site) and see that page?

I've been struggling with this for months and am feeling like a real bonehead..
  • harryhood
  • Graduate
  • Graduate
  • harryhood
  • Posts: 141

Post 3+ Months Ago

Are you getting any error messages now when accessing the script? What have you tried so far. I assume that you have placed the script somewhere within the apache document root directory and tried accessing the script file from a web browser.

The first thing that comes to mind is making sure that your apache installation reconizes files with a .pl extension as an executable cgi, and that the files permissions are set to executable.
  • Onson
  • Born
  • Born
  • Onson
  • Posts: 4
  • Loc: http://home.earthlink.net/~glenn61/index.html

Post 3+ Months Ago

Thanks very much for your reply, Harryhood. I've been traveling, so I'm afraid my acknowledgment is quite late.

You asked a couple of questions that illustrate my own problem, which is that I don't have the foggiest idea on HOW TO ACCESS scripts. I have put a link to the .PL page in an HTML web page. There was some kind of error, but I would have to do that again to tell you just what.

INDIGOPERL is a package that sets up APACHE, PERL, PHP, and I don't remember what else, right during setup. It is supposed to be the cure for people as ignorant as myself, in that it is supposed to work from the get-go.

I understand where I have to put my script/pages to access them, and I access my HTML web pages just fine, but I haven't a clue as to accessing PHP, scripts, etc.

Something that is very obvious is sailing completely over my head, I believe.
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

First off, open your httpd.conf file (it resides in your apache/conf folder) and make sure the following lines exists there:

Code: [ Select ]
LoadModule php4_module c:/php/php4apache2.dll
AddType application/x-httpd-php .php

ScriptAlias /cgi-bin/ "C:/path/to/cgi-bin/"

<Directory "C:/path/to/cgi-bin">
  AllowOverride None
  Options +Includes
  Order allow,deny
  Allow from all
</Directory>
  1. LoadModule php4_module c:/php/php4apache2.dll
  2. AddType application/x-httpd-php .php
  3. ScriptAlias /cgi-bin/ "C:/path/to/cgi-bin/"
  4. <Directory "C:/path/to/cgi-bin">
  5.   AllowOverride None
  6.   Options +Includes
  7.   Order allow,deny
  8.   Allow from all
  9. </Directory>

Make sure your scripts are in whatever you set C:/path/to/cgi-bin to above. If you're not on a windows machine (which it sounds like you are) you'll need to chmod the script executables (the files that get run) to 755. On *nix, you can just do: chmod 755 scriptname.pl.

If you want to be able to execute scripts outside of your cgi-bin, uncomment or add the line
AddHandler cgi-script .cgi
and look for an entry like
Code: [ Select ]
<Directory />
  Options FollowSymLinks +Includes
  AllowOverride None
</Directory>
  1. <Directory />
  2.   Options FollowSymLinks +Includes
  3.   AllowOverride None
  4. </Directory>

and change it to
Code: [ Select ]
<Directory />
  Options FollowSymLinks +Includes ExecCGI
  AllowOverride None
</Directory>
  1. <Directory />
  2.   Options FollowSymLinks +Includes ExecCGI
  3.   AllowOverride None
  4. </Directory>


While you're in your httpd.conf file (in notepad), click Edit>Find and type in ErrorLog and take note of where that's pointing. That file will become invaluable as you start to troubleshoot scripts (like now).

If the entries are in your httpd.conf file, or you still have problems after making the changes/additions and restarting apache, look in that error log for clues.
  • Onson
  • Born
  • Born
  • Onson
  • Posts: 4
  • Loc: http://home.earthlink.net/~glenn61/index.html

Post 3+ Months Ago

Ahhh, many, many thanks. This looks like something I can work with and have printed it out. If I'm finally successful, it will be drinks on the house! I'll be back in a few days with the results when I've time to get to it.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 39 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.