PDA

View Full Version : cgi search on local webserver


tshelby
01-22-2007, 11:45 PM
Hello,

I am trying to have a basic search on my local webserver. I just want to be able to search docs/files on my local server from an html page (i.e. a search.cgi from a get/post form search button).

I am running win server 2k3, I have installed activeperl, and set just about all web extensions to allow in IIS 6.0...however I keep getting 404 errors.

Been doing my best to follow install guides, but is there anyone out there who can either assist my efforts or point me to a step by step guide?

Thank you!

KevinADC
01-23-2007, 12:19 AM
maybe you are trying to display files in the browser that are outside of the www root folder?

tshelby
01-23-2007, 01:09 AM
hmmm. the search.cgi file is in my wwwroot directory, but the perl.exe is not. Is that what you mean?

Unfortunately I have 2 strikes against me.

1. I am a front-end developer and have very limited scripting and backend administration/configuration experience.

2. I did not set-up the server...just trying to add a cgi/perl feature to it.

The guy who set it up, has the webdirectory on a wwwroot file on drive D. The perl .exe is on drive C. I am using this in my cgi file "#!C:\perl\bin\perl.exe"

I might be beyond help! :confused:

KevinADC
01-23-2007, 01:20 AM
I think I misunderstood your question. Are you getting a 404 error just trying to acccess the search.cgi script on your local server? First, the server must be running, I don't know how you do that with the IIS server but if it needs to be started then make sure it's running. Then open a browser window and in the address box type:

localhost/search.cgi

hit enter or click go or whatever your browser has to send the request to the server.

david_kw
01-23-2007, 01:21 AM
An error 404 suggests that the webserver couldn't find the url at all (not that it wasn't allowed to run the script). I'd try putting test.html in the same directory and see if it is accessible.

http://www.site.com/test.html

then try

http://www.site.com/search.cgi

If you get 404 for one and not the other then I'm afraid your problem is beyond me. :)

david_kw

david_kw
01-23-2007, 01:25 AM
Oh, one other thing that shouldn't effect this problem but could be one at some point. On my PC with IIS and Active Perl the default (I think) was that scripts are use PL as the extension so its test.pl not test.cgi. If I put a test.cgi file it will just return the text in the file not actually run the script.

Good luck.

david_kw

tshelby
01-23-2007, 01:29 AM
exactly. 404 comes up for only the search.cgi

david_kw
01-23-2007, 02:00 AM
I don't know what could cause that. I'm not aware of any way to hide certain file types.

You might want to look in directory

c:\windows\system32\logfiles

In there I have a directory called w2svc1 which has all my logs ordered by date and sometimes gives information on what is really happening behind the scenes. I think I'm using IIS 5.1 though so it might be different.

david_kw

KevinADC
01-23-2007, 03:08 AM
what address do you enter in the browser to start the search.cgi script?

tshelby
01-23-2007, 10:06 PM
domain_name/cgi-bin/search.cgi is in the url

KevinADC
01-23-2007, 10:57 PM
are you using the correct name and CaSe of the script name if it is other than search.cgi, like Search.CGI?

tshelby
01-24-2007, 12:27 AM
search.cgi all lowercase. I doublechecked the filename as well.

I gaurantee it is a permission or cgi redirection issue. Again, I have no experience doing this, and I installed the activeperl myself. The files all reside on drive D. perl is on drive C.

Something is screwy on how I have it all connected.

Thank you all for giving me your time so far.

david_kw
01-24-2007, 12:35 AM
In my experience (limited I admit) the ONLY time I get a 404 error is when the webserver can't find it. I get different errors for permissions or cgi issues. Of course there are still many reasons that could cause the webserver to not find it. The trap I often fall in to is forgetting to make a new virtual directory. Of course, in that case the

domain_site/cgi-bin/test.html

file wouldn't have loaded either. Were you able to find the log files and see what the server claimed the error was?

david_kw