Solved

cgi script issue

Posted on 2013-06-14
12
715 Views
Last Modified: 2013-12-25
I've installed perl on WampServer, and I'm trying to load a page on my virtual server.  I get the error in the screenshot.  However, the file which is "not found" is present in the cgi-bin folder. file not found
The html page which is attempting to execute the cgi file is in a folder which also contains the cgi-bin folder.  In the file, httpd.conf, there are several references to the path to my html files, and to the cgi-bin folder.  I have written these paths like V:/Web Files/cgi-bin... etc.   Perhaps I need instruction on the syntax for writing to this file?
0
Comment
Question by:ddantes
  • 6
  • 6
12 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Did you read the entire page that I linked for you?  That was specifically for WAMP.  http://chromicdesign.com/2009/05/setting-up-perl-for-wampp.html
0
 

Author Comment

by:ddantes
Comment Utility
Yes, I followed those steps, except for configuring a MySQL database.   Files with .pl extension now have an icon.   This seems to be a path-to-cgi-bin issue.  I've moved that cgi-bin folder around several times, and changed the ScriptAlias path in httpd.conf several times.  Either the script "can't be found on this server" or there is an internal server error.  If the latter is the case, the Apache error log says "the system couldn't find the path specified."
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
The ScriptAlias must match the <Directory "cgi-bin" and the 'LoadModule cgi...' must be uncommented / enabled.  And Apache must be restarted whenever you make any change to 'httpd.conf'.
0
 

Author Comment

by:ddantes
Comment Utility
Would you mind looking at these?  I must be overlooking something, but I don't know what.
I have been restarting WampServer whenever I change the conf file.

It seems that the error log is referring to a path for the cgi-bin directory which I tried earlier,  but since then I changed the path in the conf file and restarted Apache.



booking-data.html
Apache-error-log.txt[
embed=file 660260]
httpd.txt.txt
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 250 total points
Comment Utility
In httpd.conf...

<Directory "C:/Program Files/Web Publish/Maui Site 1>  no end quote, syntax error.  In addition, if you are going to be hosted on Linux, you should remove all of those spaces.  I would do it anyway to avoid certain kinds of syntax problems.

<Directory "C:/Program Files/Web Publish/Maui Site 1/cgi-bin"> should be <Directory "cgi-bin">

Why isn't your web root Directory in C:/wamp/www ?
0
 

Author Comment

by:ddantes
Comment Utility
Thank you.  So, in httpd.conf, I corrected the syntax error.  I didn't eliminate white space (yet) because the virtual server finds my web files without any difficulty, using that pathway with the spaces.  I changed the ScriptAlias directory to "cgi-bin".   I still get "file not found" when I try to execute the script.

I changed the default path to my web root directory because my web files are on a drive separate from the system drive, at least on my server.  On this laptop, I use a copy of those files, on the system drive, because WampServer apparently can't connect to a networked drive.

I'm still confused about the syntax for ScriptAlias.  Now I'm trying:
<Directory ScriptAlias C:/Program Files/web Publish/Maui Site 1/cgi-bin/ "cgi-bin"/>
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Apache will refuse to connect to a non-local drive because it does not have permission to do so.
0
 

Author Comment

by:ddantes
Comment Utility
It's working now.  Thanks for your patience.
0
 

Author Comment

by:ddantes
Comment Utility
One last question, if I may?  It looks like I must have a copy of all the cgi scripts in the apache subfolder of WampServer, or I get an internal server error.  Is that normal?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Are you talking about your web root, "C:\wamp\www"?  That's where Apache has permission to run.
0
 

Author Comment

by:ddantes
Comment Utility
Thank you.  It's good to have this running.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
You're welcome, glad to help.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now