Quote:
Originally Posted by Kelicula
I have installed Activestate perl with Apache 2.2 and I can't get perl written cgi scripts to run.
I have changed the conf file to this
<Directory "htdocs/cgi-bin">
SetHandler cgi-script
Options ExecCGI
</Directory>
And I have:
<IfModule dir_module>
DirectoryIndex index.html index.shtml index.cgi
</IfModule>
And:
<Directory "htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks ExecCGI Includes
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
As well as:
LoadModule cgi_module modules/mod_cgi.so
And:
AddHandler cgi-script .cgi
AddHandler server-parsed .html
AND!:
ScriptInterpreterSource registry
I have set my file types to open the command line interpreter for the "open" action of files with .cgi
And I can't get cgi scripts to function properly on my Windows XP SP2 box.
Anyone been through this??
Help!!
:)
When I try to open a page that has perl it just says waiting for localhost...
In my status bar, all other pages work. Even SSI enabled...
Kelicula,
I have Active State and Apache installed on my windows machine, and if I remember right, it was already configured by default for CGI (using Perl scripts).
First, your scripts (cgi) would need to be placed into your c:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin folder. There is already a script in there called printenv.cgi (or .pl).
In your c:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf file, you will need to change the following. There is a section that talks about the shebang line in the Perl scripts. You will need to change what ever is there to be "#!c:/perl/bin" as that is where ActiveState installed to. Once you do that, save it.
That shebang line is what you should put at the top of your perl cgi scripts. If it is not there, then the script will not run and you will probably get something like a 503 error. Also, the script (printenv.cgi) will probably not have the correct shebang line so change it and save it.
In the conf file by the way, you will also want to make sure you have ServerName set to "www.localhost.com:80", unless you are hosting for yourself.
Once you do that, it should be fine.
Also, for your reference, you can read
this link.
Regards,
Jeff