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!

cgi-script problems

Status
Not open for further replies.

vasah20

Programmer
Feb 16, 2001
559
US
Hi -
I'm having some problems with my cgi script. Can you tell me what I'm doing wrong?

script:
#!/usr/bin/perl
print "Content-type: text/plain";
print "test text";

inside httpd.conf:
<IfModule mod_alias.c>

#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So &quot;/icons&quot; isn't aliased in this
# example, only &quot;/icons/&quot;. If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
Alias /icons/ &quot;/usr/local/etc/httpd/apache/icons/&quot;

<Directory &quot;/usr/local/etc/httpd/apache/icons&quot;>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing &quot;/&quot; apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ &quot;/usr/local/etc/httpd/apache/cgi-bin/&quot;

ScriptAliasMatch ^/cgi-bin /home/*/public_html/cgi-bin

#
# &quot;/usr/local/etc/httpd/apache/cgi-bin&quot; should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory &quot;/usr/local/etc/httpd/apache/cgi-bin&quot;>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

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

</IfModule>

Error msg:
500 Internal Server Error
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

tail error_log -n 3:
[Sat Oct 27 00:08:28 2001] [error] [client 127.0.0.1] malformed header from script. Bad header=CGI access is working: /home/leo/public_html/cgi-bin/test.cgi
[Sat Oct 27 00:10:51 2001] [error] [client 127.0.0.1] malformed header from script. Bad header=Content-type=text/plain: /home/leo/public_html/cgi-bin/test.cgi
[Sat Oct 27 00:12:34 2001] [error] [client 127.0.0.1] malformed header from script. Bad header=Content-type=text/plain: /home/leo/public_html/cgi-bin/test.cgi

i'm using Drake 8, and if you can't tell I'm an absolute newbie at apache.
Also, I'm trying to make it so ~user/cgi-bin/ can execute cgi-scripts. I know that I should get a CGI-Wrapper for security reasons, but since the machine isn't live yet it isn't too much of a concern...

TIA leo

------------
Leo Mendoza
lmendoza@students.depaul.edu
 
Forget it... I RFTMed.

Found it in the Apache FAQs (I have no idea why I didn't look there in the first place)
leo

------------
Leo Mendoza
lmendoza@students.depaul.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top