Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

apache with cgi



> I was asked by a high power to create an interactive web site for
> our computer lab. Unfortuanlly have zero web experience.
> [...]
> Suggestions on how to fix these errors? 

My first suggestion would be to save yourself and your employer a lot of
grief and find someone with apache/cgi experience to do it for you.  You're
at Northeastern, it looks like -- I'll bet there are a variety of students
with the requisite experience.  You may even be able to work out an
arrangement with whatever NEU has for a information technology department.

With that out of the way...

A default apache installation goes in /usr/local/apache, and everything
from this point down assumes that location.  If you've got apache installed
elsewhere, substitute accordingly.

A stock apache install defines /usr/local/apache/cgi-bin as your cgi
directory.  Anything executable in this directory can be access via the URL
<http://your.server.edu/cgi-bin/script>.

The relevant configuration directives look something like this:

  ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
  <Directory "/usr/local/apache/cgi-bin">
      AllowOverride None
      Options None
      Order allow,deny
      Allow from all
  </Directory>

A CGI script must produce the correct output.  In general, this means a
content-type header (and a blank line) followed by your content.  A really
simple perl script might look something like this:

  #!/usr/bin/perl

  print "Content-type: text/html\n\n";

  print "<h1>Hello, world!</h1>\n";

If your script fails to output a content-type header you will see an error.

> for URL. I looked on the net and i get the impression that, you need
> to have a cgi dirctory in the access.conf file (oh yeah, and i'm

Gah, upgrade your web server!  If your configuration still has a seperate
'access.conf' file there's an excellent chance that (a) it's really out of
date and (b) probably has some significant bugs in it.

Recent apaches use a single config file (httpd.conf) for all configuration
options.

Given that you appear to be running something other than a recent apache,
the above instructions are of questionable use; they presume that you've
got your configuration set up correctly.

-- Lars

-- 
Lars Kellogg-Stedman <lars at larsshack.org> --> http://www.larsshack.org/

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org