473,664 Members | 3,028 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 SymLinksifOwner Match 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.or g/docs/2.2/mod/core.html#optio ns
# 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!:
ScriptInterpret erSource 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 3358
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 SymLinksifOwner Match 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.or g/docs/2.2/mod/core.html#optio ns
# 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!:
ScriptInterpret erSource 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\Apac he2.2\cgi-bin folder. There is already a script in there called printenv.cgi (or .pl).

In your c:\Program Files\Apache Software Foundation\Apac he2.2\conf\http d.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
2866
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 "http://www.modpython.org/live/current/doc-html/inst-testing.html". I've added specific information such as Windows filepaths and filenames so there's no ambiguity on what you should do. I encourage you to copy and paste to avoid typing errors. Cheers, Rolfe
1
2359
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 this is not whats appen. The web page is waiting for a couple of minutes but continue and finish it's loadding before the end of program called by the system() call
6
5366
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 (that I also already have). Both scripts work great - I just don't know how to make them work together. Is this even possible?
3
4123
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 parse Excel file. However, when I put php script on server side and then launch php through client request, perl program can't run. Anyone has any suggestion re how to fix this problem? Thanks a lot, -Ying
2
2122
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 something like the current weather in Tokyo and records it. The catch is that I want this to be done back-end and automatically without someone having to go onto the website and doing a "check" or something. This would mean that the script must be...
1
2313
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 supplied by the build system vendor. My first idea was to write a .bat scrpt that first calls the buildEnv.bat script and then calls the perl script. This does not seem to work since the perl script never executes. The .bat file looks like this: ...
1
1838
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
1534
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 am out site the directory. can someone help me with a php code that can run the program that is out site the current working directory.i use the following code but nothing happend. $output=exec(/home/data/test make.pl ) shell_exec("cd...
6
1525
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 in the same folder as the script. when i remove it it works. It also works when i include "use lib 'script_folder';" ! I believe it has to do with apache and paths. The apache error log gives message "Can't locate region.pm in @INC". I have...
0
2065
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 fine . After I exported that test case as a perl script . I installed all the required modules (like Test::WWW::Selenium,Test::More,Test::Exception)by PPM GUI (As I am using active perl 5.10 on winxp).I run the Selenium Rc server and tried to...
0
8348
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8861
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7375
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5660
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4185
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1759
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.