PDA

View Full Version : Server Side Includes (SSI)



Cilo
01-02-2004, 03:06 PM
Hello,,,,:D ,,,im new,,,greattt forum..:) ,,,i would just like to know where can i find on my CP if i have SSI active or not.....thanks..

loopforever
01-02-2004, 03:08 PM
SSI is enabled for all domains. For confirmation:

cat less /usr/local/directadmin/data/users/USERNAME/httpd.conf | grep +Includes

mike
01-12-2004, 04:45 PM
Please Please oh please tell me what i am doing wrong.

I am attempting to run the random text script from Matt's script arcive. It requires a server side include, and i can't for the life of me get it to work, will someone please check out this link and tell me why the script just sits there in the source instead of getting the data from the cgi.....
http:\\www.mikeandkelly.net\random.shtml

Thank you very much in advance,
mike

mike
01-12-2004, 05:10 PM
I can't get mine to work:

http:\\www.mikeandkelly.net\random.shtml

any help would be appreciated

existenz
01-12-2004, 09:10 PM
You should check your post here:


Please don't double post! Most of us read through the entire forum it will get answered!

Server Side Includes (SSI) (http://directadmin.com/forum/showthread.php?s=&threadid=1681)

ProWebUK
01-13-2004, 03:44 AM
The include is unreable and there is nothing else being done by the page..... therefore you get a blank page being displayed.

http://www.mikeandkelly.net/cgi-bin/rand_text.pl

Looks like a permissions problem to me :)

Chris

ProWebUK
01-13-2004, 03:44 AM
Transferred to user level difficulties.

ProWebUK
01-13-2004, 03:48 AM
And the 2 threads merged together :)

mike
01-13-2004, 07:23 AM
Sorry for the double thread, I thought mine was both a new topic and related to that topic, again sorry. If it is a permissions problem, what permissions should i fix. It is not the permissions on the script b/c even when i just try a simple inclue like:
<!--#echo var="LAST_MODIFIED" -->
it doesn't work......

mike
01-14-2004, 03:39 PM
I have decided the above is not implemented on this server. However now I am getting a:
Premature end of script headers:
Error
The permission on my script is 755 , I transfered using ASCII and the script is as follows:

#!/usr/bin/perl

use CGI;
$random_file = "..\random.txt";
$delimiter = "\n\%\%\n";
open(FILE,"$random_file") || &error('open->random_file',$random_file);
@FILE = <FILE>;
close(FILE);
$phrases = join('',@FILE);
@phrases = split(/$delimiter/,$phrases);
srand(time ^ $$);
$phrase = rand(@phrases);
print "Content-type: text/html\n\n";
print $phrases[$phrase];
exit;
sub error {
($error,$file) = @_;
print <<"END_ERROR";
Content-type: text/html

<html>
<head>
<title>ERROR: Random File Unopenable</title>
</head>
<body bgcolor=#FFFFFF text=#000000>
<center>
<h1>ERROR: Random File Unopenable</h1>
</center>

The random file, as specified in the \$random_file perl variable was
unopenable.<p>
END_ERROR

if (-e $random_file) {
print "The file was found on your system, so make sure that it is\n";
print "readable by the web server. This means you will need to\n";
print "execute the following command:<pre>\n";
print " chmod 744 $random_file\n";
print "</pre>\n";
}
else {
print "The file was not found on your file system. This means that\n";
print "it has either not been created or the path you have specified\n";
print "in \$trrandom_file is incorrect.\n";
}
exit;
}

mike
01-14-2004, 03:58 PM
It was in the permissions, but it wasn't that I was allowing too little, It was that I was allowing too much. Permissions for scripts should be 744 here.