473,499 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Configuring Apache to see my CGI scripts. Unable to run CGI.

135 New Member
My cgi script is not being seen by Apache. I have no idea what to do,

1) I have read the httpd file in my conf folder and still no luck.

2) I have placed my CGI place in

C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/

still not luck.

My shebang line in my CGI is: #!/usr/bin/perl
Sep 7 '07 #1
12 6163
patelxxx
135 New Member
In the conf folder (httpd) what do i need to delete/change below to run my CGI scripts. I've tried 'Allow from all' however this did not work too.

Currently all my .cgi files are in /Apache2.2/cgi-bin.

The below code taken from httpd doc (in conf folder):

Expand|Select|Wrap|Line Numbers
  1. # "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
  2. # CGI directory exists, if you have that configured.
  3. #
  4. <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
  5.     AllowOverride None
  6.     Options None
  7.     Order allow,deny
  8.     Allow from all
  9. </Directory>
my ScriptAlias is as follows:

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
Sep 9 '07 #2
patelxxx
135 New Member
changed the shebang which actually resolved the issue. Changed the shebang line to point to perl.exe
Sep 12 '07 #3
pbmods
5,821 Recognized Expert Expert
Heya, Patel.

Have a look at this document.
Sep 12 '07 #4
patelxxx
135 New Member
pbmods,

I get the error: HTTP 404 - File not found.

I have followed every thing from the link you gave me, still not sure what the problem is, i think I'm going crazy.

It's 3.25am i think i need to go to bed now.

cheers
Sep 13 '07 #5
patelxxx
135 New Member
pdmos,

1) my initial url is: http://localhost/post.html

i fill out the form (post.html) and click Submit which takes me to:

2) http://localhost/cgi-bin/post2.cgi

It's here on the above URL i get the error 404

Post.html is located in apache2.2/htdoc folder and post2.cgi is location in apache2.2/cgi-bin/post2.cgi

cheers
Sep 13 '07 #6
pbmods
5,821 Recognized Expert Expert
Heya, Patel.

pdmos. That's a good one.

You should have this line somewhere in your httpd.conf file:
Expand|Select|Wrap|Line Numbers
  1. ScriptAlias /cgi-bin/ "/path/to/apache2/cgi-bin/"
  2.  
Sep 13 '07 #7
patelxxx
135 New Member
this is the line i have:

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"


pbmods, i can run .cgi files from this above folder by typing the following in the browser:

http://localhost/cgi-bin/browser.cgi
http://localhost/cgi-bin/hello.cgi

however the problem is when i SENT a form to a .cgi is where i get the 404 error.

cheers mate
Sep 13 '07 #8
pbmods
5,821 Recognized Expert Expert
Heya, Patel.

Post an example of a form tag that doesn't go where it's supposed to on submit.
Sep 13 '07 #9
patelxxx
135 New Member
Hey pbmos,

My post.html FORM tag is as follows:

[HTML]<form action="/cgi-bin/post2.cgi" method="POST">[/HTML]
Sep 13 '07 #10
pbmods
5,821 Recognized Expert Expert
Heya, Patel.

I assume that you do not get a 404 if you navigate to http://localhost/cgi-bin/post2.cgi in your browser....

You didn't mention post2.cgi as one of the scripts that you tested in an earlier post, so I thought I'd just make sure.
Sep 13 '07 #11
patelxxx
135 New Member
pbmods, guess what it's resolved. The problem was very simple, my CGI was named post2.cgi.cgi hence the FORM couldn't find the file.

Thank very much again, now starts my Perl journey.
Sep 14 '07 #12
pbmods
5,821 Recognized Expert Expert
Heya, Patel.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Sep 14 '07 #13

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

Similar topics

3
4800
by: Jeff | last post by:
Could someone walk me step by step on how to install and get JpGraph running on a Windows 2000+Apache+PHP+MySql server? -Thanks Jeff
0
1717
by: Vikram | last post by:
Hello All, Unable to run php files on Linux . php-4.2.2 is preinstalled on RHL 9 .Whenever I run a .php file in the webbrowser(Mozilla) the HTML source code of the file is being displayed...
0
2037
by: Stefan Blobner | last post by:
Hi, I'm searching for someone who's using HP-UX 11.x with Apache and PHP with the OCI8 extension (for accessing Oracle). I'm having some issues while running this and would like to...
1
2850
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...
7
41576
by: Lad | last post by:
How can I set up Apache web server to use Python for CGI processing( for file *.py). Thanks for help Lad
3
12116
by: Sidu | last post by:
Ok well i'm still very new to apache, mysql, and php.. let me explain everything i have set up.. I have installed Appserv, for those of you who are unfamiliar with it.. it installs mysql, php,...
1
1938
by: =?iso-8859-7?B?zd/q7/I=?= | last post by:
Hello iam trying to install php v5.2.1 with apache support so i can run .php scripts ddirectly on my browser instead of command line but when i try to http://localhost/phpinfo.phpi get na...
3
4917
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added <Directory...
10
6931
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
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...
0
7220
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
6893
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
7386
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...
0
5468
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,...
1
4918
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
3098
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
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.