Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: CGI index as text

by tachyon (Chancellor)
on Nov 24, 2004 at 06:40 UTC ( #410063=note: print w/replies, xml ) Need Help??

in reply to CGI index as text

It depends on their Apache setup. If you drop a .htaccess file into your webroot that looks like this:

DirectoryIndex index.cgi AddHandler cgi-script .cgi .pl Options +ExecCGI

Then add an index.cgi that looks like this:

#!/usr/bin/perl print "Content-Type: text/html\n\nHello World!\n";

and finally chmod 755 it....chmod 755 /blah/public_html/index.cgi

You should see the famous phrase if .htaccess of the default Apache httpd.conf directives is allowed. A 500 Internal Server Error or 403 Forbidden also probably indicates it is working but you have a typo or forgot the chmod respectively. If you see your index.htm(l) instead then the .htaccess override of the DirectoryIndex is not working.

You may also like to add:

ErrorLog /some/path/logs/error_log CustomLog /some/path/logs/access_log common

To your .htaccess. This gives you a private set of error logs if you don't already have them. Make sure the path exists though and is writable by Apache. It gets upset if it can't write logs.....



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://410063]
[Corion]: Lo and behold, running a program with the correct input files yields the correct (and expected) output. Yay me.
[1nickt]: Got a MacBook and am expected to develop directly on it, ironic given the recent thread about that.
[marto]: Corion, some not too serious issues with the kids, hopefully, other than that just dealing with commuting by car again in the winter, not much fun so far, and there's no real 'bad' weather yet :)
[marto]: 1nickt, glad to hear it, I'm sure you'll bring improvements to their stack in due course ;)
[1nickt]: Just trying to adjust to a new culture. Better doc than I am used to , but quite a bit more Agiley meta-bullshit; at least half a dozen meetings a week, strict "sprint" schedule etc. I'll adjust. And I hope to just switch off after the "scrum" each day at
[1nickt]: ... the end of the afternoon. marto How are you, snowed in? Mum and Dad expecting snow today in Surrey. (Have 5" on the ground here in NJ. And my son's high school in SOCal closed until after Xmas due to fires.)
[Corion]: 1nickt: In a sense the meta-bullshit might even be beneficial to you as you get to hear the cow-orkers talk (or not talk) about the issues you perceive. I think Agile is mostly about the meta ;)
[Corion]: 1nickt: On Sunday maybe 10cm of snow fell, and the airport closed, and the trains stopped running etc :) It always comes as a surprise that snow falls here during the winter...
[marto]: 1nickt, no snow, just some ice on the roads and the usual idiocy associated with humans and driving in less than ideal conditions

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-12-11 11:48 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (289 votes). Check out past polls.