473,508 Members | 2,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running cgi (or perl at all) in apache

Kelicula
176 Recognized Expert New Member
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...
Oct 19 '07 #1
2 3347
numberwhun
3,509 Recognized Expert Moderator Specialist
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
Oct 25 '07 #2
Kelicula
176 Recognized Expert New Member
Thanks! I'm running cgi now. I am still having some issues though, I think it is because I have altered my conf file so much, I can't tell what's been altered or not anymore.

I need to unintall, and reinstall, then save a copy of the default conf file somewhere else to be able to go back to it if needed.

Word to wise, save a backup of the conf file!!
Oct 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2853
by: Rolfe | last post by:
Hi, I struggled, and got mod_python running on Apache/Win2k. Follow these instructions verbatim and you shouldn't have any trouble. These instructions are based on...
1
2347
by: David Cantin | last post by:
Hi I have some troubles with a long system() sub-process (from 30 sec to 30 min) called from a CGI. My web page have to wait the end of the system() call before finishing it's loadding but...
6
5360
by: von | last post by:
Is it possible to run a Perl script from within a javascript? I have an existing javascript that provides some data - and I want to write that data to a text file on my server via a Perl script...
3
4109
by: sir.linying | last post by:
My php script is to call perl scipt which makes use of Spreadsheet::ParseExcel module to parse Excel file. I am able to launch php script from command line so that perl script can run and properly...
2
2106
by: carllucas | last post by:
I have no exprience with perl. What I'm trying to do is have a script/program constantly (perpetually) running on my server so that it performs a routine (like every hour) and automatic check of...
1
2302
by: Tension | last post by:
Hi. I have a Perl script that starts a build process (plus a lot of other things). The build process needs a few environment variables set. This is done automatically in a buildEnv.bat script...
1
1832
by: kesava81 | last post by:
Has anyone tried connecting and running queries on Apache Derby using perl? If so, what modules are required? Any help would be greatly appreciated.... Thanks in advance Deekshit
3
1526
by: ogo796 | last post by:
hi everyone i am running ubuntu and all my scripts are in php,i have a program written in C and Perl that do a specic job in my site.so my problem is i can't run that specific program while i...
6
1519
by: rois | last post by:
I have a perl script that runs perfectly when i run from the command prompt. When I execute via apache2 it does NOT run because it cannot locate region.pm which i need for the script. region.pm is...
0
2047
by: somsub | last post by:
Hi All, I am facing a problem while running a perl script through selenium RC server . I recorded oone log in test case with slenium IDE and run it after that with the ide only and it worked...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.