Forum Moderators: phranque
The code is as under:
#!/usr/bin/perl
use strict;
use CGI::Carp qw(fatalsToBrowser);
print "Content-type: text/html\n\n";
print "<html><head><title>This is a URL test</title></head>";
print "<body>This is a URL test</body></html>";
exit 1;
I tried the this cgi on my server's cgi-bin and it worked but if I use it in the cgi-bin of Virtual site it didn't works
e.g.
1. [my.ip.address...] (Works)
2. [mysites.com...] (Same error Premature end of script headers: test.cgi)
I think it is some sort of Apache Configuration issue but I don't know how to solve it
Any suggestions
Below is the httpd.conf section of one of the virtual sites
Please note that
1. cgis are not running on any of the virtual sites
2. The hashed code that you see below is because I tried this with and without hashing this code.
<VirtualHost my.ip.address:80>
SuexecUserGroup "#501" "#501"
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /home/mysite/public_html
ErrorLog /home/mysite/logs/error_log
CustomLog /home/mysite/logs/access_log common
ScriptAlias /cgi-bin/ "/home/mysite/cgi-bin/"
<Directory /home/mysite/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
</Directory>
#<Directory "/home/mysite/cgi-bin/">
#SetHandler cgi-script
#Options ExecCGI
#AllowOverride None
# Options None
# Order allow,deny
# Allow from all
#</Directory>
</VirtualHost>