Mailing List Archive

Support open source code!


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

apache configurations



>>>>> "Hatsuhiro," == Hatsuhiro, Inc <hatuhiro@example.com> writes:

    Hatsuhiro> Why so?  Apache just parrots, as a plain text, the
    Hatsuhiro> whole content of my Perl CGI script "hello.cgi" when
    Hatsuhiro> /home/tom/hello.cgi is put in.  It seems that perl
    Hatsuhiro> doesn't work when the script is called through a
    Hatsuhiro> browser.  And apache displays Not Found when
    Hatsuhiro> http://127.0.0.1/home/tom/hello.cgi is put in.

Yikes, we do have a bit of studying to do.

(0) The file URL (/home/tom/hello.cgi) is not served by Apache; it is
read directly as text/* by the browser.  When the browser tries to
resolve it as something it knows about, it can't, so it just displays
it as text.  Browsers don't know anything about CGI or Perl, only
Java(script)?, so that's why.

(1) For administration and security reasons, webservers expect to
serve documents out of their own "home directory".  This is called
DocumentRoot in the server conf file.  It's not in there...

(2) There is one outlet; that is to give users their own way of
publishing.  Again for admin and security reasons, this is done by
allowing the user to have a specific directory, usually
$HOME/public_html.  It's not in there, so "Not Found" is correct.

(3) You need to enable CGI in the server conf.

(4) You need to tell the server which files are CGI; the .cgi
extension is not automatically recognized (although I believe it's
configured that way by default, or at least as an example in a
comment).  This is a separate operation from (3).

-- 
University of Tsukuba                Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences       Tel/fax: +81 (298) 53-5091
_________________  _________________  _________________  _________________
What are those straight lines for?  "XEmacs rules."


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links