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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cgi-script woes

Status
Not open for further replies.

optimised

Technical User
Jun 21, 2001
96
0
0
US
Hi folks,

Why can't apache execute cgi-script from subdir of
/home/mydomain/


[error] (2) No such file or directory: exec of /home/mydomain/cgi-bin/test.cgi
[error] Premature end of script headers

//httpd file

ScriptAlias /cgi-bin/ "/home/mydomain/cgi-bin/"

<Directory &quot;/home/mydomain/Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory &quot;/home/mydomain/cgi-bin&quot;>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www
ServerName ScriptAlias /cgi-bin/ &quot;/home/mydomain/cgi-bin/&quot;
ServerSignature email
</VirtualHost>


I am trying to allow vhost it's own cgi-bin
Thks for help..
 
Hello,
Since I cannot resolve the problem of why I can't get cgi-scripts to run from browser, is there any way to test if perl is operating properly?

Thanks....
 
Hi,

Although Perl is normal for CGI scripting you can use other languages - e.g. bash...

This will help you isolate if its a perl problem or a apache problem. Try this bash script :

#!/bin/bash
echo Content-type: text/html
#The following (empty) line is necessary!
echo
echo '<html>'
echo '<body>'
echo 'It is now '
date
echo '</body>'
echo '</html>'

save as bashtst.cgi or something, make executable and try out. I suspect it won't work meaning your apache setup is wrong somehow.

Rgds
 
Hi ifincham,

Got it working..
There was a trailing ^M at the end of line of every line

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top