Why doesn´t my perlscript work with apache

I think this is a very basic config-question.
I´m using Apache 1.3 and I want to run a simple perlscript.
I have Options ExecCGI in "access.conf" and the script has 755 rights. When I tries to execute the script I just get the sourcecode.
cl071997Asked:
Who is Participating?
 
tpryorCommented:
I wasnt referring to the script.  Im referring to the config.
you must specify what suffix is to be executed in the config files.

Well if it is in the script alias directory it doesnt matter what the extension is.

Eamples:

1) ScriptAlias:

The ScriptAlias directive has the same behavior as the Alias directive, except that in addition it marks the target directory as containing CGI scripts. URLs with a (%-decoded) path beginning with url-path will be mapped to scripts beginning with directory-filename. Example:
ScriptAlias /cgi-bin/ /web/cgi-bin/A request for
http://myserver/cgi-bin/foo would cause the server to run the script /web/cgi-bin/foo.

2) Extensions, .cgi .pl etc
How do I enable CGI execution in directories other than the ScriptAlias?
  Apache recognizes all files in a directory named as a ScriptAlias as being eligible for execution rather than processing as normal documents. This applies regardless of the file name, so scripts in a ScriptAlias directory don't need to be named "*.cgi" or "*.pl" or whatever. In other words, all files in a ScriptAlias directory are scripts, as far as Apache is concerned. To persuade Apache to execute scripts in other
locations, such as in directories where normal documents may also live, you must tell it how to recognize them - and also that it's okay to execute them. For this, you need to use something like the AddHandler directive. In an appropriate section of your server configuration files, add a line such as AddHandler cgi-script .cgi The server will then recognize that all files in that location (and its logical descendants) that end in ".cgi" are script files, not documents.

##########################################################

Check out "http://www.apache.org/docs/misc/FAQ.html"
for more info

GL
t
0
 
tpryorCommented:
make sure the suffix is recognized as a cgi example .cgi or .pl
0
 
scrytchCommented:
Is the script in a ScriptAlias dir or end with the proper extension? (usually .cgi, set from AddHandler cgi-script .cgi)
Those should be sitting in srm.conf, and are commented out by default.
0
 
cl071997Author Commented:
ScriptAlias was commented out, but now it´s not, but still it don´t work. (I have rebooted). The perlscript has the extension .cgi. It´s a very simple script taken from a book, so we can sxclude the script (I think). As I said - I get the whole sourcecode instead of a executed script.

/Claes
Sweden
0
 
cl071997Author Commented:
Thank you. I noticed that I made misstake when I commented out the lines about ScriptAlias. Another # was removed to in front of an ordinary textline, so the web server didn´t start. I accessed the htnml file by "open file" and tried to execute the script that way.
Well, now it works.

Thanks again

/claes
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.