cgi server side include for newbie...

T

tommy.thomas

i'm a new web developer working for a large university w/ several
department sites hosted on a number of different servers.

we are currently trying to globalize all of the header/footer
navigation.

the problem is the global header and footer live on one server....while
other department sites are scattered from server to server.

we use ssi includes for local directories just fine.

i'm trying to use a "proxy" perl script to GET the .html printed
through the perl script as follows:

this file is in a cgi-bin directory named "proxy.pl" on any server:

<--------------------------------------proxy.pl---------------------------------------->

#! /usr/bin/perl

use LWP::Simple;
print "Content-type:text/html\n\n";
getprint($ENV{'QUERY_STRING'});


<-------------------------------------------------------------------------------------------->

then i insert this tag in any html file on remote servers:

<!--#include
VIRTUAL="/cgi-bin/proxy.pl?http://www.mydomain.edu/header.html" -->

when the page loads, it spits out the perl script "literally"

"#! /usr/bin/perl use LWP::Simple; print "Content-type:text/html\n\n";
getprint($ENV{'QUERY_STRING'});"

i want it to print the contents of "header.html": <table>...some
navigation html...</table>

am i missing something? can it be done?

any suggestions are appreciated.

t$
 
A

A. Sinan Unur

(e-mail address removed) wrote in
i'm a new web developer working for a large university w/ several
department sites hosted on a number of different servers.

we are currently trying to globalize all of the header/footer
navigation.

the problem is the global header and footer live on one
server....while other department sites are scattered from server to
server.

This sounds crazy to me (and it gets crazier below). How often do the
header and footer change? If I were you, I would seriously consider a
different replication and synchronization scheme for common elements.

<!--#include
VIRTUAL="/cgi-bin/proxy.pl?http://www.mydomain.edu/header.html" -->

when the page loads, it spits out the perl script "literally"

Which it is supposed to.

The <!--#exec cmd="..."--> directive should be used to include the
output of a command. However, this, as the Apache manual points out, is
exceedingly dangerous.

Note that, your question, in its entirety, is about web server
configuration, and as such, it is off-topic here.

To bring it back to Perl, I am going to suggest that you look into the
Template Toolkit or HTML::Template modules.

Sinan
 
T

tommy.thomas

Thanks to everyone for the suggestions, I've tried all of the above w/
no luck. Barring changing the server configuratiom, can anyone offer an
alternative that would be simple to facilitate?
 
T

tommy.thomas

Thanks to everyone for the suggestions, I've tried all of the above w/
no luck. Barring changing the server configuratiom, can anyone offer an
alternative that would be simple to facilitate?
 
T

tommy.thomas

Thanks to everyone for the suggestions, I've tried all of the above w/
no luck. Barring changing the server configuratiom, can anyone offer an
alternative that would be simple to facilitate?
 
T

tommy.thomas

Part of the problem is that the header/footer constitute global
navigation while the department sites live on different servers. The
ultimate goal is to be able to make changes to one file and have all
department sites automatically populate the update.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top