Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

configuring apache to automatically send Content-Type header and exec as CGI based on file extension

by princepawn (Parson)
on Nov 03, 2001 at 14:04 UTC ( #123031=perlquestion: print w/replies, xml ) Need Help??

princepawn has asked for the wisdom of the Perl Monks concerning the following question:

I would label this off-topic, but given the large number upvotes I have received recently, it is only fitting that I catch a couple of right hooks to the jaw to spice things up.

Anyway, how do I set up Apache so that it executes files with a .sgi extension as CGI scripts and so that Apache automatically sends the Content-type: text/html header?

Edit: chipmunk 2001-11-03

  • Comment on configuring apache to automatically send Content-Type header and exec as CGI based on file extension
  • Select or Download Code

Replies are listed 'Best First'.
Re: configuring apache to automatically send Content-Type header and exec as CGI based on file extension
by blakem (Monsignor) on Nov 03, 2001 at 14:08 UTC
    (assuming you meant '.cgi' not '.sgi')

    In your httpd.conf:

    AddHandler cgi-script .cgi AddType text/html .cgi DefaultType text/html

    -Blake

(jeffa) Re: configuring apache to automatically send Content-Type header and exec as CGI based on file extension
by jeffa (Bishop) on Nov 03, 2001 at 21:20 UTC
    Slightly OT, i just wanted to add the fun to be had with 'CGI extensions': I used the second one to allow IE users to get their database results in the form of an Excel Spreadsheet. By configuring Apache to accept .xls as a CGI script (in one particular directory), the not-so-skilled users could save the file without having to change the name of the file from say, foo.cgi to foo.xls - which would have confused them.

    The first one can be called just like a regular image: <img src="foo.png">. Fun stuff!

    jeffa

Re: configuring apache to automatically send Content-Type header and exec as CGI based on file extension
by Zecho (Hermit) on Nov 03, 2001 at 18:12 UTC
    Look for commonhttpd.conf first. Some versions use that file instead.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://123031]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2021-01-17 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?