APACHE: using CGI scripts ?

APACHE: using CGI scripts ?

Post by David Haubensa » Fri, 26 Jan 1996 04:00:00



Hi,

I have problems using CGI scripts on APACHE 1.0.0, under SOlaris 2.4.
I installed Apache just like it was proposed in /usr/local/etc/httpd.
I add the line:
AddType application/x-httpd-cgi .cgi
in srm.conf, copy /cgi-bin/calendar in /cgi-bin/calendar.cgi
and then include
<!--#exec cgi="/cgi-bin/calendar.cgi"--> in my index.html file.
But the server does not interpret this command, and my
browser just receive the exec tag!
Did I forget something ?
Server is run as root. /cgi-bin is owned by root, but index.html is
owned by a user....

David.
+------------------------------------------+

| CEA/Cadarache, DER/SSAE/LSMI, bat 205    |
| 13108 St-Paul-Lez-Durance, FRANCE        |
| tel: (+33) 42254292  fax: (+33) 42252780 |
+------------------------------------------+

 
 
 

APACHE: using CGI scripts ?

Post by Nathan J. Kur » Sat, 27 Jan 1996 04:00:00



>I have problems using CGI scripts on APACHE 1.0.0, under SOlaris 2.4.
>I installed Apache just like it was proposed in /usr/local/etc/httpd.
>I add the line:
>AddType application/x-httpd-cgi .cgi
>in srm.conf, copy /cgi-bin/calendar in /cgi-bin/calendar.cgi
>and then include
><!--#exec cgi="/cgi-bin/calendar.cgi"--> in my index.html file.
>But the server does not interpret this command, and my
>browser just receive the exec tag!
>Did I forget something ?

Hmm, I think that you are a little confused about the way Apache handles CGI
scripts and server parsed documents.  

If your CGI scripts are kept in /cgi-bin, there is no need to tack on the .cgi
ending.  The 'AddType application/x-httpd-cgi .cgi' is what you would use if
you want CGI scripts to reside in directories other than /cgi-bin, alongside
html files.  It doesn't hurt to have the .cgi AddType, but it does mean that
if others are putting files on your server, they can also use CGI scripts.

What you really need to do is to add a type that will be defined as server
parsed HTML: 'AddType text/x-server-parsed-html .shtml'.  The line should be
there in srm.conf, but commented out.  Just remove the '#' from the front of
the line.

Then, name your 'index.html' file 'index.shtml', and all should be well.  If
you don't have much load on your server, you could define all .html files to be
x-server-parsed-html, but this increases the load on your server since every
html page serverd must be parsed, whether or not it uses includes.

Hope this helps,


http://www.tripod.com

 
 
 

APACHE: using CGI scripts ?

Post by Rob Hartil » Mon, 29 Jan 1996 04:00:00


Server Side includes don't work...

   :          :           :            :

Quote:> directive I had.  Does anyone know what is happening?  What other settings
> (something in access.conf?) can affect whether server-side-includes
> are allowed?

in access.conf

add "Includes" to the relevant "Options" line(s)

 
 
 

APACHE: using CGI scripts ?

Post by David Chowell » Tue, 30 Jan 1996 04:00:00




>What you really need to do is to add a type that will be defined as server
>parsed HTML: 'AddType text/x-server-parsed-html .shtml'.  The line should be
>there in srm.conf, but commented out.  Just remove the '#' from the front of
>the line.

>Then, name your 'index.html' file 'index.shtml', and all should be well.  If
>you don't have much load on your server, you could define all .html files to be
>x-server-parsed-html, but this increases the load on your server since every
>html page serverd must be parsed, whether or not it uses includes.

>Hope this helps,


>http://www.tripod.com

I have a related question.  I'm running Apache 1.0, but cannot seem to
get server-side includes working.  The documentation at www.apache.org
says that the include module is compiled by default, and I double-checked
the Configuration file in the src/ directory to make sure.  I then uncommented
the 'AddType text/x-server-parsed-html .shtml' in srm.conf and renamed my
home page to index.shtml.  When I go to my homepage, I get the text source
of the home page!

I then renamed the home page to index.html, and tried to turn on XBitHack
in access.conf:

XBitHack Full

and changed the permissions on index.html to:
-rwxr-xr-x   1 davec    adm         6635 Jan 27 22:29 index.html

This resulted in the server totally ignoring the

<!--#include file="blah.html"-->

directive I had.  Does anyone know what is happening?  What other settings
(something in access.conf?) can affect whether server-side-includes
are allowed?
--
David Choweller (Office Hrs: W 3-4,F 3-4)

Home page: http://olympia.ucr.edu/davec
Phone: 787-2961 (Bourns A-212), 787-2994 (Bourns B-242)

 
 
 

APACHE: using CGI scripts ?

Post by Andy Rabaglia » Wed, 31 Jan 1996 04:00:00


[ about making his index page server-side included ]

That is what we all want, but we don't want to parse
every file, which seems like the alternative.

I found, on httpd, that this worked :-

AddType text/x-server-parsed-html .stml
AddType text/x-server-parsed-html .stm
AddType text/x-server-parsed-html index.html

Which special-cased a file called (ending in) index.html.

Cheers,    Andy!

--

http://altavista.digital.com/cgi-bin/query?pg=q&q=Rabagliati

 
 
 

APACHE: using CGI scripts ?

Post by Randy Terbu » Fri, 02 Feb 1996 04:00:00



> [ about making his index page server-side included ]

Or better yet, (with Apache) set 'Options XBitHack On' and
set the owner execute bit in the file modes for the files
you want to parse.

Buyer beware: don't do this for binary data!

-Randy Terbush
http://www.zyzzyva.com/

 
 
 

1. Using .cgi/.pl to enable CGI script in Apache

I am trying to run CGI scripts local to the companion HTML documents
using the Apache server and Linux. According to the manual if I add the
lines:

AddType application/x-httpd-cgi cgi pl
AddType application/x-httpd-cgi .cgi .pl
 (yeah - I wasn't sure whether or not to include the "." so I tried it
  both ways)

to the srm.conf and restart the server, that should do it.

Not true.

I get:
***********************************************************************
        Forbidden

You don't have permission to access /chamFarm/CFemail.pl on this server.
***********************************************************************

(where CFemail.pl is the script in the HTML home directory "chamFarm"
- as expected)

 the script has 777 permissions just to enable all possible
permissions.

If I take the lines out of the srm.conf file and restart the server, I
get:

***********************************************************************
Method not implemented

POST to /chamFarm/CFemail.pl not supported.
***********************************************************************
 which, I guess, is the sort of error you might expect.

So I don't see the problem. This should be very straightforward. Does
anyone have any ideas?

        Thanks for your time,
                Gary Whitten

2. Mounting ram disk images

3. Redirect cgi (perl) scripts using Apache 0.8.14

4. opti931 sound card

5. using cgi scripts on an apache proxy server

6. help ! sound is acting weird on my computer.

7. apache: CGI-scripts using PATH_TRANSLATED, .htaccess

8. Reading the process table?

9. Trouble w/CGI Scripts & Virtual Server Using Apache

10. CGI-BIN Perl Script Not Routed Back to Browser using Apache

11. apache: give /home/mailman/cgi-bin permissions to run cgi-scripts.

12. apache: cgi script not in cgi-bin

13. Help: Apache: cgi script - malformed header from script