Mailing List Archive

Support open source code!


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

apache configurations



Why so?  Apache just parrots, as a plain text, the whole content of my Perl CGI script "hello.cgi" when /home/tom/hello.cgi is put in.  It seems that perl doesn't work when the script is called through a browser.  And apache displays Not Found when http://127.0.0.1/home/tom/hello.cgi is put in.  What's wrong?  Slackware 3.6 of Linux 2.0.35, Apache 1.3.3, Netscape 4.07 is used.  My Linux machine is standalone with a loopback network for the sake of testing.  I'm simply hoping to see the message "Hello, World!" on the html browser.  What is needed for me to do?  Please give me an answer or any suggestion, help!
 
--- hello.cgi -------------------------------------
#!/usr/bin/perl
 
print "Content-type: text/html","\n\n";
print "
    <html>
        <body>
            Hello, World!
        </body>
    </html>
";
===============================================
 
Running this executable shows well .  Apache configurations are set as shown briefly in the following:
 
--- httpd.conf -----------------------------------
ServerType standalone
Port 80
 
--- access.conf ----------------------------------
<Directory />
Options FollowSymLinks ExecCGI
AllowOverride All
</Directory>
 
<Directory /home/*>
Options FollowSymLinks ExecCGI
AllowOverride All
</Directory>
 
<Directory "/var/lib/apache/share/cgi-bin">
AllowOverride All
Options All
</ Directory>
 
--- srm.conf -------------------------------------
ScriptAlias /cggi-bin/ "/var/lib/apache/share/cgi/bin/"
AddHandler cgi-script .cgi
 
--- .htaccess ------------------------------------
AddType application/x-httpd-cgi .cgi
AddType application/x-httpd-cgi .cgi/
 
================================================
 
Then I executed "/var/lib/apache/sbin/apachectl restart".
 
Then Netscape corresponded to http://127.0.0.1/ properly.
 
Now to see an html sample "/home/tom/abc",
 
--- abc -----------------------------------------
Content-type: text/html
 
<html>
    <body>
        Hello, World!
    </body>
</html>
================================================ 
 
The browser returns this.  How come Content-type appears explicitly?
 
--- a result --------------------------------------
Content-type: text/html Hello, World!
 
================================================
 
 
Regards,
Hoshino
 
 
 
 

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links