Click to See Complete Forum and Search --> : Perl & SSI


KungFuMonkey
01-19-2001, 11:00 PM
Im running apache and im running CGI perl scripts and i was just wondedring how ot get SSI to work

specifically
<!--#config timefmt="%A, %B %d, %Y"-->
<!--#echo var="DATE_LOCAL"-->


i have tried
print "Content type : wwwserver/html-ssi\n\n";

but it doesnt work... any help would be great

YaRness
01-20-2001, 07:02 PM
if yo mean server-side includes, i think that's configured somewhere in apache. i forget how to enable it, and even how to use it, but i bet it's documented somewhere.

wait, hold on, i've got lincoln stein's book here, lemme see if it says anything useful...


uncomment the following lines in srm.conf:

AddType text/html shtml
AddHandler server-parsed shtml


that enables handling server-parsed .shtml files


You'll also need to enable server-side includes processing in access.conf or the per-director access control files. Add someting like the following to access.conf:

# Enable server-side includes in the document root
<Location/>
Options
</Location>



also if you don't wanna use .shtml extensions

you can turn on the Apache XBitHack feature. ...any HTML file that has the executable bit set is scanned for server-side includes. To turn on this feature, add the following line to srm.conf:

XBitHack on



hope that helps.

------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/

Sweede
01-21-2001, 03:26 AM
you cant put SSI syntax in a CGI script. apache only parses the file once. you can do wierd things to get around that, but it's not worth the time.

it'd be better to move to PHP anyways http://www.linuxnewbie.org/ubb/wink.gif