Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File not Found or Unable to Stat???

Status
Not open for further replies.

hhope

Technical User
Dec 7, 2001
1
US
I am getting the following error message when I try to run any Perl files through the perl interpreter in my local cgi-bin directory. I am running the Apache 1.3.14 webserver.
[Fri Dec 07 10:03:57 2001] [error] [client 127.0.0.1] (2)No such file or directory: script not found or unable to stat: c:/usr/
For some reason it is not putting the / between the cgi-bin directory and the hello.pl file. This is what is in the hello.pl file
#!usr/ -w
# hello.pl - sends a greeting to the world
#

print "Content-type: text/html\n\n";
print &quot;<HTML>\n&quot;;
print &quot;<HEAD><TITLE>\n&quot;;
print &quot;Hello!\n&quot;;
print &quot;</TITLE></HEAD>\n&quot;;
print &quot;<BODY>\n&quot;;
print &quot;Hello, world!\n&quot;;
print &quot;</BODY></HTML>\n&quot;;

and this is what the cgi part of my httpd.conf says
ScriptAlias /cgi-bin/ &quot;C:/usr/
#

# &quot;C:/Program Files/Apache Group/Apache/cgi-bin&quot; should be changed to whatever your ScriptAliased

# CGI directory exists, if you have that configured.

#

<Directory &quot;C:/usr/
AllowOverride None

Options None

Order allow,deny

Allow from all

</Directory>

What am I doing wrong?

I should add that this code works fine from the command prompt, but does not work in Internet Explorer
 
I'll take a stab at this one and say that you need to add another slash at the end of <Directory &quot;C:/usr/
So it should be:
Code:
# CGI directory exists, if you have that configured. 

# 

<Directory &quot;C:/usr/[URL unfurl="true"]www/cgi-bin/&quot;>[/URL] 

AllowOverride None 

Options None 

Order allow,deny 

Allow from all 

</Directory>

I hope that works for you.
 
Unless I miss my guess, that would be backwards. Try this:

ScriptAlias /cgi-bin/ &quot;C:/usr/
<Directory &quot;C:/usr/ AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

Notice the slash at the end of the ScriptAlias directive and no slash at the end of the container path. If you put a slash and the end of the container path, you will be required to put it in when you call that directory. You can add &quot;options ExecCGI&quot; if ScriptAlias doesn't do the trick or you can also uncomment the &quot;AddHandler .cgi&quot; and edit it to &quot;AddHandler .cgi .pl&quot;. This is just incase apche doesn't understad the .pl extension. The other stuff is just there for looks. :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top