sofronisco
05-10-2005, 01:30 PM
Hi.
I try to use my perl scripts in my domain from my subdomains with symbolic links, but I observe that perl scripts accessed as web pages as symbolic links don't work, although they work if being hard links.
For a test I prepared a simple test "test1.pl" in my cgi-bin directory, producing html text to test all this stuff:
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print <<EOM;
<HTML>
<HEAD><TITLE>This is a test</TITLE></HEAD>
<BODY>
<H1>This is big text.</H1>
<PRE>
This is some other text.
</PRE>
</BODY>
</HTML>
EOM
exit;
On a telnet session, on my domain cgi-bin directory, I prepare the soft and hard links:
$ ln -s test1.pl test1_softlink.pl
$ ln test1.pl test1_hardlink.pl
$ ll test1*
-rwxr-xr-x 2 xx xx 222 May 10 11:47 test1_hardlink.pl
-rwxr-xr-x 2 xx xx 222 May 10 11:47 test1.pl
lrwxrwxrwx 1 xx xx 8 May 10 12:08 test1_softlink.pl -> test1.pl
Executing ./test1.pl, ./test1_hardlink.pl and ./test1_softlink.pl (on a telnet session) you see text and html formatting text. The three work.
But reading as a html page:
http://mydomain.com/cgi-bin/test1.pl: works.
http://mydomain.com/cgi-bin/test1_hardlink.pl: works.
http://mydomain.com/cgi-bin/test1_softlink.pl: DOES NOT WORK (appears as page not found with error 500, and on the error.log Premature end of script headers").
Why does this happen? Why Apache doesn't like this?
I try to use my perl scripts in my domain from my subdomains with symbolic links, but I observe that perl scripts accessed as web pages as symbolic links don't work, although they work if being hard links.
For a test I prepared a simple test "test1.pl" in my cgi-bin directory, producing html text to test all this stuff:
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print <<EOM;
<HTML>
<HEAD><TITLE>This is a test</TITLE></HEAD>
<BODY>
<H1>This is big text.</H1>
<PRE>
This is some other text.
</PRE>
</BODY>
</HTML>
EOM
exit;
On a telnet session, on my domain cgi-bin directory, I prepare the soft and hard links:
$ ln -s test1.pl test1_softlink.pl
$ ln test1.pl test1_hardlink.pl
$ ll test1*
-rwxr-xr-x 2 xx xx 222 May 10 11:47 test1_hardlink.pl
-rwxr-xr-x 2 xx xx 222 May 10 11:47 test1.pl
lrwxrwxrwx 1 xx xx 8 May 10 12:08 test1_softlink.pl -> test1.pl
Executing ./test1.pl, ./test1_hardlink.pl and ./test1_softlink.pl (on a telnet session) you see text and html formatting text. The three work.
But reading as a html page:
http://mydomain.com/cgi-bin/test1.pl: works.
http://mydomain.com/cgi-bin/test1_hardlink.pl: works.
http://mydomain.com/cgi-bin/test1_softlink.pl: DOES NOT WORK (appears as page not found with error 500, and on the error.log Premature end of script headers").
Why does this happen? Why Apache doesn't like this?